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): api update #2333

Merged
merged 1 commit into from
Jan 16, 2025
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
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 1494
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-817b1412335b2bc367169247bf8a10b29dbadb82b77df71df5ef5f3470fc974b.yml
configured_endpoints: 1493
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5e32fa5d8d6040e3c40095cc73f64d0a3b7a88824f57f5a2667663297a9f3113.yml
25 changes: 11 additions & 14 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -2553,7 +2553,7 @@ Methods:

- <code title="post /{account_or_zone}/{account_or_zone_id}/rulesets">client.rulesets.<a href="./src/resources/rulesets/rulesets.ts">create</a>({ ...params }) -> RulesetCreateResponse</code>
- <code title="put /{account_or_zone}/{account_or_zone_id}/rulesets/{ruleset_id}">client.rulesets.<a href="./src/resources/rulesets/rulesets.ts">update</a>(rulesetId, { ...params }) -> RulesetUpdateResponse</code>
- <code title="get /{account_or_zone}/{account_or_zone_id}/rulesets">client.rulesets.<a href="./src/resources/rulesets/rulesets.ts">list</a>({ ...params }) -> RulesetListResponsesSinglePage</code>
- <code title="get /{account_or_zone}/{account_or_zone_id}/rulesets">client.rulesets.<a href="./src/resources/rulesets/rulesets.ts">list</a>({ ...params }) -> RulesetListResponsesCursorPagination</code>
- <code title="delete /{account_or_zone}/{account_or_zone_id}/rulesets/{ruleset_id}">client.rulesets.<a href="./src/resources/rulesets/rulesets.ts">delete</a>(rulesetId, { ...params }) -> void</code>
- <code title="get /{account_or_zone}/{account_or_zone_id}/rulesets/{ruleset_id}">client.rulesets.<a href="./src/resources/rulesets/rulesets.ts">get</a>(rulesetId, { ...params }) -> RulesetGetResponse</code>

Expand Down Expand Up @@ -4910,14 +4910,6 @@ Methods:

#### Users

Types:

- <code><a href="./src/resources/zero-trust/dex/commands/users.ts">UserListResponse</a></code>

Methods:

- <code title="get /accounts/{account_id}/dex/commands/users">client.zeroTrust.dex.commands.users.<a href="./src/resources/zero-trust/dex/commands/users.ts">list</a>({ ...params }) -> UserListResponse</code>

#### Devices

Types:
Expand Down Expand Up @@ -5651,16 +5643,21 @@ Types:

Types:

- <code><a href="./src/resources/hyperdrive/configs.ts">ConfigCreateResponse</a></code>
- <code><a href="./src/resources/hyperdrive/configs.ts">ConfigUpdateResponse</a></code>
- <code><a href="./src/resources/hyperdrive/configs.ts">ConfigListResponse</a></code>
- <code><a href="./src/resources/hyperdrive/configs.ts">ConfigDeleteResponse</a></code>
- <code><a href="./src/resources/hyperdrive/configs.ts">ConfigEditResponse</a></code>
- <code><a href="./src/resources/hyperdrive/configs.ts">ConfigGetResponse</a></code>

Methods:

