@@ -2,6 +2,95 @@ import type { BaseHttpRequest } from './core/BaseHttpRequest';
2
2
import type { OpenAPIConfig } from './core/OpenAPI' ;
3
3
import { Interceptors } from './core/OpenAPI' ;
4
4
import { FetchHttpRequest } from './core/FetchHttpRequest' ;
5
+ < < < << << HEAD
6
+ | | | | | | | e7dd037
7
+ import { ApiKeyService } from './services/ApiKeyService' ;
8
+ import { BranchService } from './services/BranchService' ;
9
+ import { ConsumptionService } from './services/ConsumptionService' ;
10
+ import { EndpointService } from './services/EndpointService' ;
11
+ import { OperationService } from './services/OperationService' ;
12
+ import { ProjectService } from './services/ProjectService' ;
13
+ import { UsersService } from './services/UsersService' ;
14
+ type HttpRequestConstructor = new ( config : OpenAPIConfig ) => BaseHttpRequest ;
15
+ export class NeonClient {
16
+ public readonly apiKey : ApiKeyService ;
17
+ public readonly branch : BranchService ;
18
+ public readonly consumption : ConsumptionService ;
19
+ public readonly endpoint : EndpointService ;
20
+ public readonly operation : OperationService ;
21
+ public readonly project : ProjectService ;
22
+ public readonly users : UsersService ;
23
+ public readonly request : BaseHttpRequest ;
24
+ constructor ( config ?: Partial < OpenAPIConfig > , HttpRequest : HttpRequestConstructor = FetchHttpRequest ) {
25
+ this . request = new HttpRequest ( {
26
+ BASE : config ?. BASE ?? 'https://console.neon.tech/api/v2' ,
27
+ VERSION : config ?. VERSION ?? '2' ,
28
+ WITH_CREDENTIALS : config ?. WITH_CREDENTIALS ?? false ,
29
+ CREDENTIALS : config ?. CREDENTIALS ?? 'include' ,
30
+ TOKEN : config ?. TOKEN ,
31
+ USERNAME : config ?. USERNAME ,
32
+ PASSWORD : config ?. PASSWORD ,
33
+ HEADERS : config ?. HEADERS ,
34
+ ENCODE_PATH : config ?. ENCODE_PATH ,
35
+ } ) ;
36
+ this . apiKey = new ApiKeyService ( this . request ) ;
37
+ this . branch = new BranchService ( this . request ) ;
38
+ this . consumption = new ConsumptionService ( this . request ) ;
39
+ this . endpoint = new EndpointService ( this . request ) ;
40
+ this . operation = new OperationService ( this . request ) ;
41
+ this . project = new ProjectService ( this . request ) ;
42
+ this . users = new UsersService ( this . request ) ;
43
+ }
44
+ }
45
+ === === =
46
+ import { ApiKeyService } from '. / services / ApiKeyService ';
47
+ import { AuthService } from '. / services / AuthService ';
48
+ import { BranchService } from '. / services / BranchService ';
49
+ import { ConsumptionService } from '. / services / ConsumptionService ';
50
+ import { EndpointService } from '. / services / EndpointService ';
51
+ import { OperationService } from '. / services / OperationService ';
52
+ import { OrganizationsService } from '. / services / OrganizationsService ';
53
+ import { ProjectService } from '. / services / ProjectService ';
54
+ import { RegionService } from '. / services / RegionService ';
55
+ import { UsersService } from '. / services / UsersService ';
56
+ type HttpRequestConstructor = new ( config : OpenAPIConfig ) => BaseHttpRequest ;
57
+ export class NeonClient {
58
+ public readonly apiKey : ApiKeyService ;
59
+ public readonly auth : AuthService ;
60
+ public readonly branch : BranchService ;
61
+ public readonly consumption : ConsumptionService ;
62
+ public readonly endpoint : EndpointService ;
63
+ public readonly operation : OperationService ;
64
+ public readonly organizations : OrganizationsService ;
65
+ public readonly project : ProjectService ;
66
+ public readonly region : RegionService ;
67
+ public readonly users : UsersService ;
68
+ public readonly request : BaseHttpRequest ;
69
+ constructor ( config ?: Partial < OpenAPIConfig > , HttpRequest : HttpRequestConstructor = FetchHttpRequest ) {
70
+ this . request = new HttpRequest ( {
71
+ BASE : config ?.BASE ?? 'https://console.neon.tech/api/v2' ,
72
+ VERSION : config ?. VERSION ?? '2' ,
73
+ WITH_CREDENTIALS : config ?. WITH_CREDENTIALS ?? false ,
74
+ CREDENTIALS : config ?. CREDENTIALS ?? 'include' ,
75
+ TOKEN : config ?. TOKEN ,
76
+ USERNAME : config ?. USERNAME ,
77
+ PASSWORD : config ?. PASSWORD ,
78
+ HEADERS : config ?. HEADERS ,
79
+ ENCODE_PATH : config ?. ENCODE_PATH ,
80
+ } ) ;
81
+ this . apiKey = new ApiKeyService ( this . request ) ;
82
+ this . auth = new AuthService ( this . request ) ;
83
+ this . branch = new BranchService ( this . request ) ;
84
+ this . consumption = new ConsumptionService ( this . request ) ;
85
+ this . endpoint = new EndpointService ( this . request ) ;
86
+ this . operation = new OperationService ( this . request ) ;
87
+ this . organizations = new OrganizationsService ( this . request ) ;
88
+ this . project = new ProjectService ( this . request ) ;
89
+ this . region = new RegionService ( this . request ) ;
90
+ this . users = new UsersService ( this . request ) ;
91
+ }
92
+ }
93
+ >>> >>> > main
5
94
6
95
import { ApiKeyService } from './services.gen' ;
7
96
import { AuthService } from './services.gen' ;
0 commit comments