Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(api): OpenAPI spec update via Stainless API #697

Merged
merged 1 commit into from
May 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 1321
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-15ceeb11cd4134501a557652ceaeacda4b60ea635ea5ac2e0d06974b130cc60a.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-1f68e176f43592631364d94df7670824a599296f6734ca70ffa94454c58da466.yml
5 changes: 3 additions & 2 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -5214,14 +5214,15 @@ Types:
- <code><a href="./src/resources/zero-trust/gateway/proxy-endpoints.ts">GatewayIPs</a></code>
- <code><a href="./src/resources/zero-trust/gateway/proxy-endpoints.ts">ProxyEndpoint</a></code>
- <code><a href="./src/resources/zero-trust/gateway/proxy-endpoints.ts">ProxyEndpointDeleteResponse</a></code>
- <code><a href="./src/resources/zero-trust/gateway/proxy-endpoints.ts">ProxyEndpointGetResponse</a></code>

Methods:

- <code title="post /accounts/{account_id}/gateway/proxy_endpoints">client.zeroTrust.gateway.proxyEndpoints.<a href="./src/resources/zero-trust/gateway/proxy-endpoints.ts">create</a>({ ...params }) -> ProxyEndpoint</code>
- <code title="get /accounts/{account_id}/gateway/proxy_endpoints">client.zeroTrust.gateway.proxyEndpoints.<a href="./src/resources/zero-trust/gateway/proxy-endpoints.ts">list</a>({ ...params }) -> ProxyEndpointsSinglePage</code>
- <code title="get /accounts/{account_id}/gateway/proxy_endpoints">client.zeroTrust.gateway.proxyEndpoints.<a href="./src/resources/zero-trust/gateway/proxy-endpoints.ts">list</a>({ ...params }) -> ProxyEndpoint</code>
- <code title="delete /accounts/{account_id}/gateway/proxy_endpoints/{proxy_endpoint_id}">client.zeroTrust.gateway.proxyEndpoints.<a href="./src/resources/zero-trust/gateway/proxy-endpoints.ts">delete</a>(proxyEndpointId, { ...params }) -> ProxyEndpointDeleteResponse</code>
- <code title="patch /accounts/{account_id}/gateway/proxy_endpoints/{proxy_endpoint_id}">client.zeroTrust.gateway.proxyEndpoints.<a href="./src/resources/zero-trust/gateway/proxy-endpoints.ts">edit</a>(proxyEndpointId, { ...params }) -> ProxyEndpoint</code>
- <code title="get /accounts/{account_id}/gateway/proxy_endpoints/{proxy_endpoint_id}">client.zeroTrust.gateway.proxyEndpoints.<a href="./src/resources/zero-trust/gateway/proxy-endpoints.ts">get</a>(proxyEndpointId, { ...params }) -> ProxyEndpoint</code>
- <code title="get /accounts/{account_id}/gateway/proxy_endpoints/{proxy_endpoint_id}">client.zeroTrust.gateway.proxyEndpoints.<a href="./src/resources/zero-trust/gateway/proxy-endpoints.ts">get</a>(proxyEndpointId, { ...params }) -> ProxyEndpointGetResponse | null</code>

### Rules

