Skip to content

Commit

Permalink
feat(api): update via SDK Studio (#521)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed May 13, 2024
1 parent bde582f commit 5a50a1d
Show file tree
Hide file tree
Showing 10 changed files with 480 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 1281
configured_endpoints: 1286
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9a8e3aedb1193065fd84ae0b74a4a4c2d217ff2a821096f825a7798bbb921d76.yml
17 changes: 17 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -3400,6 +3400,22 @@ Methods:
- <code title="delete /accounts/{account_id}/magic/sites/{site_id}/wans/{wan_id}">client.magicTransit.sites.wans.<a href="./src/resources/magic-transit/sites/wans.ts">delete</a>(siteId, wanId, { ...params }) -> WAN</code>
- <code title="get /accounts/{account_id}/magic/sites/{site_id}/wans/{wan_id}">client.magicTransit.sites.wans.<a href="./src/resources/magic-transit/sites/wans.ts">get</a>(siteId, wanId, { ...params }) -> WAN</code>

## Connectors

Types:

- <code><a href="./src/resources/magic-transit/connectors.ts">ConnectorUpdateResponse</a></code>
- <code><a href="./src/resources/magic-transit/connectors.ts">ConnectorListResponse</a></code>
- <code><a href="./src/resources/magic-transit/connectors.ts">ConnectorEditResponse</a></code>
- <code><a href="./src/resources/magic-transit/connectors.ts">ConnectorGetResponse</a></code>

Methods:

- <code title="put /accounts/{account_id}/magic/connectors/{connector_id}">client.magicTransit.connectors.<a href="./src/resources/magic-transit/connectors.ts">update</a>(connectorId, { ...params }) -> ConnectorUpdateResponse</code>
- <code title="get /accounts/{account_id}/magic/connectors">client.magicTransit.connectors.<a href="./src/resources/magic-transit/connectors.ts">list</a>({ ...params }) -> ConnectorListResponsesSinglePage</code>
- <code title="patch /accounts/{account_id}/magic/connectors/{connector_id}">client.magicTransit.connectors.<a href="./src/resources/magic-transit/connectors.ts">edit</a>(connectorId, { ...params }) -> ConnectorEditResponse</code>
- <code title="get /accounts/{account_id}/magic/connectors/{connector_id}">client.magicTransit.connectors.<a href="./src/resources/magic-transit/connectors.ts">get</a>(connectorId, { ...params }) -> ConnectorGetResponse</code>

# MagicNetworkMonitoring

## Configs
Expand Down Expand Up @@ -4536,6 +4552,7 @@ Methods:
- <code title="put /{account_or_zone}/{account_or_zone_id}/access/service_tokens/{uuid}">client.zeroTrust.access.serviceTokens.<a href="./src/resources/zero-trust/access/service-tokens.ts">update</a>(uuid, { ...params }) -> ServiceToken</code>
- <code title="get /{account_or_zone}/{account_or_zone_id}/access/service_tokens">client.zeroTrust.access.serviceTokens.<a href="./src/resources/zero-trust/access/service-tokens.ts">list</a>({ ...params }) -> ServiceTokensSinglePage</code>
- <code title="delete /{account_or_zone}/{account_or_zone_id}/access/service_tokens/{uuid}">client.zeroTrust.access.serviceTokens.<a href="./src/resources/zero-trust/access/service-tokens.ts">delete</a>(uuid, { ...params }) -> ServiceToken</code>
- <code title="get /{account_or_zone}/{account_or_zone_id}/access/service_tokens/{uuid}">client.zeroTrust.access.serviceTokens.<a href="./src/resources/zero-trust/access/service-tokens.ts">get</a>(uuid, { ...params }) -> ServiceToken</code>
- <code title="post /accounts/{identifier}/access/service_tokens/{uuid}/refresh">client.zeroTrust.access.serviceTokens.<a href="./src/resources/zero-trust/access/service-tokens.ts">refresh</a>(identifier, uuid) -> ServiceToken</code>
- <code title="post /accounts/{identifier}/access/service_tokens/{uuid}/rotate">client.zeroTrust.access.serviceTokens.<a href="./src/resources/zero-trust/access/service-tokens.ts">rotate</a>(identifier, uuid) -> ServiceTokenRotateResponse</code>

Expand Down
280 changes: 280 additions & 0 deletions src/resources/magic-transit/connectors.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,280 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

import * as Core from '../../core';
import { APIResource } from '../../resource';
import * as ConnectorsAPI from './connectors';
import { SinglePage } from '../../pagination';

export class Connectors extends APIResource {
/**
* Replace Connector
*/
update(
connectorId: string,
params: ConnectorUpdateParams,
options?: Core.RequestOptions,
): Core.APIPromise<ConnectorUpdateResponse> {
const { account_id, ...body } = params;
return (
this._client.put(`/accounts/${account_id}/magic/connectors/${connectorId}`, {
body,
...options,
}) as Core.APIPromise<{ result: ConnectorUpdateResponse }>
)._thenUnwrap((obj) => obj.result);
}

/**
* List Connectors
*/
list(
params: ConnectorListParams,
options?: Core.RequestOptions,
): Core.PagePromise<ConnectorListResponsesSinglePage, ConnectorListResponse> {
const { account_id } = params;
return this._client.getAPIList(
`/accounts/${account_id}/magic/connectors`,
ConnectorListResponsesSinglePage,
options,
);
}

/**
* Update Connector
*/
edit(
connectorId: string,
params: ConnectorEditParams,
options?: Core.RequestOptions,
): Core.APIPromise<ConnectorEditResponse> {
const { account_id, ...body } = params;
return (
this._client.patch(`/accounts/${account_id}/magic/connectors/${connectorId}`, {
body,
...options,
}) as Core.APIPromise<{ result: ConnectorEditResponse }>
)._thenUnwrap((obj) => obj.result);
}

/**
* Fetch Connector
*/
get(
connectorId: string,
params: ConnectorGetParams,
options?: Core.RequestOptions,
): Core.APIPromise<ConnectorGetResponse> {
const { account_id } = params;
return (
this._client.get(
`/accounts/${account_id}/magic/connectors/${connectorId}`,
options,
) as Core.APIPromise<{ result: ConnectorGetResponse }>
)._thenUnwrap((obj) => obj.result);
}
}

export class ConnectorListResponsesSinglePage extends SinglePage<ConnectorListResponse> {}

export interface ConnectorUpdateResponse {
id: string;

activated: boolean;

interrupt_window_duration_hours: number;

interrupt_window_hour_of_day: number;

last_updated: string;

notes: string;

timezone: string;

device?: ConnectorUpdateResponse.Device;

last_heartbeat?: string;

last_seen_version?: string;
}

export namespace ConnectorUpdateResponse {
export interface Device {
id: string;

serial_number?: string;
}
}

export interface ConnectorListResponse {
id: string;

activated: boolean;

interrupt_window_duration_hours: number;

interrupt_window_hour_of_day: number;

last_updated: string;

notes: string;

timezone: string;

device?: ConnectorListResponse.Device;

last_heartbeat?: string;

last_seen_version?: string;
}

export namespace ConnectorListResponse {
export interface Device {
id: string;

serial_number?: string;
}
}

export interface ConnectorEditResponse {
id: string;

activated: boolean;

interrupt_window_duration_hours: number;

interrupt_window_hour_of_day: number;

last_updated: string;

notes: string;

timezone: string;

device?: ConnectorEditResponse.Device;

last_heartbeat?: string;

last_seen_version?: string;
}

export namespace ConnectorEditResponse {
export interface Device {
id: string;

serial_number?: string;
}
}

export interface ConnectorGetResponse {
id: string;

activated: boolean;

interrupt_window_duration_hours: number;

interrupt_window_hour_of_day: number;

last_updated: string;

notes: string;

timezone: string;

device?: ConnectorGetResponse.Device;

last_heartbeat?: string;

last_seen_version?: string;
}

export namespace ConnectorGetResponse {
export interface Device {
id: string;

serial_number?: string;
}
}

export interface ConnectorUpdateParams {
/**
* Path param:
*/
account_id: number;

/**
* Body param:
*/
activated?: boolean;

/**
* Body param:
*/
interrupt_window_duration_hours?: number;

/**
* Body param:
*/
interrupt_window_hour_of_day?: number;

/**
* Body param:
*/
notes?: string;

/**
* Body param:
*/
timezone?: string;
}

export interface ConnectorListParams {
account_id: number;
}

export interface ConnectorEditParams {
/**
* Path param:
*/
account_id: number;

/**
* Body param:
*/
activated?: boolean;

/**
* Body param:
*/
interrupt_window_duration_hours?: number;

/**
* Body param:
*/
interrupt_window_hour_of_day?: number;

/**
* Body param:
*/
notes?: string;

/**
* Body param:
*/
timezone?: string;
}

export interface ConnectorGetParams {
account_id: number;
}

export namespace Connectors {
export import ConnectorUpdateResponse = ConnectorsAPI.ConnectorUpdateResponse;
export import ConnectorListResponse = ConnectorsAPI.ConnectorListResponse;
export import ConnectorEditResponse = ConnectorsAPI.ConnectorEditResponse;
export import ConnectorGetResponse = ConnectorsAPI.ConnectorGetResponse;
export import ConnectorListResponsesSinglePage = ConnectorsAPI.ConnectorListResponsesSinglePage;
export import ConnectorUpdateParams = ConnectorsAPI.ConnectorUpdateParams;
export import ConnectorListParams = ConnectorsAPI.ConnectorListParams;
export import ConnectorEditParams = ConnectorsAPI.ConnectorEditParams;
export import ConnectorGetParams = ConnectorsAPI.ConnectorGetParams;
}
12 changes: 12 additions & 0 deletions src/resources/magic-transit/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,18 @@ export {
CfInterconnectGetParams,
CfInterconnects,
} from './cf-interconnects';
export {
ConnectorUpdateResponse,
ConnectorListResponse,
ConnectorEditResponse,
ConnectorGetResponse,
ConnectorUpdateParams,
ConnectorListParams,
ConnectorEditParams,
ConnectorGetParams,
ConnectorListResponsesSinglePage,
Connectors,
} from './connectors';
export {
GRETunnelCreateResponse,
GRETunnelUpdateResponse,
Expand Down
12 changes: 12 additions & 0 deletions src/resources/magic-transit/magic-transit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import { APIResource } from '../../resource';
import * as CfInterconnectsAPI from './cf-interconnects';
import * as ConnectorsAPI from './connectors';
import * as GRETunnelsAPI from './gre-tunnels';
import * as IPSECTunnelsAPI from './ipsec-tunnels';
import * as RoutesAPI from './routes';
Expand All @@ -13,6 +14,7 @@ export class MagicTransit extends APIResource {
ipsecTunnels: IPSECTunnelsAPI.IPSECTunnels = new IPSECTunnelsAPI.IPSECTunnels(this._client);
routes: RoutesAPI.Routes = new RoutesAPI.Routes(this._client);
sites: SitesAPI.Sites = new SitesAPI.Sites(this._client);
connectors: ConnectorsAPI.Connectors = new ConnectorsAPI.Connectors(this._client);
}

export interface HealthCheck {
Expand Down Expand Up @@ -163,4 +165,14 @@ export namespace MagicTransit {
export import SiteListParams = SitesAPI.SiteListParams;
export import SiteDeleteParams = SitesAPI.SiteDeleteParams;
export import SiteGetParams = SitesAPI.SiteGetParams;
export import Connectors = ConnectorsAPI.Connectors;
export import ConnectorUpdateResponse = ConnectorsAPI.ConnectorUpdateResponse;
export import ConnectorListResponse = ConnectorsAPI.ConnectorListResponse;
export import ConnectorEditResponse = ConnectorsAPI.ConnectorEditResponse;
export import ConnectorGetResponse = ConnectorsAPI.ConnectorGetResponse;
export import ConnectorListResponsesSinglePage = ConnectorsAPI.ConnectorListResponsesSinglePage;
export import ConnectorUpdateParams = ConnectorsAPI.ConnectorUpdateParams;
export import ConnectorListParams = ConnectorsAPI.ConnectorListParams;
export import ConnectorEditParams = ConnectorsAPI.ConnectorEditParams;
export import ConnectorGetParams = ConnectorsAPI.ConnectorGetParams;
}
1 change: 1 addition & 0 deletions src/resources/zero-trust/access/access.ts
Original file line number Diff line number Diff line change
Expand Up @@ -781,6 +781,7 @@ export namespace Access {
export import ServiceTokenUpdateParams = ServiceTokensAPI.ServiceTokenUpdateParams;
export import ServiceTokenListParams = ServiceTokensAPI.ServiceTokenListParams;
export import ServiceTokenDeleteParams = ServiceTokensAPI.ServiceTokenDeleteParams;
export import ServiceTokenGetParams = ServiceTokensAPI.ServiceTokenGetParams;
export import Bookmarks = BookmarksAPI.Bookmarks;
export import Bookmark = BookmarksAPI.Bookmark;
export import BookmarkDeleteResponse = BookmarksAPI.BookmarkDeleteResponse;
Expand Down
1 change: 1 addition & 0 deletions src/resources/zero-trust/access/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ export {
ServiceTokenUpdateParams,
ServiceTokenListParams,
ServiceTokenDeleteParams,
ServiceTokenGetParams,
ServiceTokensSinglePage,
ServiceTokens,
} from './service-tokens';
Expand Down
Loading

0 comments on commit 5a50a1d

Please sign in to comment.