|
1 |
| -import { ApplicationApi, ApplicationIn, ApplicationOut, ApplicationPatch, Configuration, ListResponseApplicationOut, Ordering } from "../openapi"; |
| 1 | +import { |
| 2 | + ApplicationApi, |
| 3 | + ApplicationIn, |
| 4 | + ApplicationOut, |
| 5 | + ApplicationPatch, |
| 6 | + Configuration, |
| 7 | + ListResponseApplicationOut, |
| 8 | + Ordering, |
| 9 | +} from "../openapi"; |
2 | 10 | import { PostOptions } from "../util";
|
3 | 11 |
|
4 | 12 | export interface ApplicationListOptions {
|
5 |
| - /// Limit the number of returned items |
6 |
| - limit?: number; |
7 |
| - /// The iterator returned from a prior invocation |
8 |
| - iterator?: string | null; |
9 |
| - /// The sorting order of the returned items |
10 |
| - order?: Ordering; |
| 13 | + /// Limit the number of returned items |
| 14 | + limit?: number; |
| 15 | + /// The iterator returned from a prior invocation |
| 16 | + iterator?: string | null; |
| 17 | + /// The sorting order of the returned items |
| 18 | + order?: Ordering; |
11 | 19 | }
|
12 | 20 |
|
13 | 21 | export class Application {
|
14 |
| - private readonly api: ApplicationApi; |
15 |
| - |
16 |
| - public constructor(config: Configuration) { |
17 |
| - this.api = new ApplicationApi(config); |
18 |
| - } |
19 |
| - |
20 |
| - public list(options?: ApplicationListOptions): Promise<ListResponseApplicationOut> { |
21 |
| - const iterator = options?.iterator ?? undefined; |
22 |
| - return this.api.v1ApplicationList({ ...options, iterator }); |
23 |
| - } |
24 |
| - |
25 |
| - public create( |
26 |
| - applicationIn: ApplicationIn, |
27 |
| - options?: PostOptions |
28 |
| - ): Promise<ApplicationOut> { |
29 |
| - return this.api.v1ApplicationCreate({ applicationIn, ...options }); |
30 |
| - } |
31 |
| - |
32 |
| - public getOrCreate( |
33 |
| - applicationIn: ApplicationIn, |
34 |
| - options?: PostOptions |
35 |
| - ): Promise<ApplicationOut> { |
36 |
| - return this.api.v1ApplicationCreate({ |
37 |
| - applicationIn, |
38 |
| - ...options, |
39 |
| - getIfExists: true, |
40 |
| - }); |
41 |
| - } |
42 |
| - |
43 |
| - public get(appId: string): Promise<ApplicationOut> { |
44 |
| - return this.api.v1ApplicationGet({ appId }); |
45 |
| - } |
46 |
| - |
47 |
| - public update(appId: string, applicationIn: ApplicationIn): Promise<ApplicationOut> { |
48 |
| - return this.api.v1ApplicationUpdate({ appId, applicationIn }); |
49 |
| - } |
50 |
| - |
51 |
| - public patch( |
52 |
| - appId: string, |
53 |
| - applicationPatch: ApplicationPatch |
54 |
| - ): Promise<ApplicationOut> { |
55 |
| - return this.api.v1ApplicationPatch({ appId, applicationPatch }); |
56 |
| - } |
57 |
| - |
58 |
| - public delete(appId: string): Promise<void> { |
59 |
| - return this.api.v1ApplicationDelete({ appId }); |
60 |
| - } |
| 22 | + private readonly api: ApplicationApi; |
| 23 | + |
| 24 | + public constructor(config: Configuration) { |
| 25 | + this.api = new ApplicationApi(config); |
| 26 | + } |
| 27 | + |
| 28 | + public list(options?: ApplicationListOptions): Promise<ListResponseApplicationOut> { |
| 29 | + const iterator = options?.iterator ?? undefined; |
| 30 | + return this.api.v1ApplicationList({ ...options, iterator }); |
| 31 | + } |
| 32 | + |
| 33 | + public create( |
| 34 | + applicationIn: ApplicationIn, |
| 35 | + options?: PostOptions |
| 36 | + ): Promise<ApplicationOut> { |
| 37 | + return this.api.v1ApplicationCreate({ applicationIn, ...options }); |
| 38 | + } |
| 39 | + |
| 40 | + public getOrCreate( |
| 41 | + applicationIn: ApplicationIn, |
| 42 | + options?: PostOptions |
| 43 | + ): Promise<ApplicationOut> { |
| 44 | + return this.api.v1ApplicationCreate({ |
| 45 | + applicationIn, |
| 46 | + ...options, |
| 47 | + getIfExists: true, |
| 48 | + }); |
| 49 | + } |
| 50 | + |
| 51 | + public get(appId: string): Promise<ApplicationOut> { |
| 52 | + return this.api.v1ApplicationGet({ appId }); |
| 53 | + } |
| 54 | + |
| 55 | + public update(appId: string, applicationIn: ApplicationIn): Promise<ApplicationOut> { |
| 56 | + return this.api.v1ApplicationUpdate({ appId, applicationIn }); |
| 57 | + } |
| 58 | + |
| 59 | + public patch( |
| 60 | + appId: string, |
| 61 | + applicationPatch: ApplicationPatch |
| 62 | + ): Promise<ApplicationOut> { |
| 63 | + return this.api.v1ApplicationPatch({ appId, applicationPatch }); |
| 64 | + } |
| 65 | + |
| 66 | + public delete(appId: string): Promise<void> { |
| 67 | + return this.api.v1ApplicationDelete({ appId }); |
| 68 | + } |
61 | 69 | }
|
0 commit comments