33import { APIResource } from '../../resource' ;
44import * as Core from '../../core' ;
55import * as HyperdriveAPI from './hyperdrive' ;
6- import { SinglePage } from '../../pagination ' ;
6+ import { HyperdrivesSinglePage } from './hyperdrive ' ;
77
88export 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-
145110export 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-
171112export 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
464405export 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-
554493export 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 } ;
0 commit comments