Skip to content

Commit cd03eaa

Browse files
feat(api): api update (#2444)
1 parent ccefb93 commit cd03eaa

File tree

5 files changed

+42
-120
lines changed

5 files changed

+42
-120
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 1542
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ff77b01a8aa4bc99c36a35e11d503c26273a07f9290349abac2c718c93edb537.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-bb6df922da650979c566ff066e024180b52a44c367f9b6a2dfc4e007a71b6809.yml

api.md

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5745,21 +5745,16 @@ Types:
57455745

57465746
Types:
57475747

5748-
- <code><a href="./src/resources/hyperdrive/configs.ts">ConfigCreateResponse</a></code>
5749-
- <code><a href="./src/resources/hyperdrive/configs.ts">ConfigUpdateResponse</a></code>
5750-
- <code><a href="./src/resources/hyperdrive/configs.ts">ConfigListResponse</a></code>
57515748
- <code><a href="./src/resources/hyperdrive/configs.ts">ConfigDeleteResponse</a></code>
5752-
- <code><a href="./src/resources/hyperdrive/configs.ts">ConfigEditResponse</a></code>
5753-
- <code><a href="./src/resources/hyperdrive/configs.ts">ConfigGetResponse</a></code>
57545749

57555750
Methods:
57565751

5757-
- <code title="post /accounts/{account_id}/hyperdrive/configs">client.hyperdrive.configs.<a href="./src/resources/hyperdrive/configs.ts">create</a>({ ...params }) -> ConfigCreateResponse</code>
5758-
- <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>
5759-
- <code title="get /accounts/{account_id}/hyperdrive/configs">client.hyperdrive.configs.<a href="./src/resources/hyperdrive/configs.ts">list</a>({ ...params }) -> ConfigListResponsesSinglePage</code>
5752+
- <code title="post /accounts/{account_id}/hyperdrive/configs">client.hyperdrive.configs.<a href="./src/resources/hyperdrive/configs.ts">create</a>({ ...params }) -> Hyperdrive</code>
5753+
- <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>
5754+
- <code title="get /accounts/{account_id}/hyperdrive/configs">client.hyperdrive.configs.<a href="./src/resources/hyperdrive/configs.ts">list</a>({ ...params }) -> HyperdrivesSinglePage</code>
57605755
- <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>
5761-
- <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>
5762-
- <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>
5756+
- <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>
5757+
- <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>
57635758

57645759
# RUM
57655760

src/resources/hyperdrive/configs.ts

Lines changed: 20 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,22 @@
33
import { APIResource } from '../../resource';
44
import * as Core from '../../core';
55
import * as HyperdriveAPI from './hyperdrive';
6-
import { SinglePage } from '../../pagination';
6+
import { HyperdrivesSinglePage } from './hyperdrive';
77

88
export class Configs extends APIResource {
99
/**
1010
* Creates and returns a new Hyperdrive configuration.
1111
*/
12-
create(params: ConfigCreateParams, options?: Core.RequestOptions): Core.APIPromise<ConfigCreateResponse> {
12+
create(
13+
params: ConfigCreateParams,
14+
options?: Core.RequestOptions,
15+
): Core.APIPromise<HyperdriveAPI.Hyperdrive> {
1316
const { account_id, ...body } = params;
1417
return (
1518
this._client.post(`/accounts/${account_id}/hyperdrive/configs`, {
1619
body,
1720
...options,
18-
}) as Core.APIPromise<{ result: ConfigCreateResponse }>
21+
}) as Core.APIPromise<{ result: HyperdriveAPI.Hyperdrive }>
1922
)._thenUnwrap((obj) => obj.result);
2023
}
2124

@@ -26,13 +29,13 @@ export class Configs extends APIResource {
2629
hyperdriveId: string,
2730
params: ConfigUpdateParams,
2831
options?: Core.RequestOptions,
29-
): Core.APIPromise<ConfigUpdateResponse> {
32+
): Core.APIPromise<HyperdriveAPI.Hyperdrive> {
3033
const { account_id, ...body } = params;
3134
return (
3235
this._client.put(`/accounts/${account_id}/hyperdrive/configs/${hyperdriveId}`, {
3336
body,
3437
...options,
35-
}) as Core.APIPromise<{ result: ConfigUpdateResponse }>
38+
}) as Core.APIPromise<{ result: HyperdriveAPI.Hyperdrive }>
3639
)._thenUnwrap((obj) => obj.result);
3740
}
3841

