33import { APIResource } from '../../resource' ;
44import * as Core from '../../core' ;
55import * as HyperdriveAPI from './hyperdrive' ;
6- import { HyperdrivesSinglePage } from './hyperdrive ' ;
6+ import { SinglePage } from '../../pagination ' ;
77
88export class Configs extends APIResource {
99 /**
1010 * Creates and returns a new Hyperdrive configuration.
1111 */
12- create (
13- params : ConfigCreateParams ,
14- options ?: Core . RequestOptions ,
15- ) : Core . APIPromise < HyperdriveAPI . Hyperdrive > {
12+ create ( params : ConfigCreateParams , options ?: Core . RequestOptions ) : Core . APIPromise < ConfigCreateResponse > {
1613 const { account_id, ...body } = params ;
1714 return (
1815 this . _client . post ( `/accounts/${ account_id } /hyperdrive/configs` , {
1916 body,
2017 ...options ,
21- } ) as Core . APIPromise < { result : HyperdriveAPI . Hyperdrive } >
18+ } ) as Core . APIPromise < { result : ConfigCreateResponse } >
2219 ) . _thenUnwrap ( ( obj ) => obj . result ) ;
2320 }
2421
@@ -29,13 +26,13 @@ export class Configs extends APIResource {
2926 hyperdriveId : string ,
3027 params : ConfigUpdateParams ,
3128 options ?: Core . RequestOptions ,
32- ) : Core . APIPromise < HyperdriveAPI . Hyperdrive > {
29+ ) : Core . APIPromise < ConfigUpdateResponse > {
3330 const { account_id, ...body } = params ;
3431 return (
3532 this . _client . put ( `/accounts/${ account_id } /hyperdrive/configs/${ hyperdriveId } ` , {
3633 body,
3734 ...options ,
38- } ) as Core . APIPromise < { result : HyperdriveAPI . Hyperdrive } >
35+ } ) as Core . APIPromise < { result : ConfigUpdateResponse } >
3936 ) . _thenUnwrap ( ( obj ) => obj . result ) ;
4037 }
4138
@@ -45,11 +42,11 @@ export class Configs extends APIResource {
4542 list (
4643 params : ConfigListParams ,
4744 options ?: Core . RequestOptions ,
48- ) : Core . PagePromise < HyperdrivesSinglePage , HyperdriveAPI . Hyperdrive > {
45+ ) : Core . PagePromise < ConfigListResponsesSinglePage , ConfigListResponse > {
4946 const { account_id } = params ;
5047 return this . _client . getAPIList (
5148 `/accounts/${ account_id } /hyperdrive/configs` ,
52- HyperdrivesSinglePage ,
49+ ConfigListResponsesSinglePage ,
5350 options ,
5451 ) ;
5552 }
@@ -79,13 +76,13 @@ export class Configs extends APIResource {
7976 hyperdriveId : string ,
8077 params : ConfigEditParams ,
8178 options ?: Core . RequestOptions ,
82- ) : Core . APIPromise < HyperdriveAPI . Hyperdrive > {
79+ ) : Core . APIPromise < ConfigEditResponse > {
8380 const { account_id, ...body } = params ;
8481 return (
8582 this . _client . patch ( `/accounts/${ account_id } /hyperdrive/configs/${ hyperdriveId } ` , {
8683 body,
8784 ...options ,
88- } ) as Core . APIPromise < { result : HyperdriveAPI . Hyperdrive } >
85+ } ) as Core . APIPromise < { result : ConfigEditResponse } >
8986 ) . _thenUnwrap ( ( obj ) => obj . result ) ;
9087 }
9188
@@ -96,19 +93,81 @@ export class Configs extends APIResource {
9693 hyperdriveId : string ,
9794 params : ConfigGetParams ,
9895 options ?: Core . RequestOptions ,
99- ) : Core . APIPromise < HyperdriveAPI . Hyperdrive > {
96+ ) : Core . APIPromise < ConfigGetResponse > {
10097 const { account_id } = params ;
10198 return (
10299 this . _client . get (
103100 `/accounts/${ account_id } /hyperdrive/configs/${ hyperdriveId } ` ,
104101 options ,
105- ) as Core . APIPromise < { result : HyperdriveAPI . Hyperdrive } >
102+ ) as Core . APIPromise < { result : ConfigGetResponse } >
106103 ) . _thenUnwrap ( ( obj ) => obj . result ) ;
107104 }
108105}
109106
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+
110145export type ConfigDeleteResponse = unknown ;
111146
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+
112171export interface ConfigCreateParams {
113172 /**
114173 * Path param: Identifier
@@ -171,7 +230,7 @@ export namespace ConfigCreateParams {
171230
172231 export interface AccessProtectedDatabaseBehindCloudflareTunnel {
173232 /**
174- * The Client ID of the Access token to use when connecting to the origin database
233+ * The Client ID of the Access token to use when connecting to the origin database.
175234 */
176235 access_client_id : string ;
177236
@@ -297,7 +356,7 @@ export namespace ConfigUpdateParams {
297356
298357 export interface AccessProtectedDatabaseBehindCloudflareTunnel {
299358 /**
300- * The Client ID of the Access token to use when connecting to the origin database
359+ * The Client ID of the Access token to use when connecting to the origin database.
301360 */
302361 access_client_id : string ;
303362
@@ -466,7 +525,7 @@ export namespace ConfigEditParams {
466525
467526 export interface HyperdriveHyperdriveOverAccessOrigin {
468527 /**
469- * The Client ID of the Access token to use when connecting to the origin database
528+ * The Client ID of the Access token to use when connecting to the origin database.
470529 */
471530 access_client_id : string ;
472531
@@ -490,9 +549,17 @@ export interface ConfigGetParams {
490549 account_id : string ;
491550}
492551
552+ Configs . ConfigListResponsesSinglePage = ConfigListResponsesSinglePage ;
553+
493554export declare namespace Configs {
494555 export {
556+ type ConfigCreateResponse as ConfigCreateResponse ,
557+ type ConfigUpdateResponse as ConfigUpdateResponse ,
558+ type ConfigListResponse as ConfigListResponse ,
495559 type ConfigDeleteResponse as ConfigDeleteResponse ,
560+ type ConfigEditResponse as ConfigEditResponse ,
561+ type ConfigGetResponse as ConfigGetResponse ,
562+ ConfigListResponsesSinglePage as ConfigListResponsesSinglePage ,
496563 type ConfigCreateParams as ConfigCreateParams ,
497564 type ConfigUpdateParams as ConfigUpdateParams ,
498565 type ConfigListParams as ConfigListParams ,
@@ -501,5 +568,3 @@ export declare namespace Configs {
501568 type ConfigGetParams as ConfigGetParams ,
502569 } ;
503570}
504-
505- export { HyperdrivesSinglePage } ;
0 commit comments