Expand Down
2 changes: 1 addition & 1 deletion src/resources/zero-trust/gateway/gateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export namespace Gateway {
export import GatewayIPs = ProxyEndpointsAPI.GatewayIPs;
export import ProxyEndpoint = ProxyEndpointsAPI.ProxyEndpoint;
export import ProxyEndpointDeleteResponse = ProxyEndpointsAPI.ProxyEndpointDeleteResponse;
export import ProxyEndpointsSinglePage = ProxyEndpointsAPI.ProxyEndpointsSinglePage;
export import ProxyEndpointGetResponse = ProxyEndpointsAPI.ProxyEndpointGetResponse;
export import ProxyEndpointCreateParams = ProxyEndpointsAPI.ProxyEndpointCreateParams;
export import ProxyEndpointListParams = ProxyEndpointsAPI.ProxyEndpointListParams;
export import ProxyEndpointDeleteParams = ProxyEndpointsAPI.ProxyEndpointDeleteParams;
Expand Down
2 changes: 1 addition & 1 deletion src/resources/zero-trust/gateway/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ export {
GatewayIPs,
ProxyEndpoint,
ProxyEndpointDeleteResponse,
ProxyEndpointGetResponse,
ProxyEndpointCreateParams,
ProxyEndpointListParams,
ProxyEndpointDeleteParams,
ProxyEndpointEditParams,
ProxyEndpointGetParams,
ProxyEndpointsSinglePage,
ProxyEndpoints,
} from './proxy-endpoints';
export {
Expand Down
30 changes: 13 additions & 17 deletions src/resources/zero-trust/gateway/proxy-endpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import * as Core from '../../../core';
import { APIResource } from '../../../resource';
import * as ProxyEndpointsAPI from './proxy-endpoints';
import { SinglePage } from '../../../pagination';

export class ProxyEndpoints extends APIResource {
/**
Expand All @@ -20,18 +19,15 @@ export class ProxyEndpoints extends APIResource {
}

/**
* Fetches a single Zero Trust Gateway proxy endpoint.
* Fetches all Zero Trust Gateway proxy endpoints for an account.
*/
list(
params: ProxyEndpointListParams,
options?: Core.RequestOptions,
): Core.PagePromise<ProxyEndpointsSinglePage, ProxyEndpoint> {
list(params: ProxyEndpointListParams, options?: Core.RequestOptions): Core.APIPromise<ProxyEndpoint> {
const { account_id } = params;
return this._client.getAPIList(
`/accounts/${account_id}/gateway/proxy_endpoints`,
ProxyEndpointsSinglePage,
options,
);
return (
this._client.get(`/accounts/${account_id}/gateway/proxy_endpoints`, options) as Core.APIPromise<{
result: ProxyEndpoint;
}>
)._thenUnwrap((obj) => obj.result);
}

/**
Expand Down Expand Up @@ -69,25 +65,23 @@ export class ProxyEndpoints extends APIResource {
}

/**
* Fetches all Zero Trust Gateway proxy endpoints for an account.
* Fetches a single Zero Trust Gateway proxy endpoint.
*/
get(
proxyEndpointId: string,
params: ProxyEndpointGetParams,
options?: Core.RequestOptions,
): Core.APIPromise<ProxyEndpoint> {
): Core.APIPromise<ProxyEndpointGetResponse | null> {
const { account_id } = params;
return (
this._client.get(
`/accounts/${account_id}/gateway/proxy_endpoints/${proxyEndpointId}`,
options,
) as Core.APIPromise<{ result: ProxyEndpoint }>
) as Core.APIPromise<{ result: ProxyEndpointGetResponse | null }>
)._thenUnwrap((obj) => obj.result);
}
}

export class ProxyEndpointsSinglePage extends SinglePage<ProxyEndpoint> {}

/**
* The IPv4 CIDR or IPv6 CIDR. IPv6 CIDRs are limited to a maximum of /109. IPv4
* CIDRs are limited to a maximum of /25.
Expand Down Expand Up @@ -125,6 +119,8 @@ export interface ProxyEndpoint {

export type ProxyEndpointDeleteResponse = unknown | string | null;

export type ProxyEndpointGetResponse = Array<ProxyEndpoint>;

export interface ProxyEndpointCreateParams {
/**
* Path param:
Expand Down Expand Up @@ -175,7 +171,7 @@ export namespace ProxyEndpoints {
export import GatewayIPs = ProxyEndpointsAPI.GatewayIPs;
export import ProxyEndpoint = ProxyEndpointsAPI.ProxyEndpoint;
export import ProxyEndpointDeleteResponse = ProxyEndpointsAPI.ProxyEndpointDeleteResponse;
export import ProxyEndpointsSinglePage = ProxyEndpointsAPI.ProxyEndpointsSinglePage;
export import ProxyEndpointGetResponse = ProxyEndpointsAPI.ProxyEndpointGetResponse;
export import ProxyEndpointCreateParams = ProxyEndpointsAPI.ProxyEndpointCreateParams;
export import ProxyEndpointListParams = ProxyEndpointsAPI.ProxyEndpointListParams;
export import ProxyEndpointDeleteParams = ProxyEndpointsAPI.ProxyEndpointDeleteParams;
Expand Down