@@ -42,11 +45,11 @@ export class Configs extends APIResource {
4245
list(
4346
params: ConfigListParams,
4447
options?: Core.RequestOptions,
45-
): Core.PagePromise<ConfigListResponsesSinglePage, ConfigListResponse> {
48+
): Core.PagePromise<HyperdrivesSinglePage, HyperdriveAPI.Hyperdrive> {
4649
const { account_id } = params;
4750
return this._client.getAPIList(
4851
`/accounts/${account_id}/hyperdrive/configs`,
49-
ConfigListResponsesSinglePage,
52+
HyperdrivesSinglePage,
5053
options,
5154
);
5255
}
@@ -76,13 +79,13 @@ export class Configs extends APIResource {
7679
hyperdriveId: string,
7780
params: ConfigEditParams,
7881
options?: Core.RequestOptions,
79-
): Core.APIPromise<ConfigEditResponse> {
82+
): Core.APIPromise<HyperdriveAPI.Hyperdrive> {
8083
const { account_id, ...body } = params;
8184
return (
8285
this._client.patch(`/accounts/${account_id}/hyperdrive/configs/${hyperdriveId}`, {
8386
body,
8487
...options,
85-
}) as Core.APIPromise<{ result: ConfigEditResponse }>
88+
}) as Core.APIPromise<{ result: HyperdriveAPI.Hyperdrive }>
8689
)._thenUnwrap((obj) => obj.result);
8790
}
8891

@@ -93,81 +96,19 @@ export class Configs extends APIResource {
9396
hyperdriveId: string,
9497
params: ConfigGetParams,
9598
options?: Core.RequestOptions,
96-
): Core.APIPromise<ConfigGetResponse> {
99+
): Core.APIPromise<HyperdriveAPI.Hyperdrive> {
97100
const { account_id } = params;
98101
return (
99102
this._client.get(
100103
`/accounts/${account_id}/hyperdrive/configs/${hyperdriveId}`,
101104
options,
102-
) as Core.APIPromise<{ result: ConfigGetResponse }>
105+
) as Core.APIPromise<{ result: HyperdriveAPI.Hyperdrive }>
103106
)._thenUnwrap((obj) => obj.result);
104107
}
105108
}
106109

107-
export class ConfigListResponsesSinglePage extends SinglePage<ConfigListResponse> {}
108-
109-
export interface ConfigCreateResponse extends HyperdriveAPI.Hyperdrive {
110-
/**
111-
* When the Hyperdrive configuration was created.
112-
*/
113-
created_on?: string;
114-
115-
/**
116-
* When the Hyperdrive configuration was last modified.
117-
*/
118-
modified_on?: string;
119-
}
120-
121-
export interface ConfigUpdateResponse extends HyperdriveAPI.Hyperdrive {
122-
/**
123-
* When the Hyperdrive configuration was created.
124-
*/
125-
created_on?: string;
126-
127-
/**
128-
* When the Hyperdrive configuration was last modified.
129-
*/
130-
modified_on?: string;
131-
}
132-
133-
export interface ConfigListResponse extends HyperdriveAPI.Hyperdrive {
134-
/**
135-
* When the Hyperdrive configuration was created.
136-
*/
137-
created_on?: string;
138-
139-
/**
140-
* When the Hyperdrive configuration was last modified.
141-
*/
142-
modified_on?: string;
143-
}
144-
145110
export type ConfigDeleteResponse = unknown;
146111

147-
export interface ConfigEditResponse extends HyperdriveAPI.Hyperdrive {
148-
/**
149-
* When the Hyperdrive configuration was created.
150-
*/
151-
created_on?: string;
152-
153-
/**
154-
* When the Hyperdrive configuration was last modified.
155-
*/
156-
modified_on?: string;
157-
}
158-
159-
export interface ConfigGetResponse extends HyperdriveAPI.Hyperdrive {
160-
/**
161-
* When the Hyperdrive configuration was created.
162-
*/
163-
created_on?: string;
164-
165-
/**
166-
* When the Hyperdrive configuration was last modified.
167-
*/
168-
modified_on?: string;
169-
}
170-
171112
export interface ConfigCreateParams {
172113
/**
173114
* Path param: Identifier
@@ -457,8 +398,8 @@ export interface ConfigEditParams {
457398
*/
458399
origin?:
459400
| ConfigEditParams.HyperdriveHyperdriveDatabase
460-
| ConfigEditParams.HyperdriveHyperdriveInternetOrigin
461-
| ConfigEditParams.HyperdriveHyperdriveOverAccessOrigin;
401+
| ConfigEditParams.HyperdriveInternetOrigin
402+
| ConfigEditParams.HyperdriveOverAccessOrigin;
462403
}
463404

