Skip to content

Commit 1c477de

Browse files
1132 generateOpenAPI - client
1 parent 27805c5 commit 1c477de

File tree

7 files changed

+400
-0
lines changed

7 files changed

+400
-0
lines changed

client/src/shared/middleware/platform/configuration/.openapi-generator/FILES

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ apis/ActionDefinitionApi.ts
22
apis/ClusterElementDefinitionApi.ts
33
apis/ComponentDefinitionApi.ts
44
apis/ConnectionDefinitionApi.ts
5+
apis/NotificationApi.ts
6+
apis/NotificationEventApi.ts
57
apis/Oauth2Api.ts
68
apis/TaskDispatcherDefinitionApi.ts
79
apis/TriggerDefinitionApi.ts
@@ -45,6 +47,8 @@ models/GetWorkflowNodeDescription200Response.ts
4547
models/GetWorkflowNodeParameterDisplayConditions200Response.ts
4648
models/Help.ts
4749
models/IntegerProperty.ts
50+
models/Notification.ts
51+
models/NotificationEvent.ts
4852
models/NullProperty.ts
4953
models/NumberProperty.ts
5054
models/OAuth2AuthorizationParameters.ts
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
/* tslint:disable */
2+
/* eslint-disable */
3+
/**
4+
* The Platform Configuration Internal API
5+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6+
*
7+
* The version of the OpenAPI document: 1
8+
*
9+
*
10+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11+
* https://openapi-generator.tech
12+
* Do not edit the class manually.
13+
*/
14+
15+
16+
import * as runtime from '../runtime';
17+
import type {
18+
Notification,
19+
} from '../models/index';
20+
import {
21+
NotificationFromJSON,
22+
NotificationToJSON,
23+
} from '../models/index';
24+
25+
export interface PostNotificationRequest {
26+
notification: Omit<Notification, 'id'|'createdBy'|'createdDate'|'lastModifiedBy'|'lastModifiedDate'>;
27+
}
28+
29+
/**
30+
*
31+
*/
32+
export class NotificationApi extends runtime.BaseAPI {
33+
34+
/**
35+
* Get a list of notifications
36+
* Get a list of notifications
37+
*/
38+
async getNotificationsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<Notification>>> {
39+
const queryParameters: any = {};
40+
41+
const headerParameters: runtime.HTTPHeaders = {};
42+
43+
const response = await this.request({
44+
path: `/notifications`,
45+
method: 'GET',
46+
headers: headerParameters,
47+
query: queryParameters,
48+
}, initOverrides);
49+
50+
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(NotificationFromJSON));
51+
}
52+
53+
/**
54+
* Get a list of notifications
55+
* Get a list of notifications
56+
*/
57+
async getNotifications(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<Notification>> {
58+
const response = await this.getNotificationsRaw(initOverrides);
59+
return await response.value();
60+
}
61+
62+
/**
63+
* Create a notification entry
64+
* Create a notification entry
65+
*/
66+
async postNotificationRaw(requestParameters: PostNotificationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Notification>> {
67+
if (requestParameters['notification'] == null) {
68+
throw new runtime.RequiredError(
69+
'notification',
70+
'Required parameter "notification" was null or undefined when calling postNotification().'
71+
);
72+
}
73+
74+
const queryParameters: any = {};
75+
76+
const headerParameters: runtime.HTTPHeaders = {};
77+
78+
headerParameters['Content-Type'] = 'application/json';
79+
80+
const response = await this.request({
81+
path: `/notifications`,
82+
method: 'POST',
83+
headers: headerParameters,
84+
query: queryParameters,
85+
body: NotificationToJSON(requestParameters['notification']),
86+
}, initOverrides);
87+
88+
return new runtime.JSONApiResponse(response, (jsonValue) => NotificationFromJSON(jsonValue));
89+
}
90+
91+
/**
92+
* Create a notification entry
93+
* Create a notification entry
94+
*/
95+
async postNotification(requestParameters: PostNotificationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Notification> {
96+
const response = await this.postNotificationRaw(requestParameters, initOverrides);
97+
return await response.value();
98+
}
99+
100+
}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
/* tslint:disable */
2+
/* eslint-disable */
3+
/**
4+
* The Platform Configuration Internal API
5+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6+
*
7+
* The version of the OpenAPI document: 1
8+
*
9+
*
10+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11+
* https://openapi-generator.tech
12+
* Do not edit the class manually.
13+
*/
14+
15+
16+
import * as runtime from '../runtime';
17+
import type {
18+
NotificationEvent,
19+
} from '../models/index';
20+
import {
21+
NotificationEventFromJSON,
22+
NotificationEventToJSON,
23+
} from '../models/index';
24+
25+
/**
26+
*
27+
*/
28+
export class NotificationEventApi extends runtime.BaseAPI {
29+
30+
/**
31+
* Get a list of possible notification events
32+
* Get a list of possible notification events
33+
*/
34+
async getNotificationEventsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<NotificationEvent>>> {
35+
const queryParameters: any = {};
36+
37+
const headerParameters: runtime.HTTPHeaders = {};
38+
39+
const response = await this.request({
40+
path: `/notifications/events`,
41+
method: 'GET',
42+
headers: headerParameters,
43+
query: queryParameters,
44+
}, initOverrides);
45+
46+
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(NotificationEventFromJSON));
47+
}
48+
49+
/**
50+
* Get a list of possible notification events
51+
* Get a list of possible notification events
52+
*/
53+
async getNotificationEvents(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<NotificationEvent>> {
54+
const response = await this.getNotificationEventsRaw(initOverrides);
55+
return await response.value();
56+
}
57+
58+
}

client/src/shared/middleware/platform/configuration/apis/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ export * from './ActionDefinitionApi';
44
export * from './ClusterElementDefinitionApi';
55
export * from './ComponentDefinitionApi';
66
export * from './ConnectionDefinitionApi';
7+
export * from './NotificationApi';
8+
export * from './NotificationEventApi';
79
export * from './Oauth2Api';
810
export * from './TaskDispatcherDefinitionApi';
911
export * from './TriggerDefinitionApi';
Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
/* tslint:disable */
2+
/* eslint-disable */
3+
/**
4+
* The Platform Configuration Internal API
5+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6+
*
7+
* The version of the OpenAPI document: 1
8+
*
9+
*
10+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11+
* https://openapi-generator.tech
12+
* Do not edit the class manually.
13+
*/
14+
15+
import { mapValues } from '../runtime';
16+
import type { NotificationEvent } from './NotificationEvent';
17+
import {
18+
NotificationEventFromJSON,
19+
NotificationEventFromJSONTyped,
20+
NotificationEventToJSON,
21+
NotificationEventToJSONTyped,
22+
} from './NotificationEvent';
23+
24+
/**
25+
* A Notification definition.
26+
* @export
27+
* @interface Notification
28+
*/
29+
export interface Notification {
30+
/**
31+
* Notification Id
32+
* @type {number}
33+
* @memberof Notification
34+
*/
35+
readonly id?: number;
36+
/**
37+
* The created by.
38+
* @type {string}
39+
* @memberof Notification
40+
*/
41+
readonly createdBy?: string;
42+
/**
43+
* The created date.
44+
* @type {Date}
45+
* @memberof Notification
46+
*/
47+
readonly createdDate?: Date;
48+
/**
49+
* The last modified by.
50+
* @type {string}
51+
* @memberof Notification
52+
*/
53+
readonly lastModifiedBy?: string;
54+
/**
55+
* The last modified date.
56+
* @type {Date}
57+
* @memberof Notification
58+
*/
59+
readonly lastModifiedDate?: Date;
60+
/**
61+
* Notification name
62+
* @type {string}
63+
* @memberof Notification
64+
*/
65+
name: string;
66+
/**
67+
* Type of the notification
68+
* @type {string}
69+
* @memberof Notification
70+
*/
71+
notificationType: NotificationNotificationTypeEnum;
72+
/**
73+
* Notification type related settings
74+
* @type {{ [key: string]: string; }}
75+
* @memberof Notification
76+
*/
77+
settings: { [key: string]: string; };
78+
/**
79+
* List of events for which notification will be triggered
80+
* @type {Array<NotificationEvent>}
81+
* @memberof Notification
82+
*/
83+
events: Array<NotificationEvent>;
84+
}
85+
86+
87+
/**
88+
* @export
89+
*/
90+
export const NotificationNotificationTypeEnum = {
91+
Email: 'EMAIL',
92+
Webhook: 'WEBHOOK'
93+
} as const;
94+
export type NotificationNotificationTypeEnum = typeof NotificationNotificationTypeEnum[keyof typeof NotificationNotificationTypeEnum];
95+
96+
97+
/**
98+
* Check if a given object implements the Notification interface.
99+
*/
100+
export function instanceOfNotification(value: object): value is Notification {
101+
if (!('name' in value) || value['name'] === undefined) return false;
102+
if (!('notificationType' in value) || value['notificationType'] === undefined) return false;
103+
if (!('settings' in value) || value['settings'] === undefined) return false;
104+
if (!('events' in value) || value['events'] === undefined) return false;
105+
return true;
106+
}
107+
108+
export function NotificationFromJSON(json: any): Notification {
109+
return NotificationFromJSONTyped(json, false);
110+
}
111+
112+
export function NotificationFromJSONTyped(json: any, ignoreDiscriminator: boolean): Notification {
113+
if (json == null) {
114+
return json;
115+
}
116+
return {
117+
118+
'id': json['id'] == null ? undefined : json['id'],
119+
'createdBy': json['createdBy'] == null ? undefined : json['createdBy'],
120+
'createdDate': json['createdDate'] == null ? undefined : (new Date(json['createdDate'])),
121+
'lastModifiedBy': json['lastModifiedBy'] == null ? undefined : json['lastModifiedBy'],
122+
'lastModifiedDate': json['lastModifiedDate'] == null ? undefined : (new Date(json['lastModifiedDate'])),
123+
'name': json['name'],
124+
'notificationType': json['notificationType'],
125+
'settings': json['settings'],
126+
'events': ((json['events'] as Array<any>).map(NotificationEventFromJSON)),
127+
};
128+
}
129+
130+
export function NotificationToJSON(json: any): Notification {
131+
return NotificationToJSONTyped(json, false);
132+
}
133+
134+
export function NotificationToJSONTyped(value?: Omit<Notification, 'id'|'createdBy'|'createdDate'|'lastModifiedBy'|'lastModifiedDate'> | null, ignoreDiscriminator: boolean = false): any {
135+
if (value == null) {
136+
return value;
137+
}
138+
139+
return {
140+
141+
'name': value['name'],
142+
'notificationType': value['notificationType'],
143+
'settings': value['settings'],
144+
'events': ((value['events'] as Array<any>).map(NotificationEventToJSON)),
145+
};
146+
}
147+

0 commit comments

Comments
 (0)