- <code title="post /accounts/{account_id}/hyperdrive/configs">client.hyperdrive.configs.<a href="./src/resources/hyperdrive/configs.ts">create</a>({ ...params }) -> Hyperdrive</code>
- <code title="put /accounts/{account_id}/hyperdrive/configs/{hyperdrive_id}">client.hyperdrive.configs.<a href="./src/resources/hyperdrive/configs.ts">update</a>(hyperdriveId, { ...params }) -> Hyperdrive</code>
- <code title="get /accounts/{account_id}/hyperdrive/configs">client.hyperdrive.configs.<a href="./src/resources/hyperdrive/configs.ts">list</a>({ ...params }) -> HyperdrivesSinglePage</code>
- <code title="post /accounts/{account_id}/hyperdrive/configs">client.hyperdrive.configs.<a href="./src/resources/hyperdrive/configs.ts">create</a>({ ...params }) -> ConfigCreateResponse</code>
- <code title="put /accounts/{account_id}/hyperdrive/configs/{hyperdrive_id}">client.hyperdrive.configs.<a href="./src/resources/hyperdrive/configs.ts">update</a>(hyperdriveId, { ...params }) -> ConfigUpdateResponse</code>
- <code title="get /accounts/{account_id}/hyperdrive/configs">client.hyperdrive.configs.<a href="./src/resources/hyperdrive/configs.ts">list</a>({ ...params }) -> ConfigListResponsesSinglePage</code>
- <code title="delete /accounts/{account_id}/hyperdrive/configs/{hyperdrive_id}">client.hyperdrive.configs.<a href="./src/resources/hyperdrive/configs.ts">delete</a>(hyperdriveId, { ...params }) -> ConfigDeleteResponse | null</code>
- <code title="patch /accounts/{account_id}/hyperdrive/configs/{hyperdrive_id}">client.hyperdrive.configs.<a href="./src/resources/hyperdrive/configs.ts">edit</a>(hyperdriveId, { ...params }) -> Hyperdrive</code>
- <code title="get /accounts/{account_id}/hyperdrive/configs/{hyperdrive_id}">client.hyperdrive.configs.<a href="./src/resources/hyperdrive/configs.ts">get</a>(hyperdriveId, { ...params }) -> Hyperdrive</code>
- <code title="patch /accounts/{account_id}/hyperdrive/configs/{hyperdrive_id}">client.hyperdrive.configs.<a href="./src/resources/hyperdrive/configs.ts">edit</a>(hyperdriveId, { ...params }) -> ConfigEditResponse</code>
- <code title="get /accounts/{account_id}/hyperdrive/configs/{hyperdrive_id}">client.hyperdrive.configs.<a href="./src/resources/hyperdrive/configs.ts">get</a>(hyperdriveId, { ...params }) -> ConfigGetResponse</code>

# RUM

Expand Down
103 changes: 84 additions & 19 deletions src/resources/hyperdrive/configs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,19 @@
import { APIResource } from '../../resource';
import * as Core from '../../core';
import * as HyperdriveAPI from './hyperdrive';
import { HyperdrivesSinglePage } from './hyperdrive';
import { SinglePage } from '../../pagination';

export class Configs extends APIResource {
/**
* Creates and returns a new Hyperdrive configuration.
*/
create(
params: ConfigCreateParams,
options?: Core.RequestOptions,
): Core.APIPromise<HyperdriveAPI.Hyperdrive> {
create(params: ConfigCreateParams, options?: Core.RequestOptions): Core.APIPromise<ConfigCreateResponse> {
const { account_id, ...body } = params;
return (
this._client.post(`/accounts/${account_id}/hyperdrive/configs`, {
body,
...options,
}) as Core.APIPromise<{ result: HyperdriveAPI.Hyperdrive }>
}) as Core.APIPromise<{ result: ConfigCreateResponse }>
)._thenUnwrap((obj) => obj.result);
}

Expand All @@ -29,13 +26,13 @@ export class Configs extends APIResource {
hyperdriveId: string,
params: ConfigUpdateParams,
options?: Core.RequestOptions,
): Core.APIPromise<HyperdriveAPI.Hyperdrive> {
): Core.APIPromise<ConfigUpdateResponse> {
const { account_id, ...body } = params;
return (
this._client.put(`/accounts/${account_id}/hyperdrive/configs/${hyperdriveId}`, {
body,
...options,
}) as Core.APIPromise<{ result: HyperdriveAPI.Hyperdrive }>
}) as Core.APIPromise<{ result: ConfigUpdateResponse }>
)._thenUnwrap((obj) => obj.result);
}

Expand All @@ -45,11 +42,11 @@ export class Configs extends APIResource {
list(
params: ConfigListParams,
options?: Core.RequestOptions,
): Core.PagePromise<HyperdrivesSinglePage, HyperdriveAPI.Hyperdrive> {
): Core.PagePromise<ConfigListResponsesSinglePage, ConfigListResponse> {
const { account_id } = params;
return this._client.getAPIList(
`/accounts/${account_id}/hyperdrive/configs`,
HyperdrivesSinglePage,
ConfigListResponsesSinglePage,
options,
);
}
Expand Down Expand Up @@ -79,13 +76,13 @@ export class Configs extends APIResource {
hyperdriveId: string,
params: ConfigEditParams,
options?: Core.RequestOptions,
): Core.APIPromise<HyperdriveAPI.Hyperdrive> {
): Core.APIPromise<ConfigEditResponse> {
const { account_id, ...body } = params;
return (
this._client.patch(`/accounts/${account_id}/hyperdrive/configs/${hyperdriveId}`, {
body,
...options,
}) as Core.APIPromise<{ result: HyperdriveAPI.Hyperdrive }>
}) as Core.APIPromise<{ result: ConfigEditResponse }>
)._thenUnwrap((obj) => obj.result);
}

Expand All @@ -96,19 +93,81 @@ export class Configs extends APIResource {
hyperdriveId: string,
params: ConfigGetParams,
options?: Core.RequestOptions,
): Core.APIPromise<HyperdriveAPI.Hyperdrive> {
): Core.APIPromise<ConfigGetResponse> {
const { account_id } = params;
return (
this._client.get(
`/accounts/${account_id}/hyperdrive/configs/${hyperdriveId}`,
options,
) as Core.APIPromise<{ result: HyperdriveAPI.Hyperdrive }>
) as Core.APIPromise<{ result: ConfigGetResponse }>
)._thenUnwrap((obj) => obj.result);
}
}

export class ConfigListResponsesSinglePage extends SinglePage<ConfigListResponse> {}

export interface ConfigCreateResponse extends HyperdriveAPI.Hyperdrive {
/**
* When the Hyperdrive configuration was created.
*/
created_on?: string;

/**
* When the Hyperdrive configuration was last modified.
*/
modified_on?: string;
}

export interface ConfigUpdateResponse extends HyperdriveAPI.Hyperdrive {
/**
* When the Hyperdrive configuration was created.
*/
created_on?: string;

/**
* When the Hyperdrive configuration was last modified.
*/
modified_on?: string;
}

export interface ConfigListResponse extends HyperdriveAPI.Hyperdrive {
/**
* When the Hyperdrive configuration was created.
*/
created_on?: string;

/**
* When the Hyperdrive configuration was last modified.
*/
modified_on?: string;
}

export type ConfigDeleteResponse = unknown;

export interface ConfigEditResponse extends HyperdriveAPI.Hyperdrive {
/**
* When the Hyperdrive configuration was created.
*/
created_on?: string;

/**
* When the Hyperdrive configuration was last modified.
*/
modified_on?: string;
}

export interface ConfigGetResponse extends HyperdriveAPI.Hyperdrive {
/**
* When the Hyperdrive configuration was created.
*/
created_on?: string;

/**
* When the Hyperdrive configuration was last modified.
*/
modified_on?: string;
}

export interface ConfigCreateParams {
/**
* Path param: Identifier
Expand Down Expand Up @@ -171,7 +230,7 @@ export namespace ConfigCreateParams {

export interface AccessProtectedDatabaseBehindCloudflareTunnel {
/**
* The Client ID of the Access token to use when connecting to the origin database
* The Client ID of the Access token to use when connecting to the origin database.
*/
access_client_id: string;

Expand Down Expand Up @@ -297,7 +356,7 @@ export namespace ConfigUpdateParams {

export interface AccessProtectedDatabaseBehindCloudflareTunnel {
/**
* The Client ID of the Access token to use when connecting to the origin database
* The Client ID of the Access token to use when connecting to the origin database.
*/
access_client_id: string;

Expand Down Expand Up @@ -466,7 +525,7 @@ export namespace ConfigEditParams {

export interface HyperdriveHyperdriveOverAccessOrigin {
/**
* The Client ID of the Access token to use when connecting to the origin database
* The Client ID of the Access token to use when connecting to the origin database.
*/
access_client_id: string;

Expand All @@ -490,9 +549,17 @@ export interface ConfigGetParams {
account_id: string;
}

Configs.ConfigListResponsesSinglePage = ConfigListResponsesSinglePage;

export declare namespace Configs {
export {
type ConfigCreateResponse as ConfigCreateResponse,
type ConfigUpdateResponse as ConfigUpdateResponse,
type ConfigListResponse as ConfigListResponse,
type ConfigDeleteResponse as ConfigDeleteResponse,
type ConfigEditResponse as ConfigEditResponse,
type ConfigGetResponse as ConfigGetResponse,
ConfigListResponsesSinglePage as ConfigListResponsesSinglePage,
type ConfigCreateParams as ConfigCreateParams,
type ConfigUpdateParams as ConfigUpdateParams,
type ConfigListParams as ConfigListParams,
Expand All @@ -501,5 +568,3 @@ export declare namespace Configs {
type ConfigGetParams as ConfigGetParams,
};
}

export { HyperdrivesSinglePage };
20 changes: 15 additions & 5 deletions src/resources/hyperdrive/hyperdrive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,25 @@ import { APIResource } from '../../resource';
import * as ConfigsAPI from './configs';
import {
ConfigCreateParams,
ConfigCreateResponse,
ConfigDeleteParams,
ConfigDeleteResponse,
ConfigEditParams,
ConfigEditResponse,
ConfigGetParams,
ConfigGetResponse,
ConfigListParams,
ConfigListResponse,
ConfigListResponsesSinglePage,
ConfigUpdateParams,
ConfigUpdateResponse,
Configs,
} from './configs';
import { SinglePage } from '../../pagination';

export class HyperdriveResource extends APIResource {
configs: ConfigsAPI.Configs = new ConfigsAPI.Configs(this._client);
}

export class HyperdrivesSinglePage extends SinglePage<Hyperdrive> {}

export type Configuration =
| Configuration.HyperdriveHyperdriveInternetOrigin
| Configuration.HyperdriveHyperdriveOverAccessOrigin;
Expand Down Expand Up @@ -54,7 +57,7 @@ export namespace Configuration {

export interface HyperdriveHyperdriveOverAccessOrigin {
/**
* The Client ID of the Access token to use when connecting to the origin database
* The Client ID of the Access token to use when connecting to the origin database.
*/
access_client_id: string;

Expand Down Expand Up @@ -123,7 +126,7 @@ export namespace Hyperdrive {

export interface AccessProtectedDatabaseBehindCloudflareTunnel {
/**
* The Client ID of the Access token to use when connecting to the origin database
* The Client ID of the Access token to use when connecting to the origin database.
*/
access_client_id: string;

Expand Down Expand Up @@ -176,11 +179,18 @@ export namespace Hyperdrive {
}

HyperdriveResource.Configs = Configs;
HyperdriveResource.ConfigListResponsesSinglePage = ConfigListResponsesSinglePage;

export declare namespace HyperdriveResource {
export {
Configs as Configs,
type ConfigCreateResponse as ConfigCreateResponse,
type ConfigUpdateResponse as ConfigUpdateResponse,
type ConfigListResponse as ConfigListResponse,
type ConfigDeleteResponse as ConfigDeleteResponse,
type ConfigEditResponse as ConfigEditResponse,
type ConfigGetResponse as ConfigGetResponse,
ConfigListResponsesSinglePage as ConfigListResponsesSinglePage,
type ConfigCreateParams as ConfigCreateParams,
type ConfigUpdateParams as ConfigUpdateParams,
type ConfigListParams as ConfigListParams,
Expand Down
6 changes: 6 additions & 0 deletions src/resources/hyperdrive/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

export {
ConfigListResponsesSinglePage,
Configs,
type ConfigCreateResponse,
type ConfigUpdateResponse,
type ConfigListResponse,
type ConfigDeleteResponse,
type ConfigEditResponse,
type ConfigGetResponse,
type ConfigCreateParams,
type ConfigUpdateParams,
type ConfigListParams,
Expand Down
Loading