464405
export namespace ConfigEditParams {
@@ -511,7 +452,7 @@ export namespace ConfigEditParams {
511452
user?: string;
512453
}
513454

514-
export interface HyperdriveHyperdriveInternetOrigin {
455+
export interface HyperdriveInternetOrigin {
515456
/**
516457
* The host (hostname or IP) of your origin database.
517458
*/
@@ -523,7 +464,7 @@ export namespace ConfigEditParams {
523464
port: number;
524465
}
525466

526-
export interface HyperdriveHyperdriveOverAccessOrigin {
467+
export interface HyperdriveOverAccessOrigin {
527468
/**
528469
* The Client ID of the Access token to use when connecting to the origin database.
529470
*/
@@ -549,17 +490,9 @@ export interface ConfigGetParams {
549490
account_id: string;
550491
}
551492

552-
Configs.ConfigListResponsesSinglePage = ConfigListResponsesSinglePage;
553-
554493
export declare namespace Configs {
555494
export {
556-
type ConfigCreateResponse as ConfigCreateResponse,
557-
type ConfigUpdateResponse as ConfigUpdateResponse,
558-
type ConfigListResponse as ConfigListResponse,
559495
type ConfigDeleteResponse as ConfigDeleteResponse,
560-
type ConfigEditResponse as ConfigEditResponse,
561-
type ConfigGetResponse as ConfigGetResponse,
562-
ConfigListResponsesSinglePage as ConfigListResponsesSinglePage,
563496
type ConfigCreateParams as ConfigCreateParams,
564497
type ConfigUpdateParams as ConfigUpdateParams,
565498
type ConfigListParams as ConfigListParams,
@@ -568,3 +501,5 @@ export declare namespace Configs {
568501
type ConfigGetParams as ConfigGetParams,
569502
};
570503
}
504+
505+
export { HyperdrivesSinglePage };

src/resources/hyperdrive/hyperdrive.ts

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,26 @@ import { APIResource } from '../../resource';
44
import * as ConfigsAPI from './configs';
55
import {
66
ConfigCreateParams,
7-
ConfigCreateResponse,
87
ConfigDeleteParams,
98
ConfigDeleteResponse,
109
ConfigEditParams,
11-
ConfigEditResponse,
1210
ConfigGetParams,
13-
ConfigGetResponse,
1411
ConfigListParams,
15-
ConfigListResponse,
16-
ConfigListResponsesSinglePage,
1712
ConfigUpdateParams,
18-
ConfigUpdateResponse,
1913
Configs,
2014
} from './configs';
15+
import { SinglePage } from '../../pagination';
2116

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

26-
export type Configuration =
27-
| Configuration.HyperdriveHyperdriveInternetOrigin
28-
| Configuration.HyperdriveHyperdriveOverAccessOrigin;
21+
export class HyperdrivesSinglePage extends SinglePage<Hyperdrive> {}
22+
23+
export type Configuration = Configuration.HyperdriveInternetOrigin | Configuration.HyperdriveOverAccessOrigin;
2924

3025
export namespace Configuration {
31-
export interface HyperdriveHyperdriveInternetOrigin {
26+
export interface HyperdriveInternetOrigin {
3227
/**
3328
* The host (hostname or IP) of your origin database.
3429
*/
@@ -55,7 +50,7 @@ export namespace Configuration {
5550
user?: string;
5651
}
5752

58-
export interface HyperdriveHyperdriveOverAccessOrigin {
53+
export interface HyperdriveOverAccessOrigin {
5954
/**
6055
* The Client ID of the Access token to use when connecting to the origin database.
6156
*/
@@ -94,6 +89,16 @@ export interface Hyperdrive {
9489
origin: Hyperdrive.PublicDatabase | Hyperdrive.AccessProtectedDatabaseBehindCloudflareTunnel;
9590

9691
caching?: Hyperdrive.HyperdriveHyperdriveCachingCommon | Hyperdrive.HyperdriveHyperdriveCachingEnabled;
92+
93+
/**
94+
* When the Hyperdrive configuration was created.
95+
*/
96+
created_on?: string;
97+
98+
/**
99+
* When the Hyperdrive configuration was last modified.
100+
*/
101+
modified_on?: string;
97102
}
98103

99104
export namespace Hyperdrive {
@@ -179,18 +184,11 @@ export namespace Hyperdrive {
179184
}
180185

181186
HyperdriveResource.Configs = Configs;
182-
HyperdriveResource.ConfigListResponsesSinglePage = ConfigListResponsesSinglePage;
183187

184188
export declare namespace HyperdriveResource {
185189
export {
186190
Configs as Configs,
187-
type ConfigCreateResponse as ConfigCreateResponse,
188-
type ConfigUpdateResponse as ConfigUpdateResponse,
189-
type ConfigListResponse as ConfigListResponse,
190191
type ConfigDeleteResponse as ConfigDeleteResponse,
191-
type ConfigEditResponse as ConfigEditResponse,
192-
type ConfigGetResponse as ConfigGetResponse,
193-
ConfigListResponsesSinglePage as ConfigListResponsesSinglePage,
194192
type ConfigCreateParams as ConfigCreateParams,
195193
type ConfigUpdateParams as ConfigUpdateParams,
196194
type ConfigListParams as ConfigListParams,

src/resources/hyperdrive/index.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
11
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
export {
4-
ConfigListResponsesSinglePage,
54
Configs,
6-
type ConfigCreateResponse,
7-
type ConfigUpdateResponse,
8-
type ConfigListResponse,
95
type ConfigDeleteResponse,
10-
type ConfigEditResponse,
11-
type ConfigGetResponse,
126
type ConfigCreateParams,
137
type ConfigUpdateParams,
148
type ConfigListParams,

0 commit comments

Comments
 (0)