forked from janus-idp/backstage-plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Regenerate openapi client in the frontend
- Loading branch information
1 parent
4dba6a6
commit f84cc14
Showing
12 changed files
with
1,508 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json", | ||
"spaces": 2, | ||
"generator-cli": { | ||
"version": "7.1.0" | ||
} | ||
} |
375 changes: 375 additions & 0 deletions
375
plugins/notifications-frontend/src/openapi/apis/NotificationsApi.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,375 @@ | ||
/* tslint:disable */ | ||
/* eslint-disable */ | ||
/** | ||
* Notifications Plugin - OpenAPI Specs | ||
* Notifications Plugin - OpenAPI Specs | ||
* | ||
* The version of the OpenAPI document: 1.0.0 | ||
* | ||
* | ||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). | ||
* https://openapi-generator.tech | ||
* Do not edit the class manually. | ||
*/ | ||
|
||
import type { | ||
CreateBody, | ||
CreateNotification200Response, | ||
GetNotificationsCount200Response, | ||
Notification, | ||
} from '../models/index'; | ||
import { | ||
CreateBodyFromJSON, | ||
CreateBodyToJSON, | ||
CreateNotification200ResponseFromJSON, | ||
CreateNotification200ResponseToJSON, | ||
GetNotificationsCount200ResponseFromJSON, | ||
GetNotificationsCount200ResponseToJSON, | ||
NotificationFromJSON, | ||
NotificationToJSON, | ||
} from '../models/index'; | ||
import * as runtime from '../runtime'; | ||
|
||
export interface CreateNotificationRequest { | ||
createBody?: CreateBody; | ||
} | ||
|
||
export interface GetNotificationsRequest { | ||
pageSize?: number; | ||
pageNumber?: number; | ||
orderBy?: GetNotificationsOrderByEnum; | ||
orderByDirec?: GetNotificationsOrderByDirecEnum; | ||
containsText?: string; | ||
createdAfter?: Date; | ||
messageScope?: GetNotificationsMessageScopeEnum; | ||
user?: string; | ||
read?: boolean; | ||
} | ||
|
||
export interface GetNotificationsCountRequest { | ||
containsText?: string; | ||
createdAfter?: Date; | ||
messageScope?: GetNotificationsCountMessageScopeEnum; | ||
user?: string; | ||
read?: boolean; | ||
} | ||
|
||
export interface SetReadRequest { | ||
messageId: string; | ||
user: string; | ||
read: boolean; | ||
} | ||
|
||
/** | ||
* | ||
*/ | ||
export class NotificationsApi extends runtime.BaseAPI { | ||
/** | ||
* Create notification | ||
* Create notification | ||
*/ | ||
async createNotificationRaw( | ||
requestParameters: CreateNotificationRequest, | ||
initOverrides?: RequestInit | runtime.InitOverrideFunction, | ||
): Promise<runtime.ApiResponse<CreateNotification200Response>> { | ||
const queryParameters: any = {}; | ||
|
||
const headerParameters: runtime.HTTPHeaders = {}; | ||
|
||
headerParameters['Content-Type'] = 'application/json'; | ||
|
||
const response = await this.request( | ||
{ | ||
path: `/notifications`, | ||
method: 'POST', | ||
headers: headerParameters, | ||
query: queryParameters, | ||
body: CreateBodyToJSON(requestParameters.createBody), | ||
}, | ||
initOverrides, | ||
); | ||
|
||
return new runtime.JSONApiResponse(response, jsonValue => | ||
CreateNotification200ResponseFromJSON(jsonValue), | ||
); | ||
} | ||
|
||
/** | ||
* Create notification | ||
* Create notification | ||
*/ | ||
async createNotification( | ||
requestParameters: CreateNotificationRequest = {}, | ||
initOverrides?: RequestInit | runtime.InitOverrideFunction, | ||
): Promise<CreateNotification200Response> { | ||
const response = await this.createNotificationRaw( | ||
requestParameters, | ||
initOverrides, | ||
); | ||
return await response.value(); | ||
} | ||
|
||
/** | ||
* Gets notifications | ||
* Gets notifications | ||
*/ | ||
async getNotificationsRaw( | ||
requestParameters: GetNotificationsRequest, | ||
initOverrides?: RequestInit | runtime.InitOverrideFunction, | ||
): Promise<runtime.ApiResponse<Array<Notification>>> { | ||
const queryParameters: any = {}; | ||
|
||
if (requestParameters.pageSize !== undefined) { | ||
queryParameters['pageSize'] = requestParameters.pageSize; | ||
} | ||
|
||
if (requestParameters.pageNumber !== undefined) { | ||
queryParameters['pageNumber'] = requestParameters.pageNumber; | ||
} | ||
|
||
if (requestParameters.orderBy !== undefined) { | ||
queryParameters['orderBy'] = requestParameters.orderBy; | ||
} | ||
|
||
if (requestParameters.orderByDirec !== undefined) { | ||
queryParameters['orderByDirec'] = requestParameters.orderByDirec; | ||
} | ||
|
||
if (requestParameters.containsText !== undefined) { | ||
queryParameters['containsText'] = requestParameters.containsText; | ||
} | ||
|
||
if (requestParameters.createdAfter !== undefined) { | ||
queryParameters['createdAfter'] = ( | ||
requestParameters.createdAfter as any | ||
).toISOString(); | ||
} | ||
|
||
if (requestParameters.messageScope !== undefined) { | ||
queryParameters['messageScope'] = requestParameters.messageScope; | ||
} | ||
|
||
if (requestParameters.user !== undefined) { | ||
queryParameters['user'] = requestParameters.user; | ||
} | ||
|
||
if (requestParameters.read !== undefined) { | ||
queryParameters['read'] = requestParameters.read; | ||
} | ||
|
||
const headerParameters: runtime.HTTPHeaders = {}; | ||
|
||
const response = await this.request( | ||
{ | ||
path: `/notifications`, | ||
method: 'GET', | ||
headers: headerParameters, | ||
query: queryParameters, | ||
}, | ||
initOverrides, | ||
); | ||
|
||
return new runtime.JSONApiResponse(response, jsonValue => | ||
jsonValue.map(NotificationFromJSON), | ||
); | ||
} | ||
|
||
/** | ||
* Gets notifications | ||
* Gets notifications | ||
*/ | ||
async getNotifications( | ||
requestParameters: GetNotificationsRequest = {}, | ||
initOverrides?: RequestInit | runtime.InitOverrideFunction, | ||
): Promise<Array<Notification>> { | ||
const response = await this.getNotificationsRaw( | ||
requestParameters, | ||
initOverrides, | ||
); | ||
return await response.value(); | ||
} | ||
|
||
/** | ||
* Gets notifications count | ||
* Get notifications count | ||
*/ | ||
async getNotificationsCountRaw( | ||
requestParameters: GetNotificationsCountRequest, | ||
initOverrides?: RequestInit | runtime.InitOverrideFunction, | ||
): Promise<runtime.ApiResponse<GetNotificationsCount200Response>> { | ||
const queryParameters: any = {}; | ||
|
||
if (requestParameters.containsText !== undefined) { | ||
queryParameters['containsText'] = requestParameters.containsText; | ||
} | ||
|
||
if (requestParameters.createdAfter !== undefined) { | ||
queryParameters['createdAfter'] = ( | ||
requestParameters.createdAfter as any | ||
).toISOString(); | ||
} | ||
|
||
if (requestParameters.messageScope !== undefined) { | ||
queryParameters['messageScope'] = requestParameters.messageScope; | ||
} | ||
|
||
if (requestParameters.user !== undefined) { | ||
queryParameters['user'] = requestParameters.user; | ||
} | ||
|
||
if (requestParameters.read !== undefined) { | ||
queryParameters['read'] = requestParameters.read; | ||
} | ||
|
||
const headerParameters: runtime.HTTPHeaders = {}; | ||
|
||
const response = await this.request( | ||
{ | ||
path: `/notifications/count`, | ||
method: 'GET', | ||
headers: headerParameters, | ||
query: queryParameters, | ||
}, | ||
initOverrides, | ||
); | ||
|
||
return new runtime.JSONApiResponse(response, jsonValue => | ||
GetNotificationsCount200ResponseFromJSON(jsonValue), | ||
); | ||
} | ||
|
||
/** | ||
* Gets notifications count | ||
* Get notifications count | ||
*/ | ||
async getNotificationsCount( | ||
requestParameters: GetNotificationsCountRequest = {}, | ||
initOverrides?: RequestInit | runtime.InitOverrideFunction, | ||
): Promise<GetNotificationsCount200Response> { | ||
const response = await this.getNotificationsCountRaw( | ||
requestParameters, | ||
initOverrides, | ||
); | ||
return await response.value(); | ||
} | ||
|
||
/** | ||
* Set notification as read/unread | ||
* Set notification as read/unread | ||
*/ | ||
async setReadRaw( | ||
requestParameters: SetReadRequest, | ||
initOverrides?: RequestInit | runtime.InitOverrideFunction, | ||
): Promise<runtime.ApiResponse<void>> { | ||
if ( | ||
requestParameters.messageId === null || | ||
requestParameters.messageId === undefined | ||
) { | ||
throw new runtime.RequiredError( | ||
'messageId', | ||
'Required parameter requestParameters.messageId was null or undefined when calling setRead.', | ||
); | ||
} | ||
|
||
if ( | ||
requestParameters.user === null || | ||
requestParameters.user === undefined | ||
) { | ||
throw new runtime.RequiredError( | ||
'user', | ||
'Required parameter requestParameters.user was null or undefined when calling setRead.', | ||
); | ||
} | ||
|
||
if ( | ||
requestParameters.read === null || | ||
requestParameters.read === undefined | ||
) { | ||
throw new runtime.RequiredError( | ||
'read', | ||
'Required parameter requestParameters.read was null or undefined when calling setRead.', | ||
); | ||
} | ||
|
||
const queryParameters: any = {}; | ||
|
||
if (requestParameters.messageId !== undefined) { | ||
queryParameters['messageId'] = requestParameters.messageId; | ||
} | ||
|
||
if (requestParameters.user !== undefined) { | ||
queryParameters['user'] = requestParameters.user; | ||
} | ||
|
||
if (requestParameters.read !== undefined) { | ||
queryParameters['read'] = requestParameters.read; | ||
} | ||
|
||
const headerParameters: runtime.HTTPHeaders = {}; | ||
|
||
const response = await this.request( | ||
{ | ||
path: `/notifications/read`, | ||
method: 'PUT', | ||
headers: headerParameters, | ||
query: queryParameters, | ||
}, | ||
initOverrides, | ||
); | ||
|
||
return new runtime.VoidApiResponse(response); | ||
} | ||
|
||
/** | ||
* Set notification as read/unread | ||
* Set notification as read/unread | ||
*/ | ||
async setRead( | ||
requestParameters: SetReadRequest, | ||
initOverrides?: RequestInit | runtime.InitOverrideFunction, | ||
): Promise<void> { | ||
await this.setReadRaw(requestParameters, initOverrides); | ||
} | ||
} | ||
|
||
/** | ||
* @export | ||
*/ | ||
export const GetNotificationsOrderByEnum = { | ||
Title: 'title', | ||
Message: 'message', | ||
Created: 'created', | ||
Topic: 'topic', | ||
Origin: 'origin', | ||
} as const; | ||
export type GetNotificationsOrderByEnum = | ||
(typeof GetNotificationsOrderByEnum)[keyof typeof GetNotificationsOrderByEnum]; | ||
/** | ||
* @export | ||
*/ | ||
export const GetNotificationsOrderByDirecEnum = { | ||
Asc: 'asc', | ||
Desc: 'desc', | ||
} as const; | ||
export type GetNotificationsOrderByDirecEnum = | ||
(typeof GetNotificationsOrderByDirecEnum)[keyof typeof GetNotificationsOrderByDirecEnum]; | ||
/** | ||
* @export | ||
*/ | ||
export const GetNotificationsMessageScopeEnum = { | ||
All: 'all', | ||
User: 'user', | ||
System: 'system', | ||
} as const; | ||
export type GetNotificationsMessageScopeEnum = | ||
(typeof GetNotificationsMessageScopeEnum)[keyof typeof GetNotificationsMessageScopeEnum]; | ||
/** | ||
* @export | ||
*/ | ||
export const GetNotificationsCountMessageScopeEnum = { | ||
All: 'all', | ||
User: 'user', | ||
System: 'system', | ||
} as const; | ||
export type GetNotificationsCountMessageScopeEnum = | ||
(typeof GetNotificationsCountMessageScopeEnum)[keyof typeof GetNotificationsCountMessageScopeEnum]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/* tslint:disable */ | ||
/* eslint-disable */ | ||
export * from './NotificationsApi'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/* tslint:disable */ | ||
/* eslint-disable */ | ||
export * from './runtime'; | ||
export * from './apis/index'; | ||
export * from './models/index'; |
Oops, something went wrong.