From 3edf8632d3f2241889d159c867bb01fd5a1ba206 Mon Sep 17 00:00:00 2001 From: Ryan Wang Date: Thu, 28 Sep 2023 21:36:18 +0800 Subject: [PATCH] feat: refine notifications-related ui (#4638) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #### What type of PR is this? /area console /kind feature /milestone 2.10.x #### What this PR does / why we need it: 完善通知功能相关的 UI 功能。 配置: ![image](https://github.com/halo-dev/halo/assets/21301288/ed9695c0-ed68-4558-bf7c-35209573ed23) 仪表盘消息组件: image 独立的消息页面: image #### Which issue(s) this PR fixes: Fixes # #### Special notes for your reviewer: #### Does this PR introduce a user-facing change? ```release-note None ``` --- console/.eslintrc.cjs | 1 + .../api-client/src/.openapi-generator/FILES | 38 + console/packages/api-client/src/api.ts | 10 + ...sole-halo-run-v1alpha1-notification-api.ts | 662 ++++++++++++++ ...-console-halo-run-v1alpha1-notifier-api.ts | 346 +++++++ ...tion-halo-run-v1alpha1-notification-api.ts | 665 ++++++++++++++ ...fication-halo-run-v1alpha1-notifier-api.ts | 349 +++++++ ...tion-halo-run-v1alpha1-subscription-api.ts | 207 +++++ ...tion-halo-run-v1alpha1-notification-api.ts | 835 +++++++++++++++++ ...-run-v1alpha1-notification-template-api.ts | 857 ++++++++++++++++++ ...lo-run-v1alpha1-notifier-descriptor-api.ts | 857 ++++++++++++++++++ ...tification-halo-run-v1alpha1-reason-api.ts | 819 +++++++++++++++++ ...ation-halo-run-v1alpha1-reason-type-api.ts | 828 +++++++++++++++++ ...tion-halo-run-v1alpha1-subscription-api.ts | 835 +++++++++++++++++ .../packages/api-client/src/models/index.ts | 28 + .../src/models/interest-reason-subject.ts | 39 + .../api-client/src/models/interest-reason.ts | 37 + .../src/models/mark-specified-request.ts | 27 + .../src/models/notification-list.ts | 79 ++ .../src/models/notification-spec.ts | 63 ++ .../src/models/notification-template-list.ts | 79 ++ .../src/models/notification-template-spec.ts | 40 + .../src/models/notification-template.ts | 52 ++ .../api-client/src/models/notification.ts | 52 ++ .../src/models/notifier-descriptor-list.ts | 79 ++ .../src/models/notifier-descriptor-spec.ts | 55 ++ .../src/models/notifier-descriptor.ts | 52 ++ .../src/models/notifier-setting-ref.ts | 33 + .../api-client/src/models/reason-list.ts | 79 ++ .../api-client/src/models/reason-property.ts | 45 + .../api-client/src/models/reason-selector.ts | 33 + .../src/models/reason-spec-attributes.ts | 27 + .../api-client/src/models/reason-spec.ts | 52 ++ .../api-client/src/models/reason-subject.ts | 51 ++ .../api-client/src/models/reason-type-list.ts | 79 ++ .../api-client/src/models/reason-type-spec.ts | 43 + .../api-client/src/models/reason-type.ts | 52 ++ .../packages/api-client/src/models/reason.ts | 52 ++ .../src/models/subscription-list.ts | 79 ++ .../src/models/subscription-spec.ts | 52 ++ .../src/models/subscription-subscriber.ts | 27 + .../api-client/src/models/subscription.ts | 52 ++ .../api-client/src/models/template-content.ts | 39 + .../packages/components/src/icons/icons.ts | 2 + console/src/layouts/BasicLayout.vue | 9 + console/src/locales/en.yaml | 15 + console/src/locales/zh-CN.yaml | 15 + console/src/locales/zh-TW.yaml | 15 + console/src/modules/dashboard/Dashboard.vue | 5 +- console/src/modules/index.ts | 1 + .../system/settings/SystemSettings.vue | 8 + .../settings/tabs/NotificationSetting.vue | 102 +++ .../system/settings/tabs/Notifications.vue | 74 ++ .../modules/system/users/Notifications.vue | 129 +++ .../users/components/NotificationContent.vue | 43 + .../users/components/NotificationListItem.vue | 91 ++ console/src/modules/system/users/module.ts | 17 + .../users/widgets/NotificationWidget.vue | 104 +++ console/src/utils/api-client.ts | 18 + 59 files changed, 9432 insertions(+), 2 deletions(-) create mode 100644 console/packages/api-client/src/api/api-console-halo-run-v1alpha1-notification-api.ts create mode 100644 console/packages/api-client/src/api/api-console-halo-run-v1alpha1-notifier-api.ts create mode 100644 console/packages/api-client/src/api/api-notification-halo-run-v1alpha1-notification-api.ts create mode 100644 console/packages/api-client/src/api/api-notification-halo-run-v1alpha1-notifier-api.ts create mode 100644 console/packages/api-client/src/api/api-notification-halo-run-v1alpha1-subscription-api.ts create mode 100644 console/packages/api-client/src/api/notification-halo-run-v1alpha1-notification-api.ts create mode 100644 console/packages/api-client/src/api/notification-halo-run-v1alpha1-notification-template-api.ts create mode 100644 console/packages/api-client/src/api/notification-halo-run-v1alpha1-notifier-descriptor-api.ts create mode 100644 console/packages/api-client/src/api/notification-halo-run-v1alpha1-reason-api.ts create mode 100644 console/packages/api-client/src/api/notification-halo-run-v1alpha1-reason-type-api.ts create mode 100644 console/packages/api-client/src/api/notification-halo-run-v1alpha1-subscription-api.ts create mode 100644 console/packages/api-client/src/models/interest-reason-subject.ts create mode 100644 console/packages/api-client/src/models/interest-reason.ts create mode 100644 console/packages/api-client/src/models/mark-specified-request.ts create mode 100644 console/packages/api-client/src/models/notification-list.ts create mode 100644 console/packages/api-client/src/models/notification-spec.ts create mode 100644 console/packages/api-client/src/models/notification-template-list.ts create mode 100644 console/packages/api-client/src/models/notification-template-spec.ts create mode 100644 console/packages/api-client/src/models/notification-template.ts create mode 100644 console/packages/api-client/src/models/notification.ts create mode 100644 console/packages/api-client/src/models/notifier-descriptor-list.ts create mode 100644 console/packages/api-client/src/models/notifier-descriptor-spec.ts create mode 100644 console/packages/api-client/src/models/notifier-descriptor.ts create mode 100644 console/packages/api-client/src/models/notifier-setting-ref.ts create mode 100644 console/packages/api-client/src/models/reason-list.ts create mode 100644 console/packages/api-client/src/models/reason-property.ts create mode 100644 console/packages/api-client/src/models/reason-selector.ts create mode 100644 console/packages/api-client/src/models/reason-spec-attributes.ts create mode 100644 console/packages/api-client/src/models/reason-spec.ts create mode 100644 console/packages/api-client/src/models/reason-subject.ts create mode 100644 console/packages/api-client/src/models/reason-type-list.ts create mode 100644 console/packages/api-client/src/models/reason-type-spec.ts create mode 100644 console/packages/api-client/src/models/reason-type.ts create mode 100644 console/packages/api-client/src/models/reason.ts create mode 100644 console/packages/api-client/src/models/subscription-list.ts create mode 100644 console/packages/api-client/src/models/subscription-spec.ts create mode 100644 console/packages/api-client/src/models/subscription-subscriber.ts create mode 100644 console/packages/api-client/src/models/subscription.ts create mode 100644 console/packages/api-client/src/models/template-content.ts create mode 100644 console/src/modules/system/settings/tabs/NotificationSetting.vue create mode 100644 console/src/modules/system/settings/tabs/Notifications.vue create mode 100644 console/src/modules/system/users/Notifications.vue create mode 100644 console/src/modules/system/users/components/NotificationContent.vue create mode 100644 console/src/modules/system/users/components/NotificationListItem.vue create mode 100644 console/src/modules/system/users/widgets/NotificationWidget.vue diff --git a/console/.eslintrc.cjs b/console/.eslintrc.cjs index 55dba4e273..821e927b8c 100644 --- a/console/.eslintrc.cjs +++ b/console/.eslintrc.cjs @@ -16,6 +16,7 @@ module.exports = { rules: { "vue/multi-word-component-names": 0, "@typescript-eslint/ban-ts-comment": 0, + "vue/no-v-html": 0, }, overrides: [ { diff --git a/console/packages/api-client/src/.openapi-generator/FILES b/console/packages/api-client/src/.openapi-generator/FILES index 3330ada84e..edf8d55b42 100644 --- a/console/packages/api-client/src/.openapi-generator/FILES +++ b/console/packages/api-client/src/.openapi-generator/FILES @@ -5,6 +5,7 @@ api/api-console-halo-run-v1alpha1-attachment-api.ts api/api-console-halo-run-v1alpha1-auth-provider-api.ts api/api-console-halo-run-v1alpha1-comment-api.ts api/api-console-halo-run-v1alpha1-indices-api.ts +api/api-console-halo-run-v1alpha1-notifier-api.ts api/api-console-halo-run-v1alpha1-plugin-api.ts api/api-console-halo-run-v1alpha1-post-api.ts api/api-console-halo-run-v1alpha1-reply-api.ts @@ -24,6 +25,9 @@ api/api-halo-run-v1alpha1-post-api.ts api/api-halo-run-v1alpha1-stats-api.ts api/api-halo-run-v1alpha1-tracker-api.ts api/api-halo-run-v1alpha1-user-api.ts +api/api-notification-halo-run-v1alpha1-notification-api.ts +api/api-notification-halo-run-v1alpha1-notifier-api.ts +api/api-notification-halo-run-v1alpha1-subscription-api.ts api/api-plugin-halo-run-v1alpha1-plugin-api.ts api/api-security-halo-run-v1alpha1-personal-access-token-api.ts api/auth-halo-run-v1alpha1-auth-provider-api.ts @@ -38,6 +42,12 @@ api/content-halo-run-v1alpha1-tag-api.ts api/login-api.ts api/metrics-halo-run-v1alpha1-counter-api.ts api/migration-halo-run-v1alpha1-backup-api.ts +api/notification-halo-run-v1alpha1-notification-api.ts +api/notification-halo-run-v1alpha1-notification-template-api.ts +api/notification-halo-run-v1alpha1-notifier-descriptor-api.ts +api/notification-halo-run-v1alpha1-reason-api.ts +api/notification-halo-run-v1alpha1-reason-type-api.ts +api/notification-halo-run-v1alpha1-subscription-api.ts api/plugin-halo-run-v1alpha1-extension-definition-api.ts api/plugin-halo-run-v1alpha1-extension-point-definition-api.ts api/plugin-halo-run-v1alpha1-plugin-api.ts @@ -130,6 +140,8 @@ models/group-status.ts models/group.ts models/index.ts models/install-from-uri-request.ts +models/interest-reason-subject.ts +models/interest-reason.ts models/license.ts models/listed-auth-provider.ts models/listed-comment-list.ts @@ -146,6 +158,7 @@ models/listed-single-page-vo.ts models/listed-single-page.ts models/listed-user.ts models/login-history.ts +models/mark-specified-request.ts models/menu-item-list.ts models/menu-item-spec.ts models/menu-item-status.ts @@ -157,6 +170,16 @@ models/menu-vo.ts models/menu.ts models/metadata.ts models/navigation-post-vo.ts +models/notification-list.ts +models/notification-spec.ts +models/notification-template-list.ts +models/notification-template-spec.ts +models/notification-template.ts +models/notification.ts +models/notifier-descriptor-list.ts +models/notifier-descriptor-spec.ts +models/notifier-descriptor.ts +models/notifier-setting-ref.ts models/owner-info.ts models/pat-spec.ts models/personal-access-token-list.ts @@ -182,6 +205,16 @@ models/post-status.ts models/post-vo.ts models/post.ts models/public-key-response.ts +models/reason-list.ts +models/reason-property.ts +models/reason-selector.ts +models/reason-spec-attributes.ts +models/reason-spec.ts +models/reason-subject.ts +models/reason-type-list.ts +models/reason-type-spec.ts +models/reason-type.ts +models/reason.ts models/ref.ts models/reply-list.ts models/reply-request.ts @@ -221,6 +254,10 @@ models/snapshot.ts models/stats-vo.ts models/stats.ts models/subject.ts +models/subscription-list.ts +models/subscription-spec.ts +models/subscription-subscriber.ts +models/subscription.ts models/system-initialization-request.ts models/tag-list.ts models/tag-spec.ts @@ -228,6 +265,7 @@ models/tag-status.ts models/tag-vo-list.ts models/tag-vo.ts models/tag.ts +models/template-content.ts models/template-descriptor.ts models/theme-list.ts models/theme-spec.ts diff --git a/console/packages/api-client/src/api.ts b/console/packages/api-client/src/api.ts index da76420222..9aa2bb9947 100644 --- a/console/packages/api-client/src/api.ts +++ b/console/packages/api-client/src/api.ts @@ -16,6 +16,7 @@ export * from "./api/api-console-halo-run-v1alpha1-attachment-api"; export * from "./api/api-console-halo-run-v1alpha1-auth-provider-api"; export * from "./api/api-console-halo-run-v1alpha1-comment-api"; export * from "./api/api-console-halo-run-v1alpha1-indices-api"; +export * from "./api/api-console-halo-run-v1alpha1-notifier-api"; export * from "./api/api-console-halo-run-v1alpha1-plugin-api"; export * from "./api/api-console-halo-run-v1alpha1-post-api"; export * from "./api/api-console-halo-run-v1alpha1-reply-api"; @@ -35,6 +36,9 @@ export * from "./api/api-halo-run-v1alpha1-post-api"; export * from "./api/api-halo-run-v1alpha1-stats-api"; export * from "./api/api-halo-run-v1alpha1-tracker-api"; export * from "./api/api-halo-run-v1alpha1-user-api"; +export * from "./api/api-notification-halo-run-v1alpha1-notification-api"; +export * from "./api/api-notification-halo-run-v1alpha1-notifier-api"; +export * from "./api/api-notification-halo-run-v1alpha1-subscription-api"; export * from "./api/api-plugin-halo-run-v1alpha1-plugin-api"; export * from "./api/api-security-halo-run-v1alpha1-personal-access-token-api"; export * from "./api/auth-halo-run-v1alpha1-auth-provider-api"; @@ -49,6 +53,12 @@ export * from "./api/content-halo-run-v1alpha1-tag-api"; export * from "./api/login-api"; export * from "./api/metrics-halo-run-v1alpha1-counter-api"; export * from "./api/migration-halo-run-v1alpha1-backup-api"; +export * from "./api/notification-halo-run-v1alpha1-notification-api"; +export * from "./api/notification-halo-run-v1alpha1-notification-template-api"; +export * from "./api/notification-halo-run-v1alpha1-notifier-descriptor-api"; +export * from "./api/notification-halo-run-v1alpha1-reason-api"; +export * from "./api/notification-halo-run-v1alpha1-reason-type-api"; +export * from "./api/notification-halo-run-v1alpha1-subscription-api"; export * from "./api/plugin-halo-run-v1alpha1-extension-definition-api"; export * from "./api/plugin-halo-run-v1alpha1-extension-point-definition-api"; export * from "./api/plugin-halo-run-v1alpha1-plugin-api"; diff --git a/console/packages/api-client/src/api/api-console-halo-run-v1alpha1-notification-api.ts b/console/packages/api-client/src/api/api-console-halo-run-v1alpha1-notification-api.ts new file mode 100644 index 0000000000..473445fa14 --- /dev/null +++ b/console/packages/api-client/src/api/api-console-halo-run-v1alpha1-notification-api.ts @@ -0,0 +1,662 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Halo Next API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.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 { Configuration } from "../configuration"; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from "axios"; +import globalAxios from "axios"; +// Some imports not used depending on template conditions +// @ts-ignore +import { + DUMMY_BASE_URL, + assertParamExists, + setApiKeyToObject, + setBasicAuthToObject, + setBearerAuthToObject, + setOAuthToObject, + setSearchParams, + serializeDataIfNeeded, + toPathString, + createRequestFunction, +} from "../common"; +// @ts-ignore +import { + BASE_PATH, + COLLECTION_FORMATS, + RequestArgs, + BaseAPI, + RequiredError, +} from "../base"; +// @ts-ignore +import { MarkSpecifiedRequest } from "../models"; +// @ts-ignore +import { Notification } from "../models"; +// @ts-ignore +import { NotificationList } from "../models"; +/** + * ApiConsoleHaloRunV1alpha1NotificationApi - axios parameter creator + * @export + */ +export const ApiConsoleHaloRunV1alpha1NotificationApiAxiosParamCreator = + function (configuration?: Configuration) { + return { + /** + * List notifications for the authenticated user. + * @param {string} username Username + * @param {Array} [fieldSelector] Field selector for filtering. + * @param {string} [keyword] + * @param {Array} [labelSelector] Label selector for filtering. + * @param {number} [page] The page number. Zero indicates no page. + * @param {string} [reason] Filter by notification reason + * @param {number} [size] Size of one page. Zero indicates no limit. + * @param {Array} [sort] Sort property and direction of the list result. Supported fields: creationTimestamp + * @param {boolean} [unRead] true for unread, false for read, null for all + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listUserNotifications: async ( + username: string, + fieldSelector?: Array, + keyword?: string, + labelSelector?: Array, + page?: number, + reason?: string, + size?: number, + sort?: Array, + unRead?: boolean, + options: AxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'username' is not null or undefined + assertParamExists("listUserNotifications", "username", username); + const localVarPath = + `/apis/api.console.halo.run/v1alpha1/userspaces/{username}/notifications`.replace( + `{${"username"}}`, + encodeURIComponent(String(username)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication BasicAuth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + // authentication BearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration); + + if (fieldSelector) { + localVarQueryParameter["fieldSelector"] = fieldSelector; + } + + if (keyword !== undefined) { + localVarQueryParameter["keyword"] = keyword; + } + + if (labelSelector) { + localVarQueryParameter["labelSelector"] = labelSelector; + } + + if (page !== undefined) { + localVarQueryParameter["page"] = page; + } + + if (reason !== undefined) { + localVarQueryParameter["reason"] = reason; + } + + if (size !== undefined) { + localVarQueryParameter["size"] = size; + } + + if (sort) { + localVarQueryParameter["sort"] = Array.from(sort); + } + + if (unRead !== undefined) { + localVarQueryParameter["unRead"] = unRead; + } + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Mark the specified notification as read. + * @param {string} username Username + * @param {string} name Notification name + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + markNotificationAsRead: async ( + username: string, + name: string, + options: AxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'username' is not null or undefined + assertParamExists("markNotificationAsRead", "username", username); + // verify required parameter 'name' is not null or undefined + assertParamExists("markNotificationAsRead", "name", name); + const localVarPath = + `/apis/api.console.halo.run/v1alpha1/userspaces/{username}/notifications/{name}/mark-as-read` + .replace(`{${"username"}}`, encodeURIComponent(String(username))) + .replace(`{${"name"}}`, encodeURIComponent(String(name))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: "PUT", + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication BasicAuth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + // authentication BearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration); + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Mark the specified notifications as read. + * @param {string} username Username + * @param {MarkSpecifiedRequest} markSpecifiedRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + markNotificationsAsRead: async ( + username: string, + markSpecifiedRequest: MarkSpecifiedRequest, + options: AxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'username' is not null or undefined + assertParamExists("markNotificationsAsRead", "username", username); + // verify required parameter 'markSpecifiedRequest' is not null or undefined + assertParamExists( + "markNotificationsAsRead", + "markSpecifiedRequest", + markSpecifiedRequest + ); + const localVarPath = + `/apis/api.console.halo.run/v1alpha1/userspaces/{username}/notifications/-/mark-specified-as-read`.replace( + `{${"username"}}`, + encodeURIComponent(String(username)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: "PUT", + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication BasicAuth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + // authentication BearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration); + + localVarHeaderParameter["Content-Type"] = "application/json"; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + localVarRequestOptions.data = serializeDataIfNeeded( + markSpecifiedRequest, + localVarRequestOptions, + configuration + ); + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; + }; + +/** + * ApiConsoleHaloRunV1alpha1NotificationApi - functional programming interface + * @export + */ +export const ApiConsoleHaloRunV1alpha1NotificationApiFp = function ( + configuration?: Configuration +) { + const localVarAxiosParamCreator = + ApiConsoleHaloRunV1alpha1NotificationApiAxiosParamCreator(configuration); + return { + /** + * List notifications for the authenticated user. + * @param {string} username Username + * @param {Array} [fieldSelector] Field selector for filtering. + * @param {string} [keyword] + * @param {Array} [labelSelector] Label selector for filtering. + * @param {number} [page] The page number. Zero indicates no page. + * @param {string} [reason] Filter by notification reason + * @param {number} [size] Size of one page. Zero indicates no limit. + * @param {Array} [sort] Sort property and direction of the list result. Supported fields: creationTimestamp + * @param {boolean} [unRead] true for unread, false for read, null for all + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listUserNotifications( + username: string, + fieldSelector?: Array, + keyword?: string, + labelSelector?: Array, + page?: number, + reason?: string, + size?: number, + sort?: Array, + unRead?: boolean, + options?: AxiosRequestConfig + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.listUserNotifications( + username, + fieldSelector, + keyword, + labelSelector, + page, + reason, + size, + sort, + unRead, + options + ); + return createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + ); + }, + /** + * Mark the specified notification as read. + * @param {string} username Username + * @param {string} name Notification name + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async markNotificationAsRead( + username: string, + name: string, + options?: AxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.markNotificationAsRead( + username, + name, + options + ); + return createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + ); + }, + /** + * Mark the specified notifications as read. + * @param {string} username Username + * @param {MarkSpecifiedRequest} markSpecifiedRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async markNotificationsAsRead( + username: string, + markSpecifiedRequest: MarkSpecifiedRequest, + options?: AxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise> + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.markNotificationsAsRead( + username, + markSpecifiedRequest, + options + ); + return createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + ); + }, + }; +}; + +/** + * ApiConsoleHaloRunV1alpha1NotificationApi - factory interface + * @export + */ +export const ApiConsoleHaloRunV1alpha1NotificationApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance +) { + const localVarFp = ApiConsoleHaloRunV1alpha1NotificationApiFp(configuration); + return { + /** + * List notifications for the authenticated user. + * @param {ApiConsoleHaloRunV1alpha1NotificationApiListUserNotificationsRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listUserNotifications( + requestParameters: ApiConsoleHaloRunV1alpha1NotificationApiListUserNotificationsRequest, + options?: AxiosRequestConfig + ): AxiosPromise { + return localVarFp + .listUserNotifications( + requestParameters.username, + requestParameters.fieldSelector, + requestParameters.keyword, + requestParameters.labelSelector, + requestParameters.page, + requestParameters.reason, + requestParameters.size, + requestParameters.sort, + requestParameters.unRead, + options + ) + .then((request) => request(axios, basePath)); + }, + /** + * Mark the specified notification as read. + * @param {ApiConsoleHaloRunV1alpha1NotificationApiMarkNotificationAsReadRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + markNotificationAsRead( + requestParameters: ApiConsoleHaloRunV1alpha1NotificationApiMarkNotificationAsReadRequest, + options?: AxiosRequestConfig + ): AxiosPromise { + return localVarFp + .markNotificationAsRead( + requestParameters.username, + requestParameters.name, + options + ) + .then((request) => request(axios, basePath)); + }, + /** + * Mark the specified notifications as read. + * @param {ApiConsoleHaloRunV1alpha1NotificationApiMarkNotificationsAsReadRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + markNotificationsAsRead( + requestParameters: ApiConsoleHaloRunV1alpha1NotificationApiMarkNotificationsAsReadRequest, + options?: AxiosRequestConfig + ): AxiosPromise> { + return localVarFp + .markNotificationsAsRead( + requestParameters.username, + requestParameters.markSpecifiedRequest, + options + ) + .then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * Request parameters for listUserNotifications operation in ApiConsoleHaloRunV1alpha1NotificationApi. + * @export + * @interface ApiConsoleHaloRunV1alpha1NotificationApiListUserNotificationsRequest + */ +export interface ApiConsoleHaloRunV1alpha1NotificationApiListUserNotificationsRequest { + /** + * Username + * @type {string} + * @memberof ApiConsoleHaloRunV1alpha1NotificationApiListUserNotifications + */ + readonly username: string; + + /** + * Field selector for filtering. + * @type {Array} + * @memberof ApiConsoleHaloRunV1alpha1NotificationApiListUserNotifications + */ + readonly fieldSelector?: Array; + + /** + * + * @type {string} + * @memberof ApiConsoleHaloRunV1alpha1NotificationApiListUserNotifications + */ + readonly keyword?: string; + + /** + * Label selector for filtering. + * @type {Array} + * @memberof ApiConsoleHaloRunV1alpha1NotificationApiListUserNotifications + */ + readonly labelSelector?: Array; + + /** + * The page number. Zero indicates no page. + * @type {number} + * @memberof ApiConsoleHaloRunV1alpha1NotificationApiListUserNotifications + */ + readonly page?: number; + + /** + * Filter by notification reason + * @type {string} + * @memberof ApiConsoleHaloRunV1alpha1NotificationApiListUserNotifications + */ + readonly reason?: string; + + /** + * Size of one page. Zero indicates no limit. + * @type {number} + * @memberof ApiConsoleHaloRunV1alpha1NotificationApiListUserNotifications + */ + readonly size?: number; + + /** + * Sort property and direction of the list result. Supported fields: creationTimestamp + * @type {Array} + * @memberof ApiConsoleHaloRunV1alpha1NotificationApiListUserNotifications + */ + readonly sort?: Array; + + /** + * true for unread, false for read, null for all + * @type {boolean} + * @memberof ApiConsoleHaloRunV1alpha1NotificationApiListUserNotifications + */ + readonly unRead?: boolean; +} + +/** + * Request parameters for markNotificationAsRead operation in ApiConsoleHaloRunV1alpha1NotificationApi. + * @export + * @interface ApiConsoleHaloRunV1alpha1NotificationApiMarkNotificationAsReadRequest + */ +export interface ApiConsoleHaloRunV1alpha1NotificationApiMarkNotificationAsReadRequest { + /** + * Username + * @type {string} + * @memberof ApiConsoleHaloRunV1alpha1NotificationApiMarkNotificationAsRead + */ + readonly username: string; + + /** + * Notification name + * @type {string} + * @memberof ApiConsoleHaloRunV1alpha1NotificationApiMarkNotificationAsRead + */ + readonly name: string; +} + +/** + * Request parameters for markNotificationsAsRead operation in ApiConsoleHaloRunV1alpha1NotificationApi. + * @export + * @interface ApiConsoleHaloRunV1alpha1NotificationApiMarkNotificationsAsReadRequest + */ +export interface ApiConsoleHaloRunV1alpha1NotificationApiMarkNotificationsAsReadRequest { + /** + * Username + * @type {string} + * @memberof ApiConsoleHaloRunV1alpha1NotificationApiMarkNotificationsAsRead + */ + readonly username: string; + + /** + * + * @type {MarkSpecifiedRequest} + * @memberof ApiConsoleHaloRunV1alpha1NotificationApiMarkNotificationsAsRead + */ + readonly markSpecifiedRequest: MarkSpecifiedRequest; +} + +/** + * ApiConsoleHaloRunV1alpha1NotificationApi - object-oriented interface + * @export + * @class ApiConsoleHaloRunV1alpha1NotificationApi + * @extends {BaseAPI} + */ +export class ApiConsoleHaloRunV1alpha1NotificationApi extends BaseAPI { + /** + * List notifications for the authenticated user. + * @param {ApiConsoleHaloRunV1alpha1NotificationApiListUserNotificationsRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ApiConsoleHaloRunV1alpha1NotificationApi + */ + public listUserNotifications( + requestParameters: ApiConsoleHaloRunV1alpha1NotificationApiListUserNotificationsRequest, + options?: AxiosRequestConfig + ) { + return ApiConsoleHaloRunV1alpha1NotificationApiFp(this.configuration) + .listUserNotifications( + requestParameters.username, + requestParameters.fieldSelector, + requestParameters.keyword, + requestParameters.labelSelector, + requestParameters.page, + requestParameters.reason, + requestParameters.size, + requestParameters.sort, + requestParameters.unRead, + options + ) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Mark the specified notification as read. + * @param {ApiConsoleHaloRunV1alpha1NotificationApiMarkNotificationAsReadRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ApiConsoleHaloRunV1alpha1NotificationApi + */ + public markNotificationAsRead( + requestParameters: ApiConsoleHaloRunV1alpha1NotificationApiMarkNotificationAsReadRequest, + options?: AxiosRequestConfig + ) { + return ApiConsoleHaloRunV1alpha1NotificationApiFp(this.configuration) + .markNotificationAsRead( + requestParameters.username, + requestParameters.name, + options + ) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Mark the specified notifications as read. + * @param {ApiConsoleHaloRunV1alpha1NotificationApiMarkNotificationsAsReadRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ApiConsoleHaloRunV1alpha1NotificationApi + */ + public markNotificationsAsRead( + requestParameters: ApiConsoleHaloRunV1alpha1NotificationApiMarkNotificationsAsReadRequest, + options?: AxiosRequestConfig + ) { + return ApiConsoleHaloRunV1alpha1NotificationApiFp(this.configuration) + .markNotificationsAsRead( + requestParameters.username, + requestParameters.markSpecifiedRequest, + options + ) + .then((request) => request(this.axios, this.basePath)); + } +} diff --git a/console/packages/api-client/src/api/api-console-halo-run-v1alpha1-notifier-api.ts b/console/packages/api-client/src/api/api-console-halo-run-v1alpha1-notifier-api.ts new file mode 100644 index 0000000000..d2f3cb57f2 --- /dev/null +++ b/console/packages/api-client/src/api/api-console-halo-run-v1alpha1-notifier-api.ts @@ -0,0 +1,346 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Halo Next API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.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 { Configuration } from "../configuration"; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from "axios"; +import globalAxios from "axios"; +// Some imports not used depending on template conditions +// @ts-ignore +import { + DUMMY_BASE_URL, + assertParamExists, + setApiKeyToObject, + setBasicAuthToObject, + setBearerAuthToObject, + setOAuthToObject, + setSearchParams, + serializeDataIfNeeded, + toPathString, + createRequestFunction, +} from "../common"; +// @ts-ignore +import { + BASE_PATH, + COLLECTION_FORMATS, + RequestArgs, + BaseAPI, + RequiredError, +} from "../base"; +/** + * ApiConsoleHaloRunV1alpha1NotifierApi - axios parameter creator + * @export + */ +export const ApiConsoleHaloRunV1alpha1NotifierApiAxiosParamCreator = function ( + configuration?: Configuration +) { + return { + /** + * Fetch sender config of notifier + * @param {string} name Notifier name + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + fetchSenderConfig: async ( + name: string, + options: AxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'name' is not null or undefined + assertParamExists("fetchSenderConfig", "name", name); + const localVarPath = + `/apis/api.console.halo.run/v1alpha1/notifiers/{name}/sender-config`.replace( + `{${"name"}}`, + encodeURIComponent(String(name)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication BasicAuth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + // authentication BearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration); + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Save sender config of notifier + * @param {string} name Notifier name + * @param {object} body + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + saveSenderConfig: async ( + name: string, + body: object, + options: AxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'name' is not null or undefined + assertParamExists("saveSenderConfig", "name", name); + // verify required parameter 'body' is not null or undefined + assertParamExists("saveSenderConfig", "body", body); + const localVarPath = + `/apis/api.console.halo.run/v1alpha1/notifiers/{name}/sender-config`.replace( + `{${"name"}}`, + encodeURIComponent(String(name)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: "POST", + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication BasicAuth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + // authentication BearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration); + + localVarHeaderParameter["Content-Type"] = "application/json"; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + localVarRequestOptions.data = serializeDataIfNeeded( + body, + localVarRequestOptions, + configuration + ); + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; +}; + +/** + * ApiConsoleHaloRunV1alpha1NotifierApi - functional programming interface + * @export + */ +export const ApiConsoleHaloRunV1alpha1NotifierApiFp = function ( + configuration?: Configuration +) { + const localVarAxiosParamCreator = + ApiConsoleHaloRunV1alpha1NotifierApiAxiosParamCreator(configuration); + return { + /** + * Fetch sender config of notifier + * @param {string} name Notifier name + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async fetchSenderConfig( + name: string, + options?: AxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.fetchSenderConfig(name, options); + return createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + ); + }, + /** + * Save sender config of notifier + * @param {string} name Notifier name + * @param {object} body + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async saveSenderConfig( + name: string, + body: object, + options?: AxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.saveSenderConfig(name, body, options); + return createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + ); + }, + }; +}; + +/** + * ApiConsoleHaloRunV1alpha1NotifierApi - factory interface + * @export + */ +export const ApiConsoleHaloRunV1alpha1NotifierApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance +) { + const localVarFp = ApiConsoleHaloRunV1alpha1NotifierApiFp(configuration); + return { + /** + * Fetch sender config of notifier + * @param {ApiConsoleHaloRunV1alpha1NotifierApiFetchSenderConfigRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + fetchSenderConfig( + requestParameters: ApiConsoleHaloRunV1alpha1NotifierApiFetchSenderConfigRequest, + options?: AxiosRequestConfig + ): AxiosPromise { + return localVarFp + .fetchSenderConfig(requestParameters.name, options) + .then((request) => request(axios, basePath)); + }, + /** + * Save sender config of notifier + * @param {ApiConsoleHaloRunV1alpha1NotifierApiSaveSenderConfigRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + saveSenderConfig( + requestParameters: ApiConsoleHaloRunV1alpha1NotifierApiSaveSenderConfigRequest, + options?: AxiosRequestConfig + ): AxiosPromise { + return localVarFp + .saveSenderConfig( + requestParameters.name, + requestParameters.body, + options + ) + .then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * Request parameters for fetchSenderConfig operation in ApiConsoleHaloRunV1alpha1NotifierApi. + * @export + * @interface ApiConsoleHaloRunV1alpha1NotifierApiFetchSenderConfigRequest + */ +export interface ApiConsoleHaloRunV1alpha1NotifierApiFetchSenderConfigRequest { + /** + * Notifier name + * @type {string} + * @memberof ApiConsoleHaloRunV1alpha1NotifierApiFetchSenderConfig + */ + readonly name: string; +} + +/** + * Request parameters for saveSenderConfig operation in ApiConsoleHaloRunV1alpha1NotifierApi. + * @export + * @interface ApiConsoleHaloRunV1alpha1NotifierApiSaveSenderConfigRequest + */ +export interface ApiConsoleHaloRunV1alpha1NotifierApiSaveSenderConfigRequest { + /** + * Notifier name + * @type {string} + * @memberof ApiConsoleHaloRunV1alpha1NotifierApiSaveSenderConfig + */ + readonly name: string; + + /** + * + * @type {object} + * @memberof ApiConsoleHaloRunV1alpha1NotifierApiSaveSenderConfig + */ + readonly body: object; +} + +/** + * ApiConsoleHaloRunV1alpha1NotifierApi - object-oriented interface + * @export + * @class ApiConsoleHaloRunV1alpha1NotifierApi + * @extends {BaseAPI} + */ +export class ApiConsoleHaloRunV1alpha1NotifierApi extends BaseAPI { + /** + * Fetch sender config of notifier + * @param {ApiConsoleHaloRunV1alpha1NotifierApiFetchSenderConfigRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ApiConsoleHaloRunV1alpha1NotifierApi + */ + public fetchSenderConfig( + requestParameters: ApiConsoleHaloRunV1alpha1NotifierApiFetchSenderConfigRequest, + options?: AxiosRequestConfig + ) { + return ApiConsoleHaloRunV1alpha1NotifierApiFp(this.configuration) + .fetchSenderConfig(requestParameters.name, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Save sender config of notifier + * @param {ApiConsoleHaloRunV1alpha1NotifierApiSaveSenderConfigRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ApiConsoleHaloRunV1alpha1NotifierApi + */ + public saveSenderConfig( + requestParameters: ApiConsoleHaloRunV1alpha1NotifierApiSaveSenderConfigRequest, + options?: AxiosRequestConfig + ) { + return ApiConsoleHaloRunV1alpha1NotifierApiFp(this.configuration) + .saveSenderConfig(requestParameters.name, requestParameters.body, options) + .then((request) => request(this.axios, this.basePath)); + } +} diff --git a/console/packages/api-client/src/api/api-notification-halo-run-v1alpha1-notification-api.ts b/console/packages/api-client/src/api/api-notification-halo-run-v1alpha1-notification-api.ts new file mode 100644 index 0000000000..e6be0e109c --- /dev/null +++ b/console/packages/api-client/src/api/api-notification-halo-run-v1alpha1-notification-api.ts @@ -0,0 +1,665 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Halo Next API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.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 { Configuration } from "../configuration"; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from "axios"; +import globalAxios from "axios"; +// Some imports not used depending on template conditions +// @ts-ignore +import { + DUMMY_BASE_URL, + assertParamExists, + setApiKeyToObject, + setBasicAuthToObject, + setBearerAuthToObject, + setOAuthToObject, + setSearchParams, + serializeDataIfNeeded, + toPathString, + createRequestFunction, +} from "../common"; +// @ts-ignore +import { + BASE_PATH, + COLLECTION_FORMATS, + RequestArgs, + BaseAPI, + RequiredError, +} from "../base"; +// @ts-ignore +import { MarkSpecifiedRequest } from "../models"; +// @ts-ignore +import { Notification } from "../models"; +// @ts-ignore +import { NotificationList } from "../models"; +/** + * ApiNotificationHaloRunV1alpha1NotificationApi - axios parameter creator + * @export + */ +export const ApiNotificationHaloRunV1alpha1NotificationApiAxiosParamCreator = + function (configuration?: Configuration) { + return { + /** + * List notifications for the authenticated user. + * @param {string} username Username + * @param {Array} [fieldSelector] Field selector for filtering. + * @param {string} [keyword] + * @param {Array} [labelSelector] Label selector for filtering. + * @param {number} [page] The page number. Zero indicates no page. + * @param {string} [reason] Filter by notification reason + * @param {number} [size] Size of one page. Zero indicates no limit. + * @param {Array} [sort] Sort property and direction of the list result. Supported fields: creationTimestamp + * @param {boolean} [unRead] true for unread, false for read, null for all + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listUserNotifications: async ( + username: string, + fieldSelector?: Array, + keyword?: string, + labelSelector?: Array, + page?: number, + reason?: string, + size?: number, + sort?: Array, + unRead?: boolean, + options: AxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'username' is not null or undefined + assertParamExists("listUserNotifications", "username", username); + const localVarPath = + `/apis/api.notification.halo.run/v1alpha1/userspaces/{username}/notifications`.replace( + `{${"username"}}`, + encodeURIComponent(String(username)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication BasicAuth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + // authentication BearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration); + + if (fieldSelector) { + localVarQueryParameter["fieldSelector"] = fieldSelector; + } + + if (keyword !== undefined) { + localVarQueryParameter["keyword"] = keyword; + } + + if (labelSelector) { + localVarQueryParameter["labelSelector"] = labelSelector; + } + + if (page !== undefined) { + localVarQueryParameter["page"] = page; + } + + if (reason !== undefined) { + localVarQueryParameter["reason"] = reason; + } + + if (size !== undefined) { + localVarQueryParameter["size"] = size; + } + + if (sort) { + localVarQueryParameter["sort"] = Array.from(sort); + } + + if (unRead !== undefined) { + localVarQueryParameter["unRead"] = unRead; + } + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Mark the specified notification as read. + * @param {string} username Username + * @param {string} name Notification name + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + markNotificationAsRead: async ( + username: string, + name: string, + options: AxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'username' is not null or undefined + assertParamExists("markNotificationAsRead", "username", username); + // verify required parameter 'name' is not null or undefined + assertParamExists("markNotificationAsRead", "name", name); + const localVarPath = + `/apis/api.notification.halo.run/v1alpha1/userspaces/{username}/notifications/{name}/mark-as-read` + .replace(`{${"username"}}`, encodeURIComponent(String(username))) + .replace(`{${"name"}}`, encodeURIComponent(String(name))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: "PUT", + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication BasicAuth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + // authentication BearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration); + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Mark the specified notifications as read. + * @param {string} username Username + * @param {MarkSpecifiedRequest} markSpecifiedRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + markNotificationsAsRead: async ( + username: string, + markSpecifiedRequest: MarkSpecifiedRequest, + options: AxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'username' is not null or undefined + assertParamExists("markNotificationsAsRead", "username", username); + // verify required parameter 'markSpecifiedRequest' is not null or undefined + assertParamExists( + "markNotificationsAsRead", + "markSpecifiedRequest", + markSpecifiedRequest + ); + const localVarPath = + `/apis/api.notification.halo.run/v1alpha1/userspaces/{username}/notifications/-/mark-specified-as-read`.replace( + `{${"username"}}`, + encodeURIComponent(String(username)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: "PUT", + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication BasicAuth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + // authentication BearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration); + + localVarHeaderParameter["Content-Type"] = "application/json"; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + localVarRequestOptions.data = serializeDataIfNeeded( + markSpecifiedRequest, + localVarRequestOptions, + configuration + ); + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; + }; + +/** + * ApiNotificationHaloRunV1alpha1NotificationApi - functional programming interface + * @export + */ +export const ApiNotificationHaloRunV1alpha1NotificationApiFp = function ( + configuration?: Configuration +) { + const localVarAxiosParamCreator = + ApiNotificationHaloRunV1alpha1NotificationApiAxiosParamCreator( + configuration + ); + return { + /** + * List notifications for the authenticated user. + * @param {string} username Username + * @param {Array} [fieldSelector] Field selector for filtering. + * @param {string} [keyword] + * @param {Array} [labelSelector] Label selector for filtering. + * @param {number} [page] The page number. Zero indicates no page. + * @param {string} [reason] Filter by notification reason + * @param {number} [size] Size of one page. Zero indicates no limit. + * @param {Array} [sort] Sort property and direction of the list result. Supported fields: creationTimestamp + * @param {boolean} [unRead] true for unread, false for read, null for all + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listUserNotifications( + username: string, + fieldSelector?: Array, + keyword?: string, + labelSelector?: Array, + page?: number, + reason?: string, + size?: number, + sort?: Array, + unRead?: boolean, + options?: AxiosRequestConfig + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.listUserNotifications( + username, + fieldSelector, + keyword, + labelSelector, + page, + reason, + size, + sort, + unRead, + options + ); + return createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + ); + }, + /** + * Mark the specified notification as read. + * @param {string} username Username + * @param {string} name Notification name + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async markNotificationAsRead( + username: string, + name: string, + options?: AxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.markNotificationAsRead( + username, + name, + options + ); + return createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + ); + }, + /** + * Mark the specified notifications as read. + * @param {string} username Username + * @param {MarkSpecifiedRequest} markSpecifiedRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async markNotificationsAsRead( + username: string, + markSpecifiedRequest: MarkSpecifiedRequest, + options?: AxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise> + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.markNotificationsAsRead( + username, + markSpecifiedRequest, + options + ); + return createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + ); + }, + }; +}; + +/** + * ApiNotificationHaloRunV1alpha1NotificationApi - factory interface + * @export + */ +export const ApiNotificationHaloRunV1alpha1NotificationApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance +) { + const localVarFp = + ApiNotificationHaloRunV1alpha1NotificationApiFp(configuration); + return { + /** + * List notifications for the authenticated user. + * @param {ApiNotificationHaloRunV1alpha1NotificationApiListUserNotificationsRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listUserNotifications( + requestParameters: ApiNotificationHaloRunV1alpha1NotificationApiListUserNotificationsRequest, + options?: AxiosRequestConfig + ): AxiosPromise { + return localVarFp + .listUserNotifications( + requestParameters.username, + requestParameters.fieldSelector, + requestParameters.keyword, + requestParameters.labelSelector, + requestParameters.page, + requestParameters.reason, + requestParameters.size, + requestParameters.sort, + requestParameters.unRead, + options + ) + .then((request) => request(axios, basePath)); + }, + /** + * Mark the specified notification as read. + * @param {ApiNotificationHaloRunV1alpha1NotificationApiMarkNotificationAsReadRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + markNotificationAsRead( + requestParameters: ApiNotificationHaloRunV1alpha1NotificationApiMarkNotificationAsReadRequest, + options?: AxiosRequestConfig + ): AxiosPromise { + return localVarFp + .markNotificationAsRead( + requestParameters.username, + requestParameters.name, + options + ) + .then((request) => request(axios, basePath)); + }, + /** + * Mark the specified notifications as read. + * @param {ApiNotificationHaloRunV1alpha1NotificationApiMarkNotificationsAsReadRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + markNotificationsAsRead( + requestParameters: ApiNotificationHaloRunV1alpha1NotificationApiMarkNotificationsAsReadRequest, + options?: AxiosRequestConfig + ): AxiosPromise> { + return localVarFp + .markNotificationsAsRead( + requestParameters.username, + requestParameters.markSpecifiedRequest, + options + ) + .then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * Request parameters for listUserNotifications operation in ApiNotificationHaloRunV1alpha1NotificationApi. + * @export + * @interface ApiNotificationHaloRunV1alpha1NotificationApiListUserNotificationsRequest + */ +export interface ApiNotificationHaloRunV1alpha1NotificationApiListUserNotificationsRequest { + /** + * Username + * @type {string} + * @memberof ApiNotificationHaloRunV1alpha1NotificationApiListUserNotifications + */ + readonly username: string; + + /** + * Field selector for filtering. + * @type {Array} + * @memberof ApiNotificationHaloRunV1alpha1NotificationApiListUserNotifications + */ + readonly fieldSelector?: Array; + + /** + * + * @type {string} + * @memberof ApiNotificationHaloRunV1alpha1NotificationApiListUserNotifications + */ + readonly keyword?: string; + + /** + * Label selector for filtering. + * @type {Array} + * @memberof ApiNotificationHaloRunV1alpha1NotificationApiListUserNotifications + */ + readonly labelSelector?: Array; + + /** + * The page number. Zero indicates no page. + * @type {number} + * @memberof ApiNotificationHaloRunV1alpha1NotificationApiListUserNotifications + */ + readonly page?: number; + + /** + * Filter by notification reason + * @type {string} + * @memberof ApiNotificationHaloRunV1alpha1NotificationApiListUserNotifications + */ + readonly reason?: string; + + /** + * Size of one page. Zero indicates no limit. + * @type {number} + * @memberof ApiNotificationHaloRunV1alpha1NotificationApiListUserNotifications + */ + readonly size?: number; + + /** + * Sort property and direction of the list result. Supported fields: creationTimestamp + * @type {Array} + * @memberof ApiNotificationHaloRunV1alpha1NotificationApiListUserNotifications + */ + readonly sort?: Array; + + /** + * true for unread, false for read, null for all + * @type {boolean} + * @memberof ApiNotificationHaloRunV1alpha1NotificationApiListUserNotifications + */ + readonly unRead?: boolean; +} + +/** + * Request parameters for markNotificationAsRead operation in ApiNotificationHaloRunV1alpha1NotificationApi. + * @export + * @interface ApiNotificationHaloRunV1alpha1NotificationApiMarkNotificationAsReadRequest + */ +export interface ApiNotificationHaloRunV1alpha1NotificationApiMarkNotificationAsReadRequest { + /** + * Username + * @type {string} + * @memberof ApiNotificationHaloRunV1alpha1NotificationApiMarkNotificationAsRead + */ + readonly username: string; + + /** + * Notification name + * @type {string} + * @memberof ApiNotificationHaloRunV1alpha1NotificationApiMarkNotificationAsRead + */ + readonly name: string; +} + +/** + * Request parameters for markNotificationsAsRead operation in ApiNotificationHaloRunV1alpha1NotificationApi. + * @export + * @interface ApiNotificationHaloRunV1alpha1NotificationApiMarkNotificationsAsReadRequest + */ +export interface ApiNotificationHaloRunV1alpha1NotificationApiMarkNotificationsAsReadRequest { + /** + * Username + * @type {string} + * @memberof ApiNotificationHaloRunV1alpha1NotificationApiMarkNotificationsAsRead + */ + readonly username: string; + + /** + * + * @type {MarkSpecifiedRequest} + * @memberof ApiNotificationHaloRunV1alpha1NotificationApiMarkNotificationsAsRead + */ + readonly markSpecifiedRequest: MarkSpecifiedRequest; +} + +/** + * ApiNotificationHaloRunV1alpha1NotificationApi - object-oriented interface + * @export + * @class ApiNotificationHaloRunV1alpha1NotificationApi + * @extends {BaseAPI} + */ +export class ApiNotificationHaloRunV1alpha1NotificationApi extends BaseAPI { + /** + * List notifications for the authenticated user. + * @param {ApiNotificationHaloRunV1alpha1NotificationApiListUserNotificationsRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ApiNotificationHaloRunV1alpha1NotificationApi + */ + public listUserNotifications( + requestParameters: ApiNotificationHaloRunV1alpha1NotificationApiListUserNotificationsRequest, + options?: AxiosRequestConfig + ) { + return ApiNotificationHaloRunV1alpha1NotificationApiFp(this.configuration) + .listUserNotifications( + requestParameters.username, + requestParameters.fieldSelector, + requestParameters.keyword, + requestParameters.labelSelector, + requestParameters.page, + requestParameters.reason, + requestParameters.size, + requestParameters.sort, + requestParameters.unRead, + options + ) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Mark the specified notification as read. + * @param {ApiNotificationHaloRunV1alpha1NotificationApiMarkNotificationAsReadRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ApiNotificationHaloRunV1alpha1NotificationApi + */ + public markNotificationAsRead( + requestParameters: ApiNotificationHaloRunV1alpha1NotificationApiMarkNotificationAsReadRequest, + options?: AxiosRequestConfig + ) { + return ApiNotificationHaloRunV1alpha1NotificationApiFp(this.configuration) + .markNotificationAsRead( + requestParameters.username, + requestParameters.name, + options + ) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Mark the specified notifications as read. + * @param {ApiNotificationHaloRunV1alpha1NotificationApiMarkNotificationsAsReadRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ApiNotificationHaloRunV1alpha1NotificationApi + */ + public markNotificationsAsRead( + requestParameters: ApiNotificationHaloRunV1alpha1NotificationApiMarkNotificationsAsReadRequest, + options?: AxiosRequestConfig + ) { + return ApiNotificationHaloRunV1alpha1NotificationApiFp(this.configuration) + .markNotificationsAsRead( + requestParameters.username, + requestParameters.markSpecifiedRequest, + options + ) + .then((request) => request(this.axios, this.basePath)); + } +} diff --git a/console/packages/api-client/src/api/api-notification-halo-run-v1alpha1-notifier-api.ts b/console/packages/api-client/src/api/api-notification-halo-run-v1alpha1-notifier-api.ts new file mode 100644 index 0000000000..d5b63c0d3c --- /dev/null +++ b/console/packages/api-client/src/api/api-notification-halo-run-v1alpha1-notifier-api.ts @@ -0,0 +1,349 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Halo Next API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.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 { Configuration } from "../configuration"; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from "axios"; +import globalAxios from "axios"; +// Some imports not used depending on template conditions +// @ts-ignore +import { + DUMMY_BASE_URL, + assertParamExists, + setApiKeyToObject, + setBasicAuthToObject, + setBearerAuthToObject, + setOAuthToObject, + setSearchParams, + serializeDataIfNeeded, + toPathString, + createRequestFunction, +} from "../common"; +// @ts-ignore +import { + BASE_PATH, + COLLECTION_FORMATS, + RequestArgs, + BaseAPI, + RequiredError, +} from "../base"; +/** + * ApiNotificationHaloRunV1alpha1NotifierApi - axios parameter creator + * @export + */ +export const ApiNotificationHaloRunV1alpha1NotifierApiAxiosParamCreator = + function (configuration?: Configuration) { + return { + /** + * Fetch receiver config of notifier + * @param {string} name Notifier name + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + fetchReceiverConfig: async ( + name: string, + options: AxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'name' is not null or undefined + assertParamExists("fetchReceiverConfig", "name", name); + const localVarPath = + `/apis/api.notification.halo.run/v1alpha1/notifiers/{name}/receiver-config`.replace( + `{${"name"}}`, + encodeURIComponent(String(name)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication BasicAuth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + // authentication BearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration); + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Save receiver config of notifier + * @param {string} name Notifier name + * @param {object} body + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + saveReceiverConfig: async ( + name: string, + body: object, + options: AxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'name' is not null or undefined + assertParamExists("saveReceiverConfig", "name", name); + // verify required parameter 'body' is not null or undefined + assertParamExists("saveReceiverConfig", "body", body); + const localVarPath = + `/apis/api.notification.halo.run/v1alpha1/notifiers/{name}/receiver-config`.replace( + `{${"name"}}`, + encodeURIComponent(String(name)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: "POST", + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication BasicAuth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + // authentication BearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration); + + localVarHeaderParameter["Content-Type"] = "application/json"; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + localVarRequestOptions.data = serializeDataIfNeeded( + body, + localVarRequestOptions, + configuration + ); + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; + }; + +/** + * ApiNotificationHaloRunV1alpha1NotifierApi - functional programming interface + * @export + */ +export const ApiNotificationHaloRunV1alpha1NotifierApiFp = function ( + configuration?: Configuration +) { + const localVarAxiosParamCreator = + ApiNotificationHaloRunV1alpha1NotifierApiAxiosParamCreator(configuration); + return { + /** + * Fetch receiver config of notifier + * @param {string} name Notifier name + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async fetchReceiverConfig( + name: string, + options?: AxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.fetchReceiverConfig(name, options); + return createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + ); + }, + /** + * Save receiver config of notifier + * @param {string} name Notifier name + * @param {object} body + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async saveReceiverConfig( + name: string, + body: object, + options?: AxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.saveReceiverConfig(name, body, options); + return createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + ); + }, + }; +}; + +/** + * ApiNotificationHaloRunV1alpha1NotifierApi - factory interface + * @export + */ +export const ApiNotificationHaloRunV1alpha1NotifierApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance +) { + const localVarFp = ApiNotificationHaloRunV1alpha1NotifierApiFp(configuration); + return { + /** + * Fetch receiver config of notifier + * @param {ApiNotificationHaloRunV1alpha1NotifierApiFetchReceiverConfigRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + fetchReceiverConfig( + requestParameters: ApiNotificationHaloRunV1alpha1NotifierApiFetchReceiverConfigRequest, + options?: AxiosRequestConfig + ): AxiosPromise { + return localVarFp + .fetchReceiverConfig(requestParameters.name, options) + .then((request) => request(axios, basePath)); + }, + /** + * Save receiver config of notifier + * @param {ApiNotificationHaloRunV1alpha1NotifierApiSaveReceiverConfigRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + saveReceiverConfig( + requestParameters: ApiNotificationHaloRunV1alpha1NotifierApiSaveReceiverConfigRequest, + options?: AxiosRequestConfig + ): AxiosPromise { + return localVarFp + .saveReceiverConfig( + requestParameters.name, + requestParameters.body, + options + ) + .then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * Request parameters for fetchReceiverConfig operation in ApiNotificationHaloRunV1alpha1NotifierApi. + * @export + * @interface ApiNotificationHaloRunV1alpha1NotifierApiFetchReceiverConfigRequest + */ +export interface ApiNotificationHaloRunV1alpha1NotifierApiFetchReceiverConfigRequest { + /** + * Notifier name + * @type {string} + * @memberof ApiNotificationHaloRunV1alpha1NotifierApiFetchReceiverConfig + */ + readonly name: string; +} + +/** + * Request parameters for saveReceiverConfig operation in ApiNotificationHaloRunV1alpha1NotifierApi. + * @export + * @interface ApiNotificationHaloRunV1alpha1NotifierApiSaveReceiverConfigRequest + */ +export interface ApiNotificationHaloRunV1alpha1NotifierApiSaveReceiverConfigRequest { + /** + * Notifier name + * @type {string} + * @memberof ApiNotificationHaloRunV1alpha1NotifierApiSaveReceiverConfig + */ + readonly name: string; + + /** + * + * @type {object} + * @memberof ApiNotificationHaloRunV1alpha1NotifierApiSaveReceiverConfig + */ + readonly body: object; +} + +/** + * ApiNotificationHaloRunV1alpha1NotifierApi - object-oriented interface + * @export + * @class ApiNotificationHaloRunV1alpha1NotifierApi + * @extends {BaseAPI} + */ +export class ApiNotificationHaloRunV1alpha1NotifierApi extends BaseAPI { + /** + * Fetch receiver config of notifier + * @param {ApiNotificationHaloRunV1alpha1NotifierApiFetchReceiverConfigRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ApiNotificationHaloRunV1alpha1NotifierApi + */ + public fetchReceiverConfig( + requestParameters: ApiNotificationHaloRunV1alpha1NotifierApiFetchReceiverConfigRequest, + options?: AxiosRequestConfig + ) { + return ApiNotificationHaloRunV1alpha1NotifierApiFp(this.configuration) + .fetchReceiverConfig(requestParameters.name, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Save receiver config of notifier + * @param {ApiNotificationHaloRunV1alpha1NotifierApiSaveReceiverConfigRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ApiNotificationHaloRunV1alpha1NotifierApi + */ + public saveReceiverConfig( + requestParameters: ApiNotificationHaloRunV1alpha1NotifierApiSaveReceiverConfigRequest, + options?: AxiosRequestConfig + ) { + return ApiNotificationHaloRunV1alpha1NotifierApiFp(this.configuration) + .saveReceiverConfig( + requestParameters.name, + requestParameters.body, + options + ) + .then((request) => request(this.axios, this.basePath)); + } +} diff --git a/console/packages/api-client/src/api/api-notification-halo-run-v1alpha1-subscription-api.ts b/console/packages/api-client/src/api/api-notification-halo-run-v1alpha1-subscription-api.ts new file mode 100644 index 0000000000..8d5c8531f2 --- /dev/null +++ b/console/packages/api-client/src/api/api-notification-halo-run-v1alpha1-subscription-api.ts @@ -0,0 +1,207 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Halo Next API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.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 { Configuration } from "../configuration"; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from "axios"; +import globalAxios from "axios"; +// Some imports not used depending on template conditions +// @ts-ignore +import { + DUMMY_BASE_URL, + assertParamExists, + setApiKeyToObject, + setBasicAuthToObject, + setBearerAuthToObject, + setOAuthToObject, + setSearchParams, + serializeDataIfNeeded, + toPathString, + createRequestFunction, +} from "../common"; +// @ts-ignore +import { + BASE_PATH, + COLLECTION_FORMATS, + RequestArgs, + BaseAPI, + RequiredError, +} from "../base"; +/** + * ApiNotificationHaloRunV1alpha1SubscriptionApi - axios parameter creator + * @export + */ +export const ApiNotificationHaloRunV1alpha1SubscriptionApiAxiosParamCreator = + function (configuration?: Configuration) { + return { + /** + * Unsubscribe a subscription + * @param {string} token Unsubscribe token + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + unsubscribe: async ( + token: string, + options: AxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'token' is not null or undefined + assertParamExists("unsubscribe", "token", token); + const localVarPath = `/apis/api.notification.halo.run/v1alpha1/subscriptions/{name}/unsubscribe`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication BasicAuth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + // authentication BearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration); + + if (token !== undefined) { + localVarQueryParameter["token"] = token; + } + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; + }; + +/** + * ApiNotificationHaloRunV1alpha1SubscriptionApi - functional programming interface + * @export + */ +export const ApiNotificationHaloRunV1alpha1SubscriptionApiFp = function ( + configuration?: Configuration +) { + const localVarAxiosParamCreator = + ApiNotificationHaloRunV1alpha1SubscriptionApiAxiosParamCreator( + configuration + ); + return { + /** + * Unsubscribe a subscription + * @param {string} token Unsubscribe token + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async unsubscribe( + token: string, + options?: AxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = await localVarAxiosParamCreator.unsubscribe( + token, + options + ); + return createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + ); + }, + }; +}; + +/** + * ApiNotificationHaloRunV1alpha1SubscriptionApi - factory interface + * @export + */ +export const ApiNotificationHaloRunV1alpha1SubscriptionApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance +) { + const localVarFp = + ApiNotificationHaloRunV1alpha1SubscriptionApiFp(configuration); + return { + /** + * Unsubscribe a subscription + * @param {ApiNotificationHaloRunV1alpha1SubscriptionApiUnsubscribeRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + unsubscribe( + requestParameters: ApiNotificationHaloRunV1alpha1SubscriptionApiUnsubscribeRequest, + options?: AxiosRequestConfig + ): AxiosPromise { + return localVarFp + .unsubscribe(requestParameters.token, options) + .then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * Request parameters for unsubscribe operation in ApiNotificationHaloRunV1alpha1SubscriptionApi. + * @export + * @interface ApiNotificationHaloRunV1alpha1SubscriptionApiUnsubscribeRequest + */ +export interface ApiNotificationHaloRunV1alpha1SubscriptionApiUnsubscribeRequest { + /** + * Unsubscribe token + * @type {string} + * @memberof ApiNotificationHaloRunV1alpha1SubscriptionApiUnsubscribe + */ + readonly token: string; +} + +/** + * ApiNotificationHaloRunV1alpha1SubscriptionApi - object-oriented interface + * @export + * @class ApiNotificationHaloRunV1alpha1SubscriptionApi + * @extends {BaseAPI} + */ +export class ApiNotificationHaloRunV1alpha1SubscriptionApi extends BaseAPI { + /** + * Unsubscribe a subscription + * @param {ApiNotificationHaloRunV1alpha1SubscriptionApiUnsubscribeRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ApiNotificationHaloRunV1alpha1SubscriptionApi + */ + public unsubscribe( + requestParameters: ApiNotificationHaloRunV1alpha1SubscriptionApiUnsubscribeRequest, + options?: AxiosRequestConfig + ) { + return ApiNotificationHaloRunV1alpha1SubscriptionApiFp(this.configuration) + .unsubscribe(requestParameters.token, options) + .then((request) => request(this.axios, this.basePath)); + } +} diff --git a/console/packages/api-client/src/api/notification-halo-run-v1alpha1-notification-api.ts b/console/packages/api-client/src/api/notification-halo-run-v1alpha1-notification-api.ts new file mode 100644 index 0000000000..861aa52db6 --- /dev/null +++ b/console/packages/api-client/src/api/notification-halo-run-v1alpha1-notification-api.ts @@ -0,0 +1,835 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Halo Next API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.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 { Configuration } from "../configuration"; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from "axios"; +import globalAxios from "axios"; +// Some imports not used depending on template conditions +// @ts-ignore +import { + DUMMY_BASE_URL, + assertParamExists, + setApiKeyToObject, + setBasicAuthToObject, + setBearerAuthToObject, + setOAuthToObject, + setSearchParams, + serializeDataIfNeeded, + toPathString, + createRequestFunction, +} from "../common"; +// @ts-ignore +import { + BASE_PATH, + COLLECTION_FORMATS, + RequestArgs, + BaseAPI, + RequiredError, +} from "../base"; +// @ts-ignore +import { Notification } from "../models"; +// @ts-ignore +import { NotificationList } from "../models"; +/** + * NotificationHaloRunV1alpha1NotificationApi - axios parameter creator + * @export + */ +export const NotificationHaloRunV1alpha1NotificationApiAxiosParamCreator = + function (configuration?: Configuration) { + return { + /** + * Create notification.halo.run/v1alpha1/Notification + * @param {Notification} [notification] Fresh notification + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createnotificationHaloRunV1alpha1Notification: async ( + notification?: Notification, + options: AxiosRequestConfig = {} + ): Promise => { + const localVarPath = `/apis/notification.halo.run/v1alpha1/notifications`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: "POST", + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication BasicAuth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + // authentication BearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration); + + localVarHeaderParameter["Content-Type"] = "application/json"; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + localVarRequestOptions.data = serializeDataIfNeeded( + notification, + localVarRequestOptions, + configuration + ); + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Delete notification.halo.run/v1alpha1/Notification + * @param {string} name Name of notification + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deletenotificationHaloRunV1alpha1Notification: async ( + name: string, + options: AxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'name' is not null or undefined + assertParamExists( + "deletenotificationHaloRunV1alpha1Notification", + "name", + name + ); + const localVarPath = + `/apis/notification.halo.run/v1alpha1/notifications/{name}`.replace( + `{${"name"}}`, + encodeURIComponent(String(name)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: "DELETE", + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication BasicAuth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + // authentication BearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration); + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Get notification.halo.run/v1alpha1/Notification + * @param {string} name Name of notification + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getnotificationHaloRunV1alpha1Notification: async ( + name: string, + options: AxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'name' is not null or undefined + assertParamExists( + "getnotificationHaloRunV1alpha1Notification", + "name", + name + ); + const localVarPath = + `/apis/notification.halo.run/v1alpha1/notifications/{name}`.replace( + `{${"name"}}`, + encodeURIComponent(String(name)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication BasicAuth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + // authentication BearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration); + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * List notification.halo.run/v1alpha1/Notification + * @param {Array} [fieldSelector] Field selector for filtering. + * @param {Array} [labelSelector] Label selector for filtering. + * @param {number} [page] The page number. Zero indicates no page. + * @param {number} [size] Size of one page. Zero indicates no limit. + * @param {Array} [sort] Sort property and direction of the list result. Support sorting based on attribute name path. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listnotificationHaloRunV1alpha1Notification: async ( + fieldSelector?: Array, + labelSelector?: Array, + page?: number, + size?: number, + sort?: Array, + options: AxiosRequestConfig = {} + ): Promise => { + const localVarPath = `/apis/notification.halo.run/v1alpha1/notifications`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication BasicAuth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + // authentication BearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration); + + if (fieldSelector) { + localVarQueryParameter["fieldSelector"] = fieldSelector; + } + + if (labelSelector) { + localVarQueryParameter["labelSelector"] = labelSelector; + } + + if (page !== undefined) { + localVarQueryParameter["page"] = page; + } + + if (size !== undefined) { + localVarQueryParameter["size"] = size; + } + + if (sort) { + localVarQueryParameter["sort"] = Array.from(sort); + } + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Update notification.halo.run/v1alpha1/Notification + * @param {string} name Name of notification + * @param {Notification} [notification] Updated notification + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updatenotificationHaloRunV1alpha1Notification: async ( + name: string, + notification?: Notification, + options: AxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'name' is not null or undefined + assertParamExists( + "updatenotificationHaloRunV1alpha1Notification", + "name", + name + ); + const localVarPath = + `/apis/notification.halo.run/v1alpha1/notifications/{name}`.replace( + `{${"name"}}`, + encodeURIComponent(String(name)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: "PUT", + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication BasicAuth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + // authentication BearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration); + + localVarHeaderParameter["Content-Type"] = "application/json"; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + localVarRequestOptions.data = serializeDataIfNeeded( + notification, + localVarRequestOptions, + configuration + ); + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; + }; + +/** + * NotificationHaloRunV1alpha1NotificationApi - functional programming interface + * @export + */ +export const NotificationHaloRunV1alpha1NotificationApiFp = function ( + configuration?: Configuration +) { + const localVarAxiosParamCreator = + NotificationHaloRunV1alpha1NotificationApiAxiosParamCreator(configuration); + return { + /** + * Create notification.halo.run/v1alpha1/Notification + * @param {Notification} [notification] Fresh notification + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createnotificationHaloRunV1alpha1Notification( + notification?: Notification, + options?: AxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.createnotificationHaloRunV1alpha1Notification( + notification, + options + ); + return createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + ); + }, + /** + * Delete notification.halo.run/v1alpha1/Notification + * @param {string} name Name of notification + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deletenotificationHaloRunV1alpha1Notification( + name: string, + options?: AxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.deletenotificationHaloRunV1alpha1Notification( + name, + options + ); + return createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + ); + }, + /** + * Get notification.halo.run/v1alpha1/Notification + * @param {string} name Name of notification + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getnotificationHaloRunV1alpha1Notification( + name: string, + options?: AxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.getnotificationHaloRunV1alpha1Notification( + name, + options + ); + return createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + ); + }, + /** + * List notification.halo.run/v1alpha1/Notification + * @param {Array} [fieldSelector] Field selector for filtering. + * @param {Array} [labelSelector] Label selector for filtering. + * @param {number} [page] The page number. Zero indicates no page. + * @param {number} [size] Size of one page. Zero indicates no limit. + * @param {Array} [sort] Sort property and direction of the list result. Support sorting based on attribute name path. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listnotificationHaloRunV1alpha1Notification( + fieldSelector?: Array, + labelSelector?: Array, + page?: number, + size?: number, + sort?: Array, + options?: AxiosRequestConfig + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.listnotificationHaloRunV1alpha1Notification( + fieldSelector, + labelSelector, + page, + size, + sort, + options + ); + return createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + ); + }, + /** + * Update notification.halo.run/v1alpha1/Notification + * @param {string} name Name of notification + * @param {Notification} [notification] Updated notification + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async updatenotificationHaloRunV1alpha1Notification( + name: string, + notification?: Notification, + options?: AxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.updatenotificationHaloRunV1alpha1Notification( + name, + notification, + options + ); + return createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + ); + }, + }; +}; + +/** + * NotificationHaloRunV1alpha1NotificationApi - factory interface + * @export + */ +export const NotificationHaloRunV1alpha1NotificationApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance +) { + const localVarFp = + NotificationHaloRunV1alpha1NotificationApiFp(configuration); + return { + /** + * Create notification.halo.run/v1alpha1/Notification + * @param {NotificationHaloRunV1alpha1NotificationApiCreatenotificationHaloRunV1alpha1NotificationRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createnotificationHaloRunV1alpha1Notification( + requestParameters: NotificationHaloRunV1alpha1NotificationApiCreatenotificationHaloRunV1alpha1NotificationRequest = {}, + options?: AxiosRequestConfig + ): AxiosPromise { + return localVarFp + .createnotificationHaloRunV1alpha1Notification( + requestParameters.notification, + options + ) + .then((request) => request(axios, basePath)); + }, + /** + * Delete notification.halo.run/v1alpha1/Notification + * @param {NotificationHaloRunV1alpha1NotificationApiDeletenotificationHaloRunV1alpha1NotificationRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deletenotificationHaloRunV1alpha1Notification( + requestParameters: NotificationHaloRunV1alpha1NotificationApiDeletenotificationHaloRunV1alpha1NotificationRequest, + options?: AxiosRequestConfig + ): AxiosPromise { + return localVarFp + .deletenotificationHaloRunV1alpha1Notification( + requestParameters.name, + options + ) + .then((request) => request(axios, basePath)); + }, + /** + * Get notification.halo.run/v1alpha1/Notification + * @param {NotificationHaloRunV1alpha1NotificationApiGetnotificationHaloRunV1alpha1NotificationRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getnotificationHaloRunV1alpha1Notification( + requestParameters: NotificationHaloRunV1alpha1NotificationApiGetnotificationHaloRunV1alpha1NotificationRequest, + options?: AxiosRequestConfig + ): AxiosPromise { + return localVarFp + .getnotificationHaloRunV1alpha1Notification( + requestParameters.name, + options + ) + .then((request) => request(axios, basePath)); + }, + /** + * List notification.halo.run/v1alpha1/Notification + * @param {NotificationHaloRunV1alpha1NotificationApiListnotificationHaloRunV1alpha1NotificationRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listnotificationHaloRunV1alpha1Notification( + requestParameters: NotificationHaloRunV1alpha1NotificationApiListnotificationHaloRunV1alpha1NotificationRequest = {}, + options?: AxiosRequestConfig + ): AxiosPromise { + return localVarFp + .listnotificationHaloRunV1alpha1Notification( + requestParameters.fieldSelector, + requestParameters.labelSelector, + requestParameters.page, + requestParameters.size, + requestParameters.sort, + options + ) + .then((request) => request(axios, basePath)); + }, + /** + * Update notification.halo.run/v1alpha1/Notification + * @param {NotificationHaloRunV1alpha1NotificationApiUpdatenotificationHaloRunV1alpha1NotificationRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updatenotificationHaloRunV1alpha1Notification( + requestParameters: NotificationHaloRunV1alpha1NotificationApiUpdatenotificationHaloRunV1alpha1NotificationRequest, + options?: AxiosRequestConfig + ): AxiosPromise { + return localVarFp + .updatenotificationHaloRunV1alpha1Notification( + requestParameters.name, + requestParameters.notification, + options + ) + .then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * Request parameters for createnotificationHaloRunV1alpha1Notification operation in NotificationHaloRunV1alpha1NotificationApi. + * @export + * @interface NotificationHaloRunV1alpha1NotificationApiCreatenotificationHaloRunV1alpha1NotificationRequest + */ +export interface NotificationHaloRunV1alpha1NotificationApiCreatenotificationHaloRunV1alpha1NotificationRequest { + /** + * Fresh notification + * @type {Notification} + * @memberof NotificationHaloRunV1alpha1NotificationApiCreatenotificationHaloRunV1alpha1Notification + */ + readonly notification?: Notification; +} + +/** + * Request parameters for deletenotificationHaloRunV1alpha1Notification operation in NotificationHaloRunV1alpha1NotificationApi. + * @export + * @interface NotificationHaloRunV1alpha1NotificationApiDeletenotificationHaloRunV1alpha1NotificationRequest + */ +export interface NotificationHaloRunV1alpha1NotificationApiDeletenotificationHaloRunV1alpha1NotificationRequest { + /** + * Name of notification + * @type {string} + * @memberof NotificationHaloRunV1alpha1NotificationApiDeletenotificationHaloRunV1alpha1Notification + */ + readonly name: string; +} + +/** + * Request parameters for getnotificationHaloRunV1alpha1Notification operation in NotificationHaloRunV1alpha1NotificationApi. + * @export + * @interface NotificationHaloRunV1alpha1NotificationApiGetnotificationHaloRunV1alpha1NotificationRequest + */ +export interface NotificationHaloRunV1alpha1NotificationApiGetnotificationHaloRunV1alpha1NotificationRequest { + /** + * Name of notification + * @type {string} + * @memberof NotificationHaloRunV1alpha1NotificationApiGetnotificationHaloRunV1alpha1Notification + */ + readonly name: string; +} + +/** + * Request parameters for listnotificationHaloRunV1alpha1Notification operation in NotificationHaloRunV1alpha1NotificationApi. + * @export + * @interface NotificationHaloRunV1alpha1NotificationApiListnotificationHaloRunV1alpha1NotificationRequest + */ +export interface NotificationHaloRunV1alpha1NotificationApiListnotificationHaloRunV1alpha1NotificationRequest { + /** + * Field selector for filtering. + * @type {Array} + * @memberof NotificationHaloRunV1alpha1NotificationApiListnotificationHaloRunV1alpha1Notification + */ + readonly fieldSelector?: Array; + + /** + * Label selector for filtering. + * @type {Array} + * @memberof NotificationHaloRunV1alpha1NotificationApiListnotificationHaloRunV1alpha1Notification + */ + readonly labelSelector?: Array; + + /** + * The page number. Zero indicates no page. + * @type {number} + * @memberof NotificationHaloRunV1alpha1NotificationApiListnotificationHaloRunV1alpha1Notification + */ + readonly page?: number; + + /** + * Size of one page. Zero indicates no limit. + * @type {number} + * @memberof NotificationHaloRunV1alpha1NotificationApiListnotificationHaloRunV1alpha1Notification + */ + readonly size?: number; + + /** + * Sort property and direction of the list result. Support sorting based on attribute name path. + * @type {Array} + * @memberof NotificationHaloRunV1alpha1NotificationApiListnotificationHaloRunV1alpha1Notification + */ + readonly sort?: Array; +} + +/** + * Request parameters for updatenotificationHaloRunV1alpha1Notification operation in NotificationHaloRunV1alpha1NotificationApi. + * @export + * @interface NotificationHaloRunV1alpha1NotificationApiUpdatenotificationHaloRunV1alpha1NotificationRequest + */ +export interface NotificationHaloRunV1alpha1NotificationApiUpdatenotificationHaloRunV1alpha1NotificationRequest { + /** + * Name of notification + * @type {string} + * @memberof NotificationHaloRunV1alpha1NotificationApiUpdatenotificationHaloRunV1alpha1Notification + */ + readonly name: string; + + /** + * Updated notification + * @type {Notification} + * @memberof NotificationHaloRunV1alpha1NotificationApiUpdatenotificationHaloRunV1alpha1Notification + */ + readonly notification?: Notification; +} + +/** + * NotificationHaloRunV1alpha1NotificationApi - object-oriented interface + * @export + * @class NotificationHaloRunV1alpha1NotificationApi + * @extends {BaseAPI} + */ +export class NotificationHaloRunV1alpha1NotificationApi extends BaseAPI { + /** + * Create notification.halo.run/v1alpha1/Notification + * @param {NotificationHaloRunV1alpha1NotificationApiCreatenotificationHaloRunV1alpha1NotificationRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof NotificationHaloRunV1alpha1NotificationApi + */ + public createnotificationHaloRunV1alpha1Notification( + requestParameters: NotificationHaloRunV1alpha1NotificationApiCreatenotificationHaloRunV1alpha1NotificationRequest = {}, + options?: AxiosRequestConfig + ) { + return NotificationHaloRunV1alpha1NotificationApiFp(this.configuration) + .createnotificationHaloRunV1alpha1Notification( + requestParameters.notification, + options + ) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Delete notification.halo.run/v1alpha1/Notification + * @param {NotificationHaloRunV1alpha1NotificationApiDeletenotificationHaloRunV1alpha1NotificationRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof NotificationHaloRunV1alpha1NotificationApi + */ + public deletenotificationHaloRunV1alpha1Notification( + requestParameters: NotificationHaloRunV1alpha1NotificationApiDeletenotificationHaloRunV1alpha1NotificationRequest, + options?: AxiosRequestConfig + ) { + return NotificationHaloRunV1alpha1NotificationApiFp(this.configuration) + .deletenotificationHaloRunV1alpha1Notification( + requestParameters.name, + options + ) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Get notification.halo.run/v1alpha1/Notification + * @param {NotificationHaloRunV1alpha1NotificationApiGetnotificationHaloRunV1alpha1NotificationRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof NotificationHaloRunV1alpha1NotificationApi + */ + public getnotificationHaloRunV1alpha1Notification( + requestParameters: NotificationHaloRunV1alpha1NotificationApiGetnotificationHaloRunV1alpha1NotificationRequest, + options?: AxiosRequestConfig + ) { + return NotificationHaloRunV1alpha1NotificationApiFp(this.configuration) + .getnotificationHaloRunV1alpha1Notification( + requestParameters.name, + options + ) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * List notification.halo.run/v1alpha1/Notification + * @param {NotificationHaloRunV1alpha1NotificationApiListnotificationHaloRunV1alpha1NotificationRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof NotificationHaloRunV1alpha1NotificationApi + */ + public listnotificationHaloRunV1alpha1Notification( + requestParameters: NotificationHaloRunV1alpha1NotificationApiListnotificationHaloRunV1alpha1NotificationRequest = {}, + options?: AxiosRequestConfig + ) { + return NotificationHaloRunV1alpha1NotificationApiFp(this.configuration) + .listnotificationHaloRunV1alpha1Notification( + requestParameters.fieldSelector, + requestParameters.labelSelector, + requestParameters.page, + requestParameters.size, + requestParameters.sort, + options + ) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Update notification.halo.run/v1alpha1/Notification + * @param {NotificationHaloRunV1alpha1NotificationApiUpdatenotificationHaloRunV1alpha1NotificationRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof NotificationHaloRunV1alpha1NotificationApi + */ + public updatenotificationHaloRunV1alpha1Notification( + requestParameters: NotificationHaloRunV1alpha1NotificationApiUpdatenotificationHaloRunV1alpha1NotificationRequest, + options?: AxiosRequestConfig + ) { + return NotificationHaloRunV1alpha1NotificationApiFp(this.configuration) + .updatenotificationHaloRunV1alpha1Notification( + requestParameters.name, + requestParameters.notification, + options + ) + .then((request) => request(this.axios, this.basePath)); + } +} diff --git a/console/packages/api-client/src/api/notification-halo-run-v1alpha1-notification-template-api.ts b/console/packages/api-client/src/api/notification-halo-run-v1alpha1-notification-template-api.ts new file mode 100644 index 0000000000..e1bb705555 --- /dev/null +++ b/console/packages/api-client/src/api/notification-halo-run-v1alpha1-notification-template-api.ts @@ -0,0 +1,857 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Halo Next API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.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 { Configuration } from "../configuration"; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from "axios"; +import globalAxios from "axios"; +// Some imports not used depending on template conditions +// @ts-ignore +import { + DUMMY_BASE_URL, + assertParamExists, + setApiKeyToObject, + setBasicAuthToObject, + setBearerAuthToObject, + setOAuthToObject, + setSearchParams, + serializeDataIfNeeded, + toPathString, + createRequestFunction, +} from "../common"; +// @ts-ignore +import { + BASE_PATH, + COLLECTION_FORMATS, + RequestArgs, + BaseAPI, + RequiredError, +} from "../base"; +// @ts-ignore +import { NotificationTemplate } from "../models"; +// @ts-ignore +import { NotificationTemplateList } from "../models"; +/** + * NotificationHaloRunV1alpha1NotificationTemplateApi - axios parameter creator + * @export + */ +export const NotificationHaloRunV1alpha1NotificationTemplateApiAxiosParamCreator = + function (configuration?: Configuration) { + return { + /** + * Create notification.halo.run/v1alpha1/NotificationTemplate + * @param {NotificationTemplate} [notificationTemplate] Fresh notificationtemplate + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createnotificationHaloRunV1alpha1NotificationTemplate: async ( + notificationTemplate?: NotificationTemplate, + options: AxiosRequestConfig = {} + ): Promise => { + const localVarPath = `/apis/notification.halo.run/v1alpha1/notificationtemplates`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: "POST", + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication BasicAuth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + // authentication BearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration); + + localVarHeaderParameter["Content-Type"] = "application/json"; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + localVarRequestOptions.data = serializeDataIfNeeded( + notificationTemplate, + localVarRequestOptions, + configuration + ); + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Delete notification.halo.run/v1alpha1/NotificationTemplate + * @param {string} name Name of notificationtemplate + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deletenotificationHaloRunV1alpha1NotificationTemplate: async ( + name: string, + options: AxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'name' is not null or undefined + assertParamExists( + "deletenotificationHaloRunV1alpha1NotificationTemplate", + "name", + name + ); + const localVarPath = + `/apis/notification.halo.run/v1alpha1/notificationtemplates/{name}`.replace( + `{${"name"}}`, + encodeURIComponent(String(name)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: "DELETE", + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication BasicAuth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + // authentication BearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration); + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Get notification.halo.run/v1alpha1/NotificationTemplate + * @param {string} name Name of notificationtemplate + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getnotificationHaloRunV1alpha1NotificationTemplate: async ( + name: string, + options: AxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'name' is not null or undefined + assertParamExists( + "getnotificationHaloRunV1alpha1NotificationTemplate", + "name", + name + ); + const localVarPath = + `/apis/notification.halo.run/v1alpha1/notificationtemplates/{name}`.replace( + `{${"name"}}`, + encodeURIComponent(String(name)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication BasicAuth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + // authentication BearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration); + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * List notification.halo.run/v1alpha1/NotificationTemplate + * @param {Array} [fieldSelector] Field selector for filtering. + * @param {Array} [labelSelector] Label selector for filtering. + * @param {number} [page] The page number. Zero indicates no page. + * @param {number} [size] Size of one page. Zero indicates no limit. + * @param {Array} [sort] Sort property and direction of the list result. Support sorting based on attribute name path. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listnotificationHaloRunV1alpha1NotificationTemplate: async ( + fieldSelector?: Array, + labelSelector?: Array, + page?: number, + size?: number, + sort?: Array, + options: AxiosRequestConfig = {} + ): Promise => { + const localVarPath = `/apis/notification.halo.run/v1alpha1/notificationtemplates`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication BasicAuth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + // authentication BearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration); + + if (fieldSelector) { + localVarQueryParameter["fieldSelector"] = fieldSelector; + } + + if (labelSelector) { + localVarQueryParameter["labelSelector"] = labelSelector; + } + + if (page !== undefined) { + localVarQueryParameter["page"] = page; + } + + if (size !== undefined) { + localVarQueryParameter["size"] = size; + } + + if (sort) { + localVarQueryParameter["sort"] = Array.from(sort); + } + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Update notification.halo.run/v1alpha1/NotificationTemplate + * @param {string} name Name of notificationtemplate + * @param {NotificationTemplate} [notificationTemplate] Updated notificationtemplate + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updatenotificationHaloRunV1alpha1NotificationTemplate: async ( + name: string, + notificationTemplate?: NotificationTemplate, + options: AxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'name' is not null or undefined + assertParamExists( + "updatenotificationHaloRunV1alpha1NotificationTemplate", + "name", + name + ); + const localVarPath = + `/apis/notification.halo.run/v1alpha1/notificationtemplates/{name}`.replace( + `{${"name"}}`, + encodeURIComponent(String(name)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: "PUT", + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication BasicAuth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + // authentication BearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration); + + localVarHeaderParameter["Content-Type"] = "application/json"; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + localVarRequestOptions.data = serializeDataIfNeeded( + notificationTemplate, + localVarRequestOptions, + configuration + ); + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; + }; + +/** + * NotificationHaloRunV1alpha1NotificationTemplateApi - functional programming interface + * @export + */ +export const NotificationHaloRunV1alpha1NotificationTemplateApiFp = function ( + configuration?: Configuration +) { + const localVarAxiosParamCreator = + NotificationHaloRunV1alpha1NotificationTemplateApiAxiosParamCreator( + configuration + ); + return { + /** + * Create notification.halo.run/v1alpha1/NotificationTemplate + * @param {NotificationTemplate} [notificationTemplate] Fresh notificationtemplate + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createnotificationHaloRunV1alpha1NotificationTemplate( + notificationTemplate?: NotificationTemplate, + options?: AxiosRequestConfig + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.createnotificationHaloRunV1alpha1NotificationTemplate( + notificationTemplate, + options + ); + return createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + ); + }, + /** + * Delete notification.halo.run/v1alpha1/NotificationTemplate + * @param {string} name Name of notificationtemplate + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deletenotificationHaloRunV1alpha1NotificationTemplate( + name: string, + options?: AxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.deletenotificationHaloRunV1alpha1NotificationTemplate( + name, + options + ); + return createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + ); + }, + /** + * Get notification.halo.run/v1alpha1/NotificationTemplate + * @param {string} name Name of notificationtemplate + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getnotificationHaloRunV1alpha1NotificationTemplate( + name: string, + options?: AxiosRequestConfig + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.getnotificationHaloRunV1alpha1NotificationTemplate( + name, + options + ); + return createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + ); + }, + /** + * List notification.halo.run/v1alpha1/NotificationTemplate + * @param {Array} [fieldSelector] Field selector for filtering. + * @param {Array} [labelSelector] Label selector for filtering. + * @param {number} [page] The page number. Zero indicates no page. + * @param {number} [size] Size of one page. Zero indicates no limit. + * @param {Array} [sort] Sort property and direction of the list result. Support sorting based on attribute name path. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listnotificationHaloRunV1alpha1NotificationTemplate( + fieldSelector?: Array, + labelSelector?: Array, + page?: number, + size?: number, + sort?: Array, + options?: AxiosRequestConfig + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.listnotificationHaloRunV1alpha1NotificationTemplate( + fieldSelector, + labelSelector, + page, + size, + sort, + options + ); + return createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + ); + }, + /** + * Update notification.halo.run/v1alpha1/NotificationTemplate + * @param {string} name Name of notificationtemplate + * @param {NotificationTemplate} [notificationTemplate] Updated notificationtemplate + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async updatenotificationHaloRunV1alpha1NotificationTemplate( + name: string, + notificationTemplate?: NotificationTemplate, + options?: AxiosRequestConfig + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.updatenotificationHaloRunV1alpha1NotificationTemplate( + name, + notificationTemplate, + options + ); + return createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + ); + }, + }; +}; + +/** + * NotificationHaloRunV1alpha1NotificationTemplateApi - factory interface + * @export + */ +export const NotificationHaloRunV1alpha1NotificationTemplateApiFactory = + function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance + ) { + const localVarFp = + NotificationHaloRunV1alpha1NotificationTemplateApiFp(configuration); + return { + /** + * Create notification.halo.run/v1alpha1/NotificationTemplate + * @param {NotificationHaloRunV1alpha1NotificationTemplateApiCreatenotificationHaloRunV1alpha1NotificationTemplateRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createnotificationHaloRunV1alpha1NotificationTemplate( + requestParameters: NotificationHaloRunV1alpha1NotificationTemplateApiCreatenotificationHaloRunV1alpha1NotificationTemplateRequest = {}, + options?: AxiosRequestConfig + ): AxiosPromise { + return localVarFp + .createnotificationHaloRunV1alpha1NotificationTemplate( + requestParameters.notificationTemplate, + options + ) + .then((request) => request(axios, basePath)); + }, + /** + * Delete notification.halo.run/v1alpha1/NotificationTemplate + * @param {NotificationHaloRunV1alpha1NotificationTemplateApiDeletenotificationHaloRunV1alpha1NotificationTemplateRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deletenotificationHaloRunV1alpha1NotificationTemplate( + requestParameters: NotificationHaloRunV1alpha1NotificationTemplateApiDeletenotificationHaloRunV1alpha1NotificationTemplateRequest, + options?: AxiosRequestConfig + ): AxiosPromise { + return localVarFp + .deletenotificationHaloRunV1alpha1NotificationTemplate( + requestParameters.name, + options + ) + .then((request) => request(axios, basePath)); + }, + /** + * Get notification.halo.run/v1alpha1/NotificationTemplate + * @param {NotificationHaloRunV1alpha1NotificationTemplateApiGetnotificationHaloRunV1alpha1NotificationTemplateRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getnotificationHaloRunV1alpha1NotificationTemplate( + requestParameters: NotificationHaloRunV1alpha1NotificationTemplateApiGetnotificationHaloRunV1alpha1NotificationTemplateRequest, + options?: AxiosRequestConfig + ): AxiosPromise { + return localVarFp + .getnotificationHaloRunV1alpha1NotificationTemplate( + requestParameters.name, + options + ) + .then((request) => request(axios, basePath)); + }, + /** + * List notification.halo.run/v1alpha1/NotificationTemplate + * @param {NotificationHaloRunV1alpha1NotificationTemplateApiListnotificationHaloRunV1alpha1NotificationTemplateRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listnotificationHaloRunV1alpha1NotificationTemplate( + requestParameters: NotificationHaloRunV1alpha1NotificationTemplateApiListnotificationHaloRunV1alpha1NotificationTemplateRequest = {}, + options?: AxiosRequestConfig + ): AxiosPromise { + return localVarFp + .listnotificationHaloRunV1alpha1NotificationTemplate( + requestParameters.fieldSelector, + requestParameters.labelSelector, + requestParameters.page, + requestParameters.size, + requestParameters.sort, + options + ) + .then((request) => request(axios, basePath)); + }, + /** + * Update notification.halo.run/v1alpha1/NotificationTemplate + * @param {NotificationHaloRunV1alpha1NotificationTemplateApiUpdatenotificationHaloRunV1alpha1NotificationTemplateRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updatenotificationHaloRunV1alpha1NotificationTemplate( + requestParameters: NotificationHaloRunV1alpha1NotificationTemplateApiUpdatenotificationHaloRunV1alpha1NotificationTemplateRequest, + options?: AxiosRequestConfig + ): AxiosPromise { + return localVarFp + .updatenotificationHaloRunV1alpha1NotificationTemplate( + requestParameters.name, + requestParameters.notificationTemplate, + options + ) + .then((request) => request(axios, basePath)); + }, + }; + }; + +/** + * Request parameters for createnotificationHaloRunV1alpha1NotificationTemplate operation in NotificationHaloRunV1alpha1NotificationTemplateApi. + * @export + * @interface NotificationHaloRunV1alpha1NotificationTemplateApiCreatenotificationHaloRunV1alpha1NotificationTemplateRequest + */ +export interface NotificationHaloRunV1alpha1NotificationTemplateApiCreatenotificationHaloRunV1alpha1NotificationTemplateRequest { + /** + * Fresh notificationtemplate + * @type {NotificationTemplate} + * @memberof NotificationHaloRunV1alpha1NotificationTemplateApiCreatenotificationHaloRunV1alpha1NotificationTemplate + */ + readonly notificationTemplate?: NotificationTemplate; +} + +/** + * Request parameters for deletenotificationHaloRunV1alpha1NotificationTemplate operation in NotificationHaloRunV1alpha1NotificationTemplateApi. + * @export + * @interface NotificationHaloRunV1alpha1NotificationTemplateApiDeletenotificationHaloRunV1alpha1NotificationTemplateRequest + */ +export interface NotificationHaloRunV1alpha1NotificationTemplateApiDeletenotificationHaloRunV1alpha1NotificationTemplateRequest { + /** + * Name of notificationtemplate + * @type {string} + * @memberof NotificationHaloRunV1alpha1NotificationTemplateApiDeletenotificationHaloRunV1alpha1NotificationTemplate + */ + readonly name: string; +} + +/** + * Request parameters for getnotificationHaloRunV1alpha1NotificationTemplate operation in NotificationHaloRunV1alpha1NotificationTemplateApi. + * @export + * @interface NotificationHaloRunV1alpha1NotificationTemplateApiGetnotificationHaloRunV1alpha1NotificationTemplateRequest + */ +export interface NotificationHaloRunV1alpha1NotificationTemplateApiGetnotificationHaloRunV1alpha1NotificationTemplateRequest { + /** + * Name of notificationtemplate + * @type {string} + * @memberof NotificationHaloRunV1alpha1NotificationTemplateApiGetnotificationHaloRunV1alpha1NotificationTemplate + */ + readonly name: string; +} + +/** + * Request parameters for listnotificationHaloRunV1alpha1NotificationTemplate operation in NotificationHaloRunV1alpha1NotificationTemplateApi. + * @export + * @interface NotificationHaloRunV1alpha1NotificationTemplateApiListnotificationHaloRunV1alpha1NotificationTemplateRequest + */ +export interface NotificationHaloRunV1alpha1NotificationTemplateApiListnotificationHaloRunV1alpha1NotificationTemplateRequest { + /** + * Field selector for filtering. + * @type {Array} + * @memberof NotificationHaloRunV1alpha1NotificationTemplateApiListnotificationHaloRunV1alpha1NotificationTemplate + */ + readonly fieldSelector?: Array; + + /** + * Label selector for filtering. + * @type {Array} + * @memberof NotificationHaloRunV1alpha1NotificationTemplateApiListnotificationHaloRunV1alpha1NotificationTemplate + */ + readonly labelSelector?: Array; + + /** + * The page number. Zero indicates no page. + * @type {number} + * @memberof NotificationHaloRunV1alpha1NotificationTemplateApiListnotificationHaloRunV1alpha1NotificationTemplate + */ + readonly page?: number; + + /** + * Size of one page. Zero indicates no limit. + * @type {number} + * @memberof NotificationHaloRunV1alpha1NotificationTemplateApiListnotificationHaloRunV1alpha1NotificationTemplate + */ + readonly size?: number; + + /** + * Sort property and direction of the list result. Support sorting based on attribute name path. + * @type {Array} + * @memberof NotificationHaloRunV1alpha1NotificationTemplateApiListnotificationHaloRunV1alpha1NotificationTemplate + */ + readonly sort?: Array; +} + +/** + * Request parameters for updatenotificationHaloRunV1alpha1NotificationTemplate operation in NotificationHaloRunV1alpha1NotificationTemplateApi. + * @export + * @interface NotificationHaloRunV1alpha1NotificationTemplateApiUpdatenotificationHaloRunV1alpha1NotificationTemplateRequest + */ +export interface NotificationHaloRunV1alpha1NotificationTemplateApiUpdatenotificationHaloRunV1alpha1NotificationTemplateRequest { + /** + * Name of notificationtemplate + * @type {string} + * @memberof NotificationHaloRunV1alpha1NotificationTemplateApiUpdatenotificationHaloRunV1alpha1NotificationTemplate + */ + readonly name: string; + + /** + * Updated notificationtemplate + * @type {NotificationTemplate} + * @memberof NotificationHaloRunV1alpha1NotificationTemplateApiUpdatenotificationHaloRunV1alpha1NotificationTemplate + */ + readonly notificationTemplate?: NotificationTemplate; +} + +/** + * NotificationHaloRunV1alpha1NotificationTemplateApi - object-oriented interface + * @export + * @class NotificationHaloRunV1alpha1NotificationTemplateApi + * @extends {BaseAPI} + */ +export class NotificationHaloRunV1alpha1NotificationTemplateApi extends BaseAPI { + /** + * Create notification.halo.run/v1alpha1/NotificationTemplate + * @param {NotificationHaloRunV1alpha1NotificationTemplateApiCreatenotificationHaloRunV1alpha1NotificationTemplateRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof NotificationHaloRunV1alpha1NotificationTemplateApi + */ + public createnotificationHaloRunV1alpha1NotificationTemplate( + requestParameters: NotificationHaloRunV1alpha1NotificationTemplateApiCreatenotificationHaloRunV1alpha1NotificationTemplateRequest = {}, + options?: AxiosRequestConfig + ) { + return NotificationHaloRunV1alpha1NotificationTemplateApiFp( + this.configuration + ) + .createnotificationHaloRunV1alpha1NotificationTemplate( + requestParameters.notificationTemplate, + options + ) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Delete notification.halo.run/v1alpha1/NotificationTemplate + * @param {NotificationHaloRunV1alpha1NotificationTemplateApiDeletenotificationHaloRunV1alpha1NotificationTemplateRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof NotificationHaloRunV1alpha1NotificationTemplateApi + */ + public deletenotificationHaloRunV1alpha1NotificationTemplate( + requestParameters: NotificationHaloRunV1alpha1NotificationTemplateApiDeletenotificationHaloRunV1alpha1NotificationTemplateRequest, + options?: AxiosRequestConfig + ) { + return NotificationHaloRunV1alpha1NotificationTemplateApiFp( + this.configuration + ) + .deletenotificationHaloRunV1alpha1NotificationTemplate( + requestParameters.name, + options + ) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Get notification.halo.run/v1alpha1/NotificationTemplate + * @param {NotificationHaloRunV1alpha1NotificationTemplateApiGetnotificationHaloRunV1alpha1NotificationTemplateRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof NotificationHaloRunV1alpha1NotificationTemplateApi + */ + public getnotificationHaloRunV1alpha1NotificationTemplate( + requestParameters: NotificationHaloRunV1alpha1NotificationTemplateApiGetnotificationHaloRunV1alpha1NotificationTemplateRequest, + options?: AxiosRequestConfig + ) { + return NotificationHaloRunV1alpha1NotificationTemplateApiFp( + this.configuration + ) + .getnotificationHaloRunV1alpha1NotificationTemplate( + requestParameters.name, + options + ) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * List notification.halo.run/v1alpha1/NotificationTemplate + * @param {NotificationHaloRunV1alpha1NotificationTemplateApiListnotificationHaloRunV1alpha1NotificationTemplateRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof NotificationHaloRunV1alpha1NotificationTemplateApi + */ + public listnotificationHaloRunV1alpha1NotificationTemplate( + requestParameters: NotificationHaloRunV1alpha1NotificationTemplateApiListnotificationHaloRunV1alpha1NotificationTemplateRequest = {}, + options?: AxiosRequestConfig + ) { + return NotificationHaloRunV1alpha1NotificationTemplateApiFp( + this.configuration + ) + .listnotificationHaloRunV1alpha1NotificationTemplate( + requestParameters.fieldSelector, + requestParameters.labelSelector, + requestParameters.page, + requestParameters.size, + requestParameters.sort, + options + ) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Update notification.halo.run/v1alpha1/NotificationTemplate + * @param {NotificationHaloRunV1alpha1NotificationTemplateApiUpdatenotificationHaloRunV1alpha1NotificationTemplateRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof NotificationHaloRunV1alpha1NotificationTemplateApi + */ + public updatenotificationHaloRunV1alpha1NotificationTemplate( + requestParameters: NotificationHaloRunV1alpha1NotificationTemplateApiUpdatenotificationHaloRunV1alpha1NotificationTemplateRequest, + options?: AxiosRequestConfig + ) { + return NotificationHaloRunV1alpha1NotificationTemplateApiFp( + this.configuration + ) + .updatenotificationHaloRunV1alpha1NotificationTemplate( + requestParameters.name, + requestParameters.notificationTemplate, + options + ) + .then((request) => request(this.axios, this.basePath)); + } +} diff --git a/console/packages/api-client/src/api/notification-halo-run-v1alpha1-notifier-descriptor-api.ts b/console/packages/api-client/src/api/notification-halo-run-v1alpha1-notifier-descriptor-api.ts new file mode 100644 index 0000000000..247baa8c9c --- /dev/null +++ b/console/packages/api-client/src/api/notification-halo-run-v1alpha1-notifier-descriptor-api.ts @@ -0,0 +1,857 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Halo Next API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.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 { Configuration } from "../configuration"; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from "axios"; +import globalAxios from "axios"; +// Some imports not used depending on template conditions +// @ts-ignore +import { + DUMMY_BASE_URL, + assertParamExists, + setApiKeyToObject, + setBasicAuthToObject, + setBearerAuthToObject, + setOAuthToObject, + setSearchParams, + serializeDataIfNeeded, + toPathString, + createRequestFunction, +} from "../common"; +// @ts-ignore +import { + BASE_PATH, + COLLECTION_FORMATS, + RequestArgs, + BaseAPI, + RequiredError, +} from "../base"; +// @ts-ignore +import { NotifierDescriptor } from "../models"; +// @ts-ignore +import { NotifierDescriptorList } from "../models"; +/** + * NotificationHaloRunV1alpha1NotifierDescriptorApi - axios parameter creator + * @export + */ +export const NotificationHaloRunV1alpha1NotifierDescriptorApiAxiosParamCreator = + function (configuration?: Configuration) { + return { + /** + * Create notification.halo.run/v1alpha1/NotifierDescriptor + * @param {NotifierDescriptor} [notifierDescriptor] Fresh notifierDescriptor + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createnotificationHaloRunV1alpha1NotifierDescriptor: async ( + notifierDescriptor?: NotifierDescriptor, + options: AxiosRequestConfig = {} + ): Promise => { + const localVarPath = `/apis/notification.halo.run/v1alpha1/notifierDescriptors`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: "POST", + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication BasicAuth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + // authentication BearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration); + + localVarHeaderParameter["Content-Type"] = "application/json"; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + localVarRequestOptions.data = serializeDataIfNeeded( + notifierDescriptor, + localVarRequestOptions, + configuration + ); + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Delete notification.halo.run/v1alpha1/NotifierDescriptor + * @param {string} name Name of notifierDescriptor + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deletenotificationHaloRunV1alpha1NotifierDescriptor: async ( + name: string, + options: AxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'name' is not null or undefined + assertParamExists( + "deletenotificationHaloRunV1alpha1NotifierDescriptor", + "name", + name + ); + const localVarPath = + `/apis/notification.halo.run/v1alpha1/notifierDescriptors/{name}`.replace( + `{${"name"}}`, + encodeURIComponent(String(name)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: "DELETE", + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication BasicAuth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + // authentication BearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration); + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Get notification.halo.run/v1alpha1/NotifierDescriptor + * @param {string} name Name of notifierDescriptor + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getnotificationHaloRunV1alpha1NotifierDescriptor: async ( + name: string, + options: AxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'name' is not null or undefined + assertParamExists( + "getnotificationHaloRunV1alpha1NotifierDescriptor", + "name", + name + ); + const localVarPath = + `/apis/notification.halo.run/v1alpha1/notifierDescriptors/{name}`.replace( + `{${"name"}}`, + encodeURIComponent(String(name)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication BasicAuth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + // authentication BearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration); + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * List notification.halo.run/v1alpha1/NotifierDescriptor + * @param {Array} [fieldSelector] Field selector for filtering. + * @param {Array} [labelSelector] Label selector for filtering. + * @param {number} [page] The page number. Zero indicates no page. + * @param {number} [size] Size of one page. Zero indicates no limit. + * @param {Array} [sort] Sort property and direction of the list result. Support sorting based on attribute name path. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listnotificationHaloRunV1alpha1NotifierDescriptor: async ( + fieldSelector?: Array, + labelSelector?: Array, + page?: number, + size?: number, + sort?: Array, + options: AxiosRequestConfig = {} + ): Promise => { + const localVarPath = `/apis/notification.halo.run/v1alpha1/notifierDescriptors`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication BasicAuth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + // authentication BearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration); + + if (fieldSelector) { + localVarQueryParameter["fieldSelector"] = fieldSelector; + } + + if (labelSelector) { + localVarQueryParameter["labelSelector"] = labelSelector; + } + + if (page !== undefined) { + localVarQueryParameter["page"] = page; + } + + if (size !== undefined) { + localVarQueryParameter["size"] = size; + } + + if (sort) { + localVarQueryParameter["sort"] = Array.from(sort); + } + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Update notification.halo.run/v1alpha1/NotifierDescriptor + * @param {string} name Name of notifierDescriptor + * @param {NotifierDescriptor} [notifierDescriptor] Updated notifierDescriptor + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updatenotificationHaloRunV1alpha1NotifierDescriptor: async ( + name: string, + notifierDescriptor?: NotifierDescriptor, + options: AxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'name' is not null or undefined + assertParamExists( + "updatenotificationHaloRunV1alpha1NotifierDescriptor", + "name", + name + ); + const localVarPath = + `/apis/notification.halo.run/v1alpha1/notifierDescriptors/{name}`.replace( + `{${"name"}}`, + encodeURIComponent(String(name)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: "PUT", + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication BasicAuth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + // authentication BearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration); + + localVarHeaderParameter["Content-Type"] = "application/json"; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + localVarRequestOptions.data = serializeDataIfNeeded( + notifierDescriptor, + localVarRequestOptions, + configuration + ); + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; + }; + +/** + * NotificationHaloRunV1alpha1NotifierDescriptorApi - functional programming interface + * @export + */ +export const NotificationHaloRunV1alpha1NotifierDescriptorApiFp = function ( + configuration?: Configuration +) { + const localVarAxiosParamCreator = + NotificationHaloRunV1alpha1NotifierDescriptorApiAxiosParamCreator( + configuration + ); + return { + /** + * Create notification.halo.run/v1alpha1/NotifierDescriptor + * @param {NotifierDescriptor} [notifierDescriptor] Fresh notifierDescriptor + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createnotificationHaloRunV1alpha1NotifierDescriptor( + notifierDescriptor?: NotifierDescriptor, + options?: AxiosRequestConfig + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.createnotificationHaloRunV1alpha1NotifierDescriptor( + notifierDescriptor, + options + ); + return createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + ); + }, + /** + * Delete notification.halo.run/v1alpha1/NotifierDescriptor + * @param {string} name Name of notifierDescriptor + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deletenotificationHaloRunV1alpha1NotifierDescriptor( + name: string, + options?: AxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.deletenotificationHaloRunV1alpha1NotifierDescriptor( + name, + options + ); + return createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + ); + }, + /** + * Get notification.halo.run/v1alpha1/NotifierDescriptor + * @param {string} name Name of notifierDescriptor + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getnotificationHaloRunV1alpha1NotifierDescriptor( + name: string, + options?: AxiosRequestConfig + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.getnotificationHaloRunV1alpha1NotifierDescriptor( + name, + options + ); + return createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + ); + }, + /** + * List notification.halo.run/v1alpha1/NotifierDescriptor + * @param {Array} [fieldSelector] Field selector for filtering. + * @param {Array} [labelSelector] Label selector for filtering. + * @param {number} [page] The page number. Zero indicates no page. + * @param {number} [size] Size of one page. Zero indicates no limit. + * @param {Array} [sort] Sort property and direction of the list result. Support sorting based on attribute name path. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listnotificationHaloRunV1alpha1NotifierDescriptor( + fieldSelector?: Array, + labelSelector?: Array, + page?: number, + size?: number, + sort?: Array, + options?: AxiosRequestConfig + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.listnotificationHaloRunV1alpha1NotifierDescriptor( + fieldSelector, + labelSelector, + page, + size, + sort, + options + ); + return createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + ); + }, + /** + * Update notification.halo.run/v1alpha1/NotifierDescriptor + * @param {string} name Name of notifierDescriptor + * @param {NotifierDescriptor} [notifierDescriptor] Updated notifierDescriptor + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async updatenotificationHaloRunV1alpha1NotifierDescriptor( + name: string, + notifierDescriptor?: NotifierDescriptor, + options?: AxiosRequestConfig + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.updatenotificationHaloRunV1alpha1NotifierDescriptor( + name, + notifierDescriptor, + options + ); + return createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + ); + }, + }; +}; + +/** + * NotificationHaloRunV1alpha1NotifierDescriptorApi - factory interface + * @export + */ +export const NotificationHaloRunV1alpha1NotifierDescriptorApiFactory = + function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance + ) { + const localVarFp = + NotificationHaloRunV1alpha1NotifierDescriptorApiFp(configuration); + return { + /** + * Create notification.halo.run/v1alpha1/NotifierDescriptor + * @param {NotificationHaloRunV1alpha1NotifierDescriptorApiCreatenotificationHaloRunV1alpha1NotifierDescriptorRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createnotificationHaloRunV1alpha1NotifierDescriptor( + requestParameters: NotificationHaloRunV1alpha1NotifierDescriptorApiCreatenotificationHaloRunV1alpha1NotifierDescriptorRequest = {}, + options?: AxiosRequestConfig + ): AxiosPromise { + return localVarFp + .createnotificationHaloRunV1alpha1NotifierDescriptor( + requestParameters.notifierDescriptor, + options + ) + .then((request) => request(axios, basePath)); + }, + /** + * Delete notification.halo.run/v1alpha1/NotifierDescriptor + * @param {NotificationHaloRunV1alpha1NotifierDescriptorApiDeletenotificationHaloRunV1alpha1NotifierDescriptorRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deletenotificationHaloRunV1alpha1NotifierDescriptor( + requestParameters: NotificationHaloRunV1alpha1NotifierDescriptorApiDeletenotificationHaloRunV1alpha1NotifierDescriptorRequest, + options?: AxiosRequestConfig + ): AxiosPromise { + return localVarFp + .deletenotificationHaloRunV1alpha1NotifierDescriptor( + requestParameters.name, + options + ) + .then((request) => request(axios, basePath)); + }, + /** + * Get notification.halo.run/v1alpha1/NotifierDescriptor + * @param {NotificationHaloRunV1alpha1NotifierDescriptorApiGetnotificationHaloRunV1alpha1NotifierDescriptorRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getnotificationHaloRunV1alpha1NotifierDescriptor( + requestParameters: NotificationHaloRunV1alpha1NotifierDescriptorApiGetnotificationHaloRunV1alpha1NotifierDescriptorRequest, + options?: AxiosRequestConfig + ): AxiosPromise { + return localVarFp + .getnotificationHaloRunV1alpha1NotifierDescriptor( + requestParameters.name, + options + ) + .then((request) => request(axios, basePath)); + }, + /** + * List notification.halo.run/v1alpha1/NotifierDescriptor + * @param {NotificationHaloRunV1alpha1NotifierDescriptorApiListnotificationHaloRunV1alpha1NotifierDescriptorRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listnotificationHaloRunV1alpha1NotifierDescriptor( + requestParameters: NotificationHaloRunV1alpha1NotifierDescriptorApiListnotificationHaloRunV1alpha1NotifierDescriptorRequest = {}, + options?: AxiosRequestConfig + ): AxiosPromise { + return localVarFp + .listnotificationHaloRunV1alpha1NotifierDescriptor( + requestParameters.fieldSelector, + requestParameters.labelSelector, + requestParameters.page, + requestParameters.size, + requestParameters.sort, + options + ) + .then((request) => request(axios, basePath)); + }, + /** + * Update notification.halo.run/v1alpha1/NotifierDescriptor + * @param {NotificationHaloRunV1alpha1NotifierDescriptorApiUpdatenotificationHaloRunV1alpha1NotifierDescriptorRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updatenotificationHaloRunV1alpha1NotifierDescriptor( + requestParameters: NotificationHaloRunV1alpha1NotifierDescriptorApiUpdatenotificationHaloRunV1alpha1NotifierDescriptorRequest, + options?: AxiosRequestConfig + ): AxiosPromise { + return localVarFp + .updatenotificationHaloRunV1alpha1NotifierDescriptor( + requestParameters.name, + requestParameters.notifierDescriptor, + options + ) + .then((request) => request(axios, basePath)); + }, + }; + }; + +/** + * Request parameters for createnotificationHaloRunV1alpha1NotifierDescriptor operation in NotificationHaloRunV1alpha1NotifierDescriptorApi. + * @export + * @interface NotificationHaloRunV1alpha1NotifierDescriptorApiCreatenotificationHaloRunV1alpha1NotifierDescriptorRequest + */ +export interface NotificationHaloRunV1alpha1NotifierDescriptorApiCreatenotificationHaloRunV1alpha1NotifierDescriptorRequest { + /** + * Fresh notifierDescriptor + * @type {NotifierDescriptor} + * @memberof NotificationHaloRunV1alpha1NotifierDescriptorApiCreatenotificationHaloRunV1alpha1NotifierDescriptor + */ + readonly notifierDescriptor?: NotifierDescriptor; +} + +/** + * Request parameters for deletenotificationHaloRunV1alpha1NotifierDescriptor operation in NotificationHaloRunV1alpha1NotifierDescriptorApi. + * @export + * @interface NotificationHaloRunV1alpha1NotifierDescriptorApiDeletenotificationHaloRunV1alpha1NotifierDescriptorRequest + */ +export interface NotificationHaloRunV1alpha1NotifierDescriptorApiDeletenotificationHaloRunV1alpha1NotifierDescriptorRequest { + /** + * Name of notifierDescriptor + * @type {string} + * @memberof NotificationHaloRunV1alpha1NotifierDescriptorApiDeletenotificationHaloRunV1alpha1NotifierDescriptor + */ + readonly name: string; +} + +/** + * Request parameters for getnotificationHaloRunV1alpha1NotifierDescriptor operation in NotificationHaloRunV1alpha1NotifierDescriptorApi. + * @export + * @interface NotificationHaloRunV1alpha1NotifierDescriptorApiGetnotificationHaloRunV1alpha1NotifierDescriptorRequest + */ +export interface NotificationHaloRunV1alpha1NotifierDescriptorApiGetnotificationHaloRunV1alpha1NotifierDescriptorRequest { + /** + * Name of notifierDescriptor + * @type {string} + * @memberof NotificationHaloRunV1alpha1NotifierDescriptorApiGetnotificationHaloRunV1alpha1NotifierDescriptor + */ + readonly name: string; +} + +/** + * Request parameters for listnotificationHaloRunV1alpha1NotifierDescriptor operation in NotificationHaloRunV1alpha1NotifierDescriptorApi. + * @export + * @interface NotificationHaloRunV1alpha1NotifierDescriptorApiListnotificationHaloRunV1alpha1NotifierDescriptorRequest + */ +export interface NotificationHaloRunV1alpha1NotifierDescriptorApiListnotificationHaloRunV1alpha1NotifierDescriptorRequest { + /** + * Field selector for filtering. + * @type {Array} + * @memberof NotificationHaloRunV1alpha1NotifierDescriptorApiListnotificationHaloRunV1alpha1NotifierDescriptor + */ + readonly fieldSelector?: Array; + + /** + * Label selector for filtering. + * @type {Array} + * @memberof NotificationHaloRunV1alpha1NotifierDescriptorApiListnotificationHaloRunV1alpha1NotifierDescriptor + */ + readonly labelSelector?: Array; + + /** + * The page number. Zero indicates no page. + * @type {number} + * @memberof NotificationHaloRunV1alpha1NotifierDescriptorApiListnotificationHaloRunV1alpha1NotifierDescriptor + */ + readonly page?: number; + + /** + * Size of one page. Zero indicates no limit. + * @type {number} + * @memberof NotificationHaloRunV1alpha1NotifierDescriptorApiListnotificationHaloRunV1alpha1NotifierDescriptor + */ + readonly size?: number; + + /** + * Sort property and direction of the list result. Support sorting based on attribute name path. + * @type {Array} + * @memberof NotificationHaloRunV1alpha1NotifierDescriptorApiListnotificationHaloRunV1alpha1NotifierDescriptor + */ + readonly sort?: Array; +} + +/** + * Request parameters for updatenotificationHaloRunV1alpha1NotifierDescriptor operation in NotificationHaloRunV1alpha1NotifierDescriptorApi. + * @export + * @interface NotificationHaloRunV1alpha1NotifierDescriptorApiUpdatenotificationHaloRunV1alpha1NotifierDescriptorRequest + */ +export interface NotificationHaloRunV1alpha1NotifierDescriptorApiUpdatenotificationHaloRunV1alpha1NotifierDescriptorRequest { + /** + * Name of notifierDescriptor + * @type {string} + * @memberof NotificationHaloRunV1alpha1NotifierDescriptorApiUpdatenotificationHaloRunV1alpha1NotifierDescriptor + */ + readonly name: string; + + /** + * Updated notifierDescriptor + * @type {NotifierDescriptor} + * @memberof NotificationHaloRunV1alpha1NotifierDescriptorApiUpdatenotificationHaloRunV1alpha1NotifierDescriptor + */ + readonly notifierDescriptor?: NotifierDescriptor; +} + +/** + * NotificationHaloRunV1alpha1NotifierDescriptorApi - object-oriented interface + * @export + * @class NotificationHaloRunV1alpha1NotifierDescriptorApi + * @extends {BaseAPI} + */ +export class NotificationHaloRunV1alpha1NotifierDescriptorApi extends BaseAPI { + /** + * Create notification.halo.run/v1alpha1/NotifierDescriptor + * @param {NotificationHaloRunV1alpha1NotifierDescriptorApiCreatenotificationHaloRunV1alpha1NotifierDescriptorRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof NotificationHaloRunV1alpha1NotifierDescriptorApi + */ + public createnotificationHaloRunV1alpha1NotifierDescriptor( + requestParameters: NotificationHaloRunV1alpha1NotifierDescriptorApiCreatenotificationHaloRunV1alpha1NotifierDescriptorRequest = {}, + options?: AxiosRequestConfig + ) { + return NotificationHaloRunV1alpha1NotifierDescriptorApiFp( + this.configuration + ) + .createnotificationHaloRunV1alpha1NotifierDescriptor( + requestParameters.notifierDescriptor, + options + ) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Delete notification.halo.run/v1alpha1/NotifierDescriptor + * @param {NotificationHaloRunV1alpha1NotifierDescriptorApiDeletenotificationHaloRunV1alpha1NotifierDescriptorRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof NotificationHaloRunV1alpha1NotifierDescriptorApi + */ + public deletenotificationHaloRunV1alpha1NotifierDescriptor( + requestParameters: NotificationHaloRunV1alpha1NotifierDescriptorApiDeletenotificationHaloRunV1alpha1NotifierDescriptorRequest, + options?: AxiosRequestConfig + ) { + return NotificationHaloRunV1alpha1NotifierDescriptorApiFp( + this.configuration + ) + .deletenotificationHaloRunV1alpha1NotifierDescriptor( + requestParameters.name, + options + ) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Get notification.halo.run/v1alpha1/NotifierDescriptor + * @param {NotificationHaloRunV1alpha1NotifierDescriptorApiGetnotificationHaloRunV1alpha1NotifierDescriptorRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof NotificationHaloRunV1alpha1NotifierDescriptorApi + */ + public getnotificationHaloRunV1alpha1NotifierDescriptor( + requestParameters: NotificationHaloRunV1alpha1NotifierDescriptorApiGetnotificationHaloRunV1alpha1NotifierDescriptorRequest, + options?: AxiosRequestConfig + ) { + return NotificationHaloRunV1alpha1NotifierDescriptorApiFp( + this.configuration + ) + .getnotificationHaloRunV1alpha1NotifierDescriptor( + requestParameters.name, + options + ) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * List notification.halo.run/v1alpha1/NotifierDescriptor + * @param {NotificationHaloRunV1alpha1NotifierDescriptorApiListnotificationHaloRunV1alpha1NotifierDescriptorRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof NotificationHaloRunV1alpha1NotifierDescriptorApi + */ + public listnotificationHaloRunV1alpha1NotifierDescriptor( + requestParameters: NotificationHaloRunV1alpha1NotifierDescriptorApiListnotificationHaloRunV1alpha1NotifierDescriptorRequest = {}, + options?: AxiosRequestConfig + ) { + return NotificationHaloRunV1alpha1NotifierDescriptorApiFp( + this.configuration + ) + .listnotificationHaloRunV1alpha1NotifierDescriptor( + requestParameters.fieldSelector, + requestParameters.labelSelector, + requestParameters.page, + requestParameters.size, + requestParameters.sort, + options + ) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Update notification.halo.run/v1alpha1/NotifierDescriptor + * @param {NotificationHaloRunV1alpha1NotifierDescriptorApiUpdatenotificationHaloRunV1alpha1NotifierDescriptorRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof NotificationHaloRunV1alpha1NotifierDescriptorApi + */ + public updatenotificationHaloRunV1alpha1NotifierDescriptor( + requestParameters: NotificationHaloRunV1alpha1NotifierDescriptorApiUpdatenotificationHaloRunV1alpha1NotifierDescriptorRequest, + options?: AxiosRequestConfig + ) { + return NotificationHaloRunV1alpha1NotifierDescriptorApiFp( + this.configuration + ) + .updatenotificationHaloRunV1alpha1NotifierDescriptor( + requestParameters.name, + requestParameters.notifierDescriptor, + options + ) + .then((request) => request(this.axios, this.basePath)); + } +} diff --git a/console/packages/api-client/src/api/notification-halo-run-v1alpha1-reason-api.ts b/console/packages/api-client/src/api/notification-halo-run-v1alpha1-reason-api.ts new file mode 100644 index 0000000000..67bd4b2025 --- /dev/null +++ b/console/packages/api-client/src/api/notification-halo-run-v1alpha1-reason-api.ts @@ -0,0 +1,819 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Halo Next API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.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 { Configuration } from "../configuration"; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from "axios"; +import globalAxios from "axios"; +// Some imports not used depending on template conditions +// @ts-ignore +import { + DUMMY_BASE_URL, + assertParamExists, + setApiKeyToObject, + setBasicAuthToObject, + setBearerAuthToObject, + setOAuthToObject, + setSearchParams, + serializeDataIfNeeded, + toPathString, + createRequestFunction, +} from "../common"; +// @ts-ignore +import { + BASE_PATH, + COLLECTION_FORMATS, + RequestArgs, + BaseAPI, + RequiredError, +} from "../base"; +// @ts-ignore +import { Reason } from "../models"; +// @ts-ignore +import { ReasonList } from "../models"; +/** + * NotificationHaloRunV1alpha1ReasonApi - axios parameter creator + * @export + */ +export const NotificationHaloRunV1alpha1ReasonApiAxiosParamCreator = function ( + configuration?: Configuration +) { + return { + /** + * Create notification.halo.run/v1alpha1/Reason + * @param {Reason} [reason] Fresh reason + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createnotificationHaloRunV1alpha1Reason: async ( + reason?: Reason, + options: AxiosRequestConfig = {} + ): Promise => { + const localVarPath = `/apis/notification.halo.run/v1alpha1/reasons`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: "POST", + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication BasicAuth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + // authentication BearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration); + + localVarHeaderParameter["Content-Type"] = "application/json"; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + localVarRequestOptions.data = serializeDataIfNeeded( + reason, + localVarRequestOptions, + configuration + ); + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Delete notification.halo.run/v1alpha1/Reason + * @param {string} name Name of reason + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deletenotificationHaloRunV1alpha1Reason: async ( + name: string, + options: AxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'name' is not null or undefined + assertParamExists( + "deletenotificationHaloRunV1alpha1Reason", + "name", + name + ); + const localVarPath = + `/apis/notification.halo.run/v1alpha1/reasons/{name}`.replace( + `{${"name"}}`, + encodeURIComponent(String(name)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: "DELETE", + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication BasicAuth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + // authentication BearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration); + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Get notification.halo.run/v1alpha1/Reason + * @param {string} name Name of reason + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getnotificationHaloRunV1alpha1Reason: async ( + name: string, + options: AxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'name' is not null or undefined + assertParamExists("getnotificationHaloRunV1alpha1Reason", "name", name); + const localVarPath = + `/apis/notification.halo.run/v1alpha1/reasons/{name}`.replace( + `{${"name"}}`, + encodeURIComponent(String(name)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication BasicAuth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + // authentication BearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration); + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * List notification.halo.run/v1alpha1/Reason + * @param {Array} [fieldSelector] Field selector for filtering. + * @param {Array} [labelSelector] Label selector for filtering. + * @param {number} [page] The page number. Zero indicates no page. + * @param {number} [size] Size of one page. Zero indicates no limit. + * @param {Array} [sort] Sort property and direction of the list result. Support sorting based on attribute name path. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listnotificationHaloRunV1alpha1Reason: async ( + fieldSelector?: Array, + labelSelector?: Array, + page?: number, + size?: number, + sort?: Array, + options: AxiosRequestConfig = {} + ): Promise => { + const localVarPath = `/apis/notification.halo.run/v1alpha1/reasons`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication BasicAuth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + // authentication BearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration); + + if (fieldSelector) { + localVarQueryParameter["fieldSelector"] = fieldSelector; + } + + if (labelSelector) { + localVarQueryParameter["labelSelector"] = labelSelector; + } + + if (page !== undefined) { + localVarQueryParameter["page"] = page; + } + + if (size !== undefined) { + localVarQueryParameter["size"] = size; + } + + if (sort) { + localVarQueryParameter["sort"] = Array.from(sort); + } + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Update notification.halo.run/v1alpha1/Reason + * @param {string} name Name of reason + * @param {Reason} [reason] Updated reason + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updatenotificationHaloRunV1alpha1Reason: async ( + name: string, + reason?: Reason, + options: AxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'name' is not null or undefined + assertParamExists( + "updatenotificationHaloRunV1alpha1Reason", + "name", + name + ); + const localVarPath = + `/apis/notification.halo.run/v1alpha1/reasons/{name}`.replace( + `{${"name"}}`, + encodeURIComponent(String(name)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: "PUT", + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication BasicAuth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + // authentication BearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration); + + localVarHeaderParameter["Content-Type"] = "application/json"; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + localVarRequestOptions.data = serializeDataIfNeeded( + reason, + localVarRequestOptions, + configuration + ); + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; +}; + +/** + * NotificationHaloRunV1alpha1ReasonApi - functional programming interface + * @export + */ +export const NotificationHaloRunV1alpha1ReasonApiFp = function ( + configuration?: Configuration +) { + const localVarAxiosParamCreator = + NotificationHaloRunV1alpha1ReasonApiAxiosParamCreator(configuration); + return { + /** + * Create notification.halo.run/v1alpha1/Reason + * @param {Reason} [reason] Fresh reason + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createnotificationHaloRunV1alpha1Reason( + reason?: Reason, + options?: AxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.createnotificationHaloRunV1alpha1Reason( + reason, + options + ); + return createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + ); + }, + /** + * Delete notification.halo.run/v1alpha1/Reason + * @param {string} name Name of reason + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deletenotificationHaloRunV1alpha1Reason( + name: string, + options?: AxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.deletenotificationHaloRunV1alpha1Reason( + name, + options + ); + return createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + ); + }, + /** + * Get notification.halo.run/v1alpha1/Reason + * @param {string} name Name of reason + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getnotificationHaloRunV1alpha1Reason( + name: string, + options?: AxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.getnotificationHaloRunV1alpha1Reason( + name, + options + ); + return createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + ); + }, + /** + * List notification.halo.run/v1alpha1/Reason + * @param {Array} [fieldSelector] Field selector for filtering. + * @param {Array} [labelSelector] Label selector for filtering. + * @param {number} [page] The page number. Zero indicates no page. + * @param {number} [size] Size of one page. Zero indicates no limit. + * @param {Array} [sort] Sort property and direction of the list result. Support sorting based on attribute name path. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listnotificationHaloRunV1alpha1Reason( + fieldSelector?: Array, + labelSelector?: Array, + page?: number, + size?: number, + sort?: Array, + options?: AxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.listnotificationHaloRunV1alpha1Reason( + fieldSelector, + labelSelector, + page, + size, + sort, + options + ); + return createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + ); + }, + /** + * Update notification.halo.run/v1alpha1/Reason + * @param {string} name Name of reason + * @param {Reason} [reason] Updated reason + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async updatenotificationHaloRunV1alpha1Reason( + name: string, + reason?: Reason, + options?: AxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.updatenotificationHaloRunV1alpha1Reason( + name, + reason, + options + ); + return createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + ); + }, + }; +}; + +/** + * NotificationHaloRunV1alpha1ReasonApi - factory interface + * @export + */ +export const NotificationHaloRunV1alpha1ReasonApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance +) { + const localVarFp = NotificationHaloRunV1alpha1ReasonApiFp(configuration); + return { + /** + * Create notification.halo.run/v1alpha1/Reason + * @param {NotificationHaloRunV1alpha1ReasonApiCreatenotificationHaloRunV1alpha1ReasonRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createnotificationHaloRunV1alpha1Reason( + requestParameters: NotificationHaloRunV1alpha1ReasonApiCreatenotificationHaloRunV1alpha1ReasonRequest = {}, + options?: AxiosRequestConfig + ): AxiosPromise { + return localVarFp + .createnotificationHaloRunV1alpha1Reason( + requestParameters.reason, + options + ) + .then((request) => request(axios, basePath)); + }, + /** + * Delete notification.halo.run/v1alpha1/Reason + * @param {NotificationHaloRunV1alpha1ReasonApiDeletenotificationHaloRunV1alpha1ReasonRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deletenotificationHaloRunV1alpha1Reason( + requestParameters: NotificationHaloRunV1alpha1ReasonApiDeletenotificationHaloRunV1alpha1ReasonRequest, + options?: AxiosRequestConfig + ): AxiosPromise { + return localVarFp + .deletenotificationHaloRunV1alpha1Reason( + requestParameters.name, + options + ) + .then((request) => request(axios, basePath)); + }, + /** + * Get notification.halo.run/v1alpha1/Reason + * @param {NotificationHaloRunV1alpha1ReasonApiGetnotificationHaloRunV1alpha1ReasonRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getnotificationHaloRunV1alpha1Reason( + requestParameters: NotificationHaloRunV1alpha1ReasonApiGetnotificationHaloRunV1alpha1ReasonRequest, + options?: AxiosRequestConfig + ): AxiosPromise { + return localVarFp + .getnotificationHaloRunV1alpha1Reason(requestParameters.name, options) + .then((request) => request(axios, basePath)); + }, + /** + * List notification.halo.run/v1alpha1/Reason + * @param {NotificationHaloRunV1alpha1ReasonApiListnotificationHaloRunV1alpha1ReasonRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listnotificationHaloRunV1alpha1Reason( + requestParameters: NotificationHaloRunV1alpha1ReasonApiListnotificationHaloRunV1alpha1ReasonRequest = {}, + options?: AxiosRequestConfig + ): AxiosPromise { + return localVarFp + .listnotificationHaloRunV1alpha1Reason( + requestParameters.fieldSelector, + requestParameters.labelSelector, + requestParameters.page, + requestParameters.size, + requestParameters.sort, + options + ) + .then((request) => request(axios, basePath)); + }, + /** + * Update notification.halo.run/v1alpha1/Reason + * @param {NotificationHaloRunV1alpha1ReasonApiUpdatenotificationHaloRunV1alpha1ReasonRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updatenotificationHaloRunV1alpha1Reason( + requestParameters: NotificationHaloRunV1alpha1ReasonApiUpdatenotificationHaloRunV1alpha1ReasonRequest, + options?: AxiosRequestConfig + ): AxiosPromise { + return localVarFp + .updatenotificationHaloRunV1alpha1Reason( + requestParameters.name, + requestParameters.reason, + options + ) + .then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * Request parameters for createnotificationHaloRunV1alpha1Reason operation in NotificationHaloRunV1alpha1ReasonApi. + * @export + * @interface NotificationHaloRunV1alpha1ReasonApiCreatenotificationHaloRunV1alpha1ReasonRequest + */ +export interface NotificationHaloRunV1alpha1ReasonApiCreatenotificationHaloRunV1alpha1ReasonRequest { + /** + * Fresh reason + * @type {Reason} + * @memberof NotificationHaloRunV1alpha1ReasonApiCreatenotificationHaloRunV1alpha1Reason + */ + readonly reason?: Reason; +} + +/** + * Request parameters for deletenotificationHaloRunV1alpha1Reason operation in NotificationHaloRunV1alpha1ReasonApi. + * @export + * @interface NotificationHaloRunV1alpha1ReasonApiDeletenotificationHaloRunV1alpha1ReasonRequest + */ +export interface NotificationHaloRunV1alpha1ReasonApiDeletenotificationHaloRunV1alpha1ReasonRequest { + /** + * Name of reason + * @type {string} + * @memberof NotificationHaloRunV1alpha1ReasonApiDeletenotificationHaloRunV1alpha1Reason + */ + readonly name: string; +} + +/** + * Request parameters for getnotificationHaloRunV1alpha1Reason operation in NotificationHaloRunV1alpha1ReasonApi. + * @export + * @interface NotificationHaloRunV1alpha1ReasonApiGetnotificationHaloRunV1alpha1ReasonRequest + */ +export interface NotificationHaloRunV1alpha1ReasonApiGetnotificationHaloRunV1alpha1ReasonRequest { + /** + * Name of reason + * @type {string} + * @memberof NotificationHaloRunV1alpha1ReasonApiGetnotificationHaloRunV1alpha1Reason + */ + readonly name: string; +} + +/** + * Request parameters for listnotificationHaloRunV1alpha1Reason operation in NotificationHaloRunV1alpha1ReasonApi. + * @export + * @interface NotificationHaloRunV1alpha1ReasonApiListnotificationHaloRunV1alpha1ReasonRequest + */ +export interface NotificationHaloRunV1alpha1ReasonApiListnotificationHaloRunV1alpha1ReasonRequest { + /** + * Field selector for filtering. + * @type {Array} + * @memberof NotificationHaloRunV1alpha1ReasonApiListnotificationHaloRunV1alpha1Reason + */ + readonly fieldSelector?: Array; + + /** + * Label selector for filtering. + * @type {Array} + * @memberof NotificationHaloRunV1alpha1ReasonApiListnotificationHaloRunV1alpha1Reason + */ + readonly labelSelector?: Array; + + /** + * The page number. Zero indicates no page. + * @type {number} + * @memberof NotificationHaloRunV1alpha1ReasonApiListnotificationHaloRunV1alpha1Reason + */ + readonly page?: number; + + /** + * Size of one page. Zero indicates no limit. + * @type {number} + * @memberof NotificationHaloRunV1alpha1ReasonApiListnotificationHaloRunV1alpha1Reason + */ + readonly size?: number; + + /** + * Sort property and direction of the list result. Support sorting based on attribute name path. + * @type {Array} + * @memberof NotificationHaloRunV1alpha1ReasonApiListnotificationHaloRunV1alpha1Reason + */ + readonly sort?: Array; +} + +/** + * Request parameters for updatenotificationHaloRunV1alpha1Reason operation in NotificationHaloRunV1alpha1ReasonApi. + * @export + * @interface NotificationHaloRunV1alpha1ReasonApiUpdatenotificationHaloRunV1alpha1ReasonRequest + */ +export interface NotificationHaloRunV1alpha1ReasonApiUpdatenotificationHaloRunV1alpha1ReasonRequest { + /** + * Name of reason + * @type {string} + * @memberof NotificationHaloRunV1alpha1ReasonApiUpdatenotificationHaloRunV1alpha1Reason + */ + readonly name: string; + + /** + * Updated reason + * @type {Reason} + * @memberof NotificationHaloRunV1alpha1ReasonApiUpdatenotificationHaloRunV1alpha1Reason + */ + readonly reason?: Reason; +} + +/** + * NotificationHaloRunV1alpha1ReasonApi - object-oriented interface + * @export + * @class NotificationHaloRunV1alpha1ReasonApi + * @extends {BaseAPI} + */ +export class NotificationHaloRunV1alpha1ReasonApi extends BaseAPI { + /** + * Create notification.halo.run/v1alpha1/Reason + * @param {NotificationHaloRunV1alpha1ReasonApiCreatenotificationHaloRunV1alpha1ReasonRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof NotificationHaloRunV1alpha1ReasonApi + */ + public createnotificationHaloRunV1alpha1Reason( + requestParameters: NotificationHaloRunV1alpha1ReasonApiCreatenotificationHaloRunV1alpha1ReasonRequest = {}, + options?: AxiosRequestConfig + ) { + return NotificationHaloRunV1alpha1ReasonApiFp(this.configuration) + .createnotificationHaloRunV1alpha1Reason( + requestParameters.reason, + options + ) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Delete notification.halo.run/v1alpha1/Reason + * @param {NotificationHaloRunV1alpha1ReasonApiDeletenotificationHaloRunV1alpha1ReasonRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof NotificationHaloRunV1alpha1ReasonApi + */ + public deletenotificationHaloRunV1alpha1Reason( + requestParameters: NotificationHaloRunV1alpha1ReasonApiDeletenotificationHaloRunV1alpha1ReasonRequest, + options?: AxiosRequestConfig + ) { + return NotificationHaloRunV1alpha1ReasonApiFp(this.configuration) + .deletenotificationHaloRunV1alpha1Reason(requestParameters.name, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Get notification.halo.run/v1alpha1/Reason + * @param {NotificationHaloRunV1alpha1ReasonApiGetnotificationHaloRunV1alpha1ReasonRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof NotificationHaloRunV1alpha1ReasonApi + */ + public getnotificationHaloRunV1alpha1Reason( + requestParameters: NotificationHaloRunV1alpha1ReasonApiGetnotificationHaloRunV1alpha1ReasonRequest, + options?: AxiosRequestConfig + ) { + return NotificationHaloRunV1alpha1ReasonApiFp(this.configuration) + .getnotificationHaloRunV1alpha1Reason(requestParameters.name, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * List notification.halo.run/v1alpha1/Reason + * @param {NotificationHaloRunV1alpha1ReasonApiListnotificationHaloRunV1alpha1ReasonRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof NotificationHaloRunV1alpha1ReasonApi + */ + public listnotificationHaloRunV1alpha1Reason( + requestParameters: NotificationHaloRunV1alpha1ReasonApiListnotificationHaloRunV1alpha1ReasonRequest = {}, + options?: AxiosRequestConfig + ) { + return NotificationHaloRunV1alpha1ReasonApiFp(this.configuration) + .listnotificationHaloRunV1alpha1Reason( + requestParameters.fieldSelector, + requestParameters.labelSelector, + requestParameters.page, + requestParameters.size, + requestParameters.sort, + options + ) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Update notification.halo.run/v1alpha1/Reason + * @param {NotificationHaloRunV1alpha1ReasonApiUpdatenotificationHaloRunV1alpha1ReasonRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof NotificationHaloRunV1alpha1ReasonApi + */ + public updatenotificationHaloRunV1alpha1Reason( + requestParameters: NotificationHaloRunV1alpha1ReasonApiUpdatenotificationHaloRunV1alpha1ReasonRequest, + options?: AxiosRequestConfig + ) { + return NotificationHaloRunV1alpha1ReasonApiFp(this.configuration) + .updatenotificationHaloRunV1alpha1Reason( + requestParameters.name, + requestParameters.reason, + options + ) + .then((request) => request(this.axios, this.basePath)); + } +} diff --git a/console/packages/api-client/src/api/notification-halo-run-v1alpha1-reason-type-api.ts b/console/packages/api-client/src/api/notification-halo-run-v1alpha1-reason-type-api.ts new file mode 100644 index 0000000000..395fcb8dbf --- /dev/null +++ b/console/packages/api-client/src/api/notification-halo-run-v1alpha1-reason-type-api.ts @@ -0,0 +1,828 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Halo Next API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.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 { Configuration } from "../configuration"; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from "axios"; +import globalAxios from "axios"; +// Some imports not used depending on template conditions +// @ts-ignore +import { + DUMMY_BASE_URL, + assertParamExists, + setApiKeyToObject, + setBasicAuthToObject, + setBearerAuthToObject, + setOAuthToObject, + setSearchParams, + serializeDataIfNeeded, + toPathString, + createRequestFunction, +} from "../common"; +// @ts-ignore +import { + BASE_PATH, + COLLECTION_FORMATS, + RequestArgs, + BaseAPI, + RequiredError, +} from "../base"; +// @ts-ignore +import { ReasonType } from "../models"; +// @ts-ignore +import { ReasonTypeList } from "../models"; +/** + * NotificationHaloRunV1alpha1ReasonTypeApi - axios parameter creator + * @export + */ +export const NotificationHaloRunV1alpha1ReasonTypeApiAxiosParamCreator = + function (configuration?: Configuration) { + return { + /** + * Create notification.halo.run/v1alpha1/ReasonType + * @param {ReasonType} [reasonType] Fresh reasontype + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createnotificationHaloRunV1alpha1ReasonType: async ( + reasonType?: ReasonType, + options: AxiosRequestConfig = {} + ): Promise => { + const localVarPath = `/apis/notification.halo.run/v1alpha1/reasontypes`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: "POST", + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication BasicAuth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + // authentication BearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration); + + localVarHeaderParameter["Content-Type"] = "application/json"; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + localVarRequestOptions.data = serializeDataIfNeeded( + reasonType, + localVarRequestOptions, + configuration + ); + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Delete notification.halo.run/v1alpha1/ReasonType + * @param {string} name Name of reasontype + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deletenotificationHaloRunV1alpha1ReasonType: async ( + name: string, + options: AxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'name' is not null or undefined + assertParamExists( + "deletenotificationHaloRunV1alpha1ReasonType", + "name", + name + ); + const localVarPath = + `/apis/notification.halo.run/v1alpha1/reasontypes/{name}`.replace( + `{${"name"}}`, + encodeURIComponent(String(name)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: "DELETE", + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication BasicAuth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + // authentication BearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration); + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Get notification.halo.run/v1alpha1/ReasonType + * @param {string} name Name of reasontype + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getnotificationHaloRunV1alpha1ReasonType: async ( + name: string, + options: AxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'name' is not null or undefined + assertParamExists( + "getnotificationHaloRunV1alpha1ReasonType", + "name", + name + ); + const localVarPath = + `/apis/notification.halo.run/v1alpha1/reasontypes/{name}`.replace( + `{${"name"}}`, + encodeURIComponent(String(name)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication BasicAuth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + // authentication BearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration); + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * List notification.halo.run/v1alpha1/ReasonType + * @param {Array} [fieldSelector] Field selector for filtering. + * @param {Array} [labelSelector] Label selector for filtering. + * @param {number} [page] The page number. Zero indicates no page. + * @param {number} [size] Size of one page. Zero indicates no limit. + * @param {Array} [sort] Sort property and direction of the list result. Support sorting based on attribute name path. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listnotificationHaloRunV1alpha1ReasonType: async ( + fieldSelector?: Array, + labelSelector?: Array, + page?: number, + size?: number, + sort?: Array, + options: AxiosRequestConfig = {} + ): Promise => { + const localVarPath = `/apis/notification.halo.run/v1alpha1/reasontypes`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication BasicAuth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + // authentication BearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration); + + if (fieldSelector) { + localVarQueryParameter["fieldSelector"] = fieldSelector; + } + + if (labelSelector) { + localVarQueryParameter["labelSelector"] = labelSelector; + } + + if (page !== undefined) { + localVarQueryParameter["page"] = page; + } + + if (size !== undefined) { + localVarQueryParameter["size"] = size; + } + + if (sort) { + localVarQueryParameter["sort"] = Array.from(sort); + } + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Update notification.halo.run/v1alpha1/ReasonType + * @param {string} name Name of reasontype + * @param {ReasonType} [reasonType] Updated reasontype + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updatenotificationHaloRunV1alpha1ReasonType: async ( + name: string, + reasonType?: ReasonType, + options: AxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'name' is not null or undefined + assertParamExists( + "updatenotificationHaloRunV1alpha1ReasonType", + "name", + name + ); + const localVarPath = + `/apis/notification.halo.run/v1alpha1/reasontypes/{name}`.replace( + `{${"name"}}`, + encodeURIComponent(String(name)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: "PUT", + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication BasicAuth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + // authentication BearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration); + + localVarHeaderParameter["Content-Type"] = "application/json"; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + localVarRequestOptions.data = serializeDataIfNeeded( + reasonType, + localVarRequestOptions, + configuration + ); + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; + }; + +/** + * NotificationHaloRunV1alpha1ReasonTypeApi - functional programming interface + * @export + */ +export const NotificationHaloRunV1alpha1ReasonTypeApiFp = function ( + configuration?: Configuration +) { + const localVarAxiosParamCreator = + NotificationHaloRunV1alpha1ReasonTypeApiAxiosParamCreator(configuration); + return { + /** + * Create notification.halo.run/v1alpha1/ReasonType + * @param {ReasonType} [reasonType] Fresh reasontype + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createnotificationHaloRunV1alpha1ReasonType( + reasonType?: ReasonType, + options?: AxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.createnotificationHaloRunV1alpha1ReasonType( + reasonType, + options + ); + return createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + ); + }, + /** + * Delete notification.halo.run/v1alpha1/ReasonType + * @param {string} name Name of reasontype + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deletenotificationHaloRunV1alpha1ReasonType( + name: string, + options?: AxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.deletenotificationHaloRunV1alpha1ReasonType( + name, + options + ); + return createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + ); + }, + /** + * Get notification.halo.run/v1alpha1/ReasonType + * @param {string} name Name of reasontype + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getnotificationHaloRunV1alpha1ReasonType( + name: string, + options?: AxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.getnotificationHaloRunV1alpha1ReasonType( + name, + options + ); + return createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + ); + }, + /** + * List notification.halo.run/v1alpha1/ReasonType + * @param {Array} [fieldSelector] Field selector for filtering. + * @param {Array} [labelSelector] Label selector for filtering. + * @param {number} [page] The page number. Zero indicates no page. + * @param {number} [size] Size of one page. Zero indicates no limit. + * @param {Array} [sort] Sort property and direction of the list result. Support sorting based on attribute name path. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listnotificationHaloRunV1alpha1ReasonType( + fieldSelector?: Array, + labelSelector?: Array, + page?: number, + size?: number, + sort?: Array, + options?: AxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.listnotificationHaloRunV1alpha1ReasonType( + fieldSelector, + labelSelector, + page, + size, + sort, + options + ); + return createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + ); + }, + /** + * Update notification.halo.run/v1alpha1/ReasonType + * @param {string} name Name of reasontype + * @param {ReasonType} [reasonType] Updated reasontype + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async updatenotificationHaloRunV1alpha1ReasonType( + name: string, + reasonType?: ReasonType, + options?: AxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.updatenotificationHaloRunV1alpha1ReasonType( + name, + reasonType, + options + ); + return createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + ); + }, + }; +}; + +/** + * NotificationHaloRunV1alpha1ReasonTypeApi - factory interface + * @export + */ +export const NotificationHaloRunV1alpha1ReasonTypeApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance +) { + const localVarFp = NotificationHaloRunV1alpha1ReasonTypeApiFp(configuration); + return { + /** + * Create notification.halo.run/v1alpha1/ReasonType + * @param {NotificationHaloRunV1alpha1ReasonTypeApiCreatenotificationHaloRunV1alpha1ReasonTypeRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createnotificationHaloRunV1alpha1ReasonType( + requestParameters: NotificationHaloRunV1alpha1ReasonTypeApiCreatenotificationHaloRunV1alpha1ReasonTypeRequest = {}, + options?: AxiosRequestConfig + ): AxiosPromise { + return localVarFp + .createnotificationHaloRunV1alpha1ReasonType( + requestParameters.reasonType, + options + ) + .then((request) => request(axios, basePath)); + }, + /** + * Delete notification.halo.run/v1alpha1/ReasonType + * @param {NotificationHaloRunV1alpha1ReasonTypeApiDeletenotificationHaloRunV1alpha1ReasonTypeRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deletenotificationHaloRunV1alpha1ReasonType( + requestParameters: NotificationHaloRunV1alpha1ReasonTypeApiDeletenotificationHaloRunV1alpha1ReasonTypeRequest, + options?: AxiosRequestConfig + ): AxiosPromise { + return localVarFp + .deletenotificationHaloRunV1alpha1ReasonType( + requestParameters.name, + options + ) + .then((request) => request(axios, basePath)); + }, + /** + * Get notification.halo.run/v1alpha1/ReasonType + * @param {NotificationHaloRunV1alpha1ReasonTypeApiGetnotificationHaloRunV1alpha1ReasonTypeRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getnotificationHaloRunV1alpha1ReasonType( + requestParameters: NotificationHaloRunV1alpha1ReasonTypeApiGetnotificationHaloRunV1alpha1ReasonTypeRequest, + options?: AxiosRequestConfig + ): AxiosPromise { + return localVarFp + .getnotificationHaloRunV1alpha1ReasonType( + requestParameters.name, + options + ) + .then((request) => request(axios, basePath)); + }, + /** + * List notification.halo.run/v1alpha1/ReasonType + * @param {NotificationHaloRunV1alpha1ReasonTypeApiListnotificationHaloRunV1alpha1ReasonTypeRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listnotificationHaloRunV1alpha1ReasonType( + requestParameters: NotificationHaloRunV1alpha1ReasonTypeApiListnotificationHaloRunV1alpha1ReasonTypeRequest = {}, + options?: AxiosRequestConfig + ): AxiosPromise { + return localVarFp + .listnotificationHaloRunV1alpha1ReasonType( + requestParameters.fieldSelector, + requestParameters.labelSelector, + requestParameters.page, + requestParameters.size, + requestParameters.sort, + options + ) + .then((request) => request(axios, basePath)); + }, + /** + * Update notification.halo.run/v1alpha1/ReasonType + * @param {NotificationHaloRunV1alpha1ReasonTypeApiUpdatenotificationHaloRunV1alpha1ReasonTypeRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updatenotificationHaloRunV1alpha1ReasonType( + requestParameters: NotificationHaloRunV1alpha1ReasonTypeApiUpdatenotificationHaloRunV1alpha1ReasonTypeRequest, + options?: AxiosRequestConfig + ): AxiosPromise { + return localVarFp + .updatenotificationHaloRunV1alpha1ReasonType( + requestParameters.name, + requestParameters.reasonType, + options + ) + .then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * Request parameters for createnotificationHaloRunV1alpha1ReasonType operation in NotificationHaloRunV1alpha1ReasonTypeApi. + * @export + * @interface NotificationHaloRunV1alpha1ReasonTypeApiCreatenotificationHaloRunV1alpha1ReasonTypeRequest + */ +export interface NotificationHaloRunV1alpha1ReasonTypeApiCreatenotificationHaloRunV1alpha1ReasonTypeRequest { + /** + * Fresh reasontype + * @type {ReasonType} + * @memberof NotificationHaloRunV1alpha1ReasonTypeApiCreatenotificationHaloRunV1alpha1ReasonType + */ + readonly reasonType?: ReasonType; +} + +/** + * Request parameters for deletenotificationHaloRunV1alpha1ReasonType operation in NotificationHaloRunV1alpha1ReasonTypeApi. + * @export + * @interface NotificationHaloRunV1alpha1ReasonTypeApiDeletenotificationHaloRunV1alpha1ReasonTypeRequest + */ +export interface NotificationHaloRunV1alpha1ReasonTypeApiDeletenotificationHaloRunV1alpha1ReasonTypeRequest { + /** + * Name of reasontype + * @type {string} + * @memberof NotificationHaloRunV1alpha1ReasonTypeApiDeletenotificationHaloRunV1alpha1ReasonType + */ + readonly name: string; +} + +/** + * Request parameters for getnotificationHaloRunV1alpha1ReasonType operation in NotificationHaloRunV1alpha1ReasonTypeApi. + * @export + * @interface NotificationHaloRunV1alpha1ReasonTypeApiGetnotificationHaloRunV1alpha1ReasonTypeRequest + */ +export interface NotificationHaloRunV1alpha1ReasonTypeApiGetnotificationHaloRunV1alpha1ReasonTypeRequest { + /** + * Name of reasontype + * @type {string} + * @memberof NotificationHaloRunV1alpha1ReasonTypeApiGetnotificationHaloRunV1alpha1ReasonType + */ + readonly name: string; +} + +/** + * Request parameters for listnotificationHaloRunV1alpha1ReasonType operation in NotificationHaloRunV1alpha1ReasonTypeApi. + * @export + * @interface NotificationHaloRunV1alpha1ReasonTypeApiListnotificationHaloRunV1alpha1ReasonTypeRequest + */ +export interface NotificationHaloRunV1alpha1ReasonTypeApiListnotificationHaloRunV1alpha1ReasonTypeRequest { + /** + * Field selector for filtering. + * @type {Array} + * @memberof NotificationHaloRunV1alpha1ReasonTypeApiListnotificationHaloRunV1alpha1ReasonType + */ + readonly fieldSelector?: Array; + + /** + * Label selector for filtering. + * @type {Array} + * @memberof NotificationHaloRunV1alpha1ReasonTypeApiListnotificationHaloRunV1alpha1ReasonType + */ + readonly labelSelector?: Array; + + /** + * The page number. Zero indicates no page. + * @type {number} + * @memberof NotificationHaloRunV1alpha1ReasonTypeApiListnotificationHaloRunV1alpha1ReasonType + */ + readonly page?: number; + + /** + * Size of one page. Zero indicates no limit. + * @type {number} + * @memberof NotificationHaloRunV1alpha1ReasonTypeApiListnotificationHaloRunV1alpha1ReasonType + */ + readonly size?: number; + + /** + * Sort property and direction of the list result. Support sorting based on attribute name path. + * @type {Array} + * @memberof NotificationHaloRunV1alpha1ReasonTypeApiListnotificationHaloRunV1alpha1ReasonType + */ + readonly sort?: Array; +} + +/** + * Request parameters for updatenotificationHaloRunV1alpha1ReasonType operation in NotificationHaloRunV1alpha1ReasonTypeApi. + * @export + * @interface NotificationHaloRunV1alpha1ReasonTypeApiUpdatenotificationHaloRunV1alpha1ReasonTypeRequest + */ +export interface NotificationHaloRunV1alpha1ReasonTypeApiUpdatenotificationHaloRunV1alpha1ReasonTypeRequest { + /** + * Name of reasontype + * @type {string} + * @memberof NotificationHaloRunV1alpha1ReasonTypeApiUpdatenotificationHaloRunV1alpha1ReasonType + */ + readonly name: string; + + /** + * Updated reasontype + * @type {ReasonType} + * @memberof NotificationHaloRunV1alpha1ReasonTypeApiUpdatenotificationHaloRunV1alpha1ReasonType + */ + readonly reasonType?: ReasonType; +} + +/** + * NotificationHaloRunV1alpha1ReasonTypeApi - object-oriented interface + * @export + * @class NotificationHaloRunV1alpha1ReasonTypeApi + * @extends {BaseAPI} + */ +export class NotificationHaloRunV1alpha1ReasonTypeApi extends BaseAPI { + /** + * Create notification.halo.run/v1alpha1/ReasonType + * @param {NotificationHaloRunV1alpha1ReasonTypeApiCreatenotificationHaloRunV1alpha1ReasonTypeRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof NotificationHaloRunV1alpha1ReasonTypeApi + */ + public createnotificationHaloRunV1alpha1ReasonType( + requestParameters: NotificationHaloRunV1alpha1ReasonTypeApiCreatenotificationHaloRunV1alpha1ReasonTypeRequest = {}, + options?: AxiosRequestConfig + ) { + return NotificationHaloRunV1alpha1ReasonTypeApiFp(this.configuration) + .createnotificationHaloRunV1alpha1ReasonType( + requestParameters.reasonType, + options + ) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Delete notification.halo.run/v1alpha1/ReasonType + * @param {NotificationHaloRunV1alpha1ReasonTypeApiDeletenotificationHaloRunV1alpha1ReasonTypeRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof NotificationHaloRunV1alpha1ReasonTypeApi + */ + public deletenotificationHaloRunV1alpha1ReasonType( + requestParameters: NotificationHaloRunV1alpha1ReasonTypeApiDeletenotificationHaloRunV1alpha1ReasonTypeRequest, + options?: AxiosRequestConfig + ) { + return NotificationHaloRunV1alpha1ReasonTypeApiFp(this.configuration) + .deletenotificationHaloRunV1alpha1ReasonType( + requestParameters.name, + options + ) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Get notification.halo.run/v1alpha1/ReasonType + * @param {NotificationHaloRunV1alpha1ReasonTypeApiGetnotificationHaloRunV1alpha1ReasonTypeRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof NotificationHaloRunV1alpha1ReasonTypeApi + */ + public getnotificationHaloRunV1alpha1ReasonType( + requestParameters: NotificationHaloRunV1alpha1ReasonTypeApiGetnotificationHaloRunV1alpha1ReasonTypeRequest, + options?: AxiosRequestConfig + ) { + return NotificationHaloRunV1alpha1ReasonTypeApiFp(this.configuration) + .getnotificationHaloRunV1alpha1ReasonType(requestParameters.name, options) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * List notification.halo.run/v1alpha1/ReasonType + * @param {NotificationHaloRunV1alpha1ReasonTypeApiListnotificationHaloRunV1alpha1ReasonTypeRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof NotificationHaloRunV1alpha1ReasonTypeApi + */ + public listnotificationHaloRunV1alpha1ReasonType( + requestParameters: NotificationHaloRunV1alpha1ReasonTypeApiListnotificationHaloRunV1alpha1ReasonTypeRequest = {}, + options?: AxiosRequestConfig + ) { + return NotificationHaloRunV1alpha1ReasonTypeApiFp(this.configuration) + .listnotificationHaloRunV1alpha1ReasonType( + requestParameters.fieldSelector, + requestParameters.labelSelector, + requestParameters.page, + requestParameters.size, + requestParameters.sort, + options + ) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Update notification.halo.run/v1alpha1/ReasonType + * @param {NotificationHaloRunV1alpha1ReasonTypeApiUpdatenotificationHaloRunV1alpha1ReasonTypeRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof NotificationHaloRunV1alpha1ReasonTypeApi + */ + public updatenotificationHaloRunV1alpha1ReasonType( + requestParameters: NotificationHaloRunV1alpha1ReasonTypeApiUpdatenotificationHaloRunV1alpha1ReasonTypeRequest, + options?: AxiosRequestConfig + ) { + return NotificationHaloRunV1alpha1ReasonTypeApiFp(this.configuration) + .updatenotificationHaloRunV1alpha1ReasonType( + requestParameters.name, + requestParameters.reasonType, + options + ) + .then((request) => request(this.axios, this.basePath)); + } +} diff --git a/console/packages/api-client/src/api/notification-halo-run-v1alpha1-subscription-api.ts b/console/packages/api-client/src/api/notification-halo-run-v1alpha1-subscription-api.ts new file mode 100644 index 0000000000..35a082988c --- /dev/null +++ b/console/packages/api-client/src/api/notification-halo-run-v1alpha1-subscription-api.ts @@ -0,0 +1,835 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Halo Next API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.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 { Configuration } from "../configuration"; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from "axios"; +import globalAxios from "axios"; +// Some imports not used depending on template conditions +// @ts-ignore +import { + DUMMY_BASE_URL, + assertParamExists, + setApiKeyToObject, + setBasicAuthToObject, + setBearerAuthToObject, + setOAuthToObject, + setSearchParams, + serializeDataIfNeeded, + toPathString, + createRequestFunction, +} from "../common"; +// @ts-ignore +import { + BASE_PATH, + COLLECTION_FORMATS, + RequestArgs, + BaseAPI, + RequiredError, +} from "../base"; +// @ts-ignore +import { Subscription } from "../models"; +// @ts-ignore +import { SubscriptionList } from "../models"; +/** + * NotificationHaloRunV1alpha1SubscriptionApi - axios parameter creator + * @export + */ +export const NotificationHaloRunV1alpha1SubscriptionApiAxiosParamCreator = + function (configuration?: Configuration) { + return { + /** + * Create notification.halo.run/v1alpha1/Subscription + * @param {Subscription} [subscription] Fresh subscription + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createnotificationHaloRunV1alpha1Subscription: async ( + subscription?: Subscription, + options: AxiosRequestConfig = {} + ): Promise => { + const localVarPath = `/apis/notification.halo.run/v1alpha1/subscriptions`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: "POST", + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication BasicAuth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + // authentication BearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration); + + localVarHeaderParameter["Content-Type"] = "application/json"; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + localVarRequestOptions.data = serializeDataIfNeeded( + subscription, + localVarRequestOptions, + configuration + ); + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Delete notification.halo.run/v1alpha1/Subscription + * @param {string} name Name of subscription + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deletenotificationHaloRunV1alpha1Subscription: async ( + name: string, + options: AxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'name' is not null or undefined + assertParamExists( + "deletenotificationHaloRunV1alpha1Subscription", + "name", + name + ); + const localVarPath = + `/apis/notification.halo.run/v1alpha1/subscriptions/{name}`.replace( + `{${"name"}}`, + encodeURIComponent(String(name)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: "DELETE", + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication BasicAuth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + // authentication BearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration); + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Get notification.halo.run/v1alpha1/Subscription + * @param {string} name Name of subscription + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getnotificationHaloRunV1alpha1Subscription: async ( + name: string, + options: AxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'name' is not null or undefined + assertParamExists( + "getnotificationHaloRunV1alpha1Subscription", + "name", + name + ); + const localVarPath = + `/apis/notification.halo.run/v1alpha1/subscriptions/{name}`.replace( + `{${"name"}}`, + encodeURIComponent(String(name)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication BasicAuth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + // authentication BearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration); + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * List notification.halo.run/v1alpha1/Subscription + * @param {Array} [fieldSelector] Field selector for filtering. + * @param {Array} [labelSelector] Label selector for filtering. + * @param {number} [page] The page number. Zero indicates no page. + * @param {number} [size] Size of one page. Zero indicates no limit. + * @param {Array} [sort] Sort property and direction of the list result. Support sorting based on attribute name path. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listnotificationHaloRunV1alpha1Subscription: async ( + fieldSelector?: Array, + labelSelector?: Array, + page?: number, + size?: number, + sort?: Array, + options: AxiosRequestConfig = {} + ): Promise => { + const localVarPath = `/apis/notification.halo.run/v1alpha1/subscriptions`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: "GET", + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication BasicAuth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + // authentication BearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration); + + if (fieldSelector) { + localVarQueryParameter["fieldSelector"] = fieldSelector; + } + + if (labelSelector) { + localVarQueryParameter["labelSelector"] = labelSelector; + } + + if (page !== undefined) { + localVarQueryParameter["page"] = page; + } + + if (size !== undefined) { + localVarQueryParameter["size"] = size; + } + + if (sort) { + localVarQueryParameter["sort"] = Array.from(sort); + } + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Update notification.halo.run/v1alpha1/Subscription + * @param {string} name Name of subscription + * @param {Subscription} [subscription] Updated subscription + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updatenotificationHaloRunV1alpha1Subscription: async ( + name: string, + subscription?: Subscription, + options: AxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'name' is not null or undefined + assertParamExists( + "updatenotificationHaloRunV1alpha1Subscription", + "name", + name + ); + const localVarPath = + `/apis/notification.halo.run/v1alpha1/subscriptions/{name}`.replace( + `{${"name"}}`, + encodeURIComponent(String(name)) + ); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: "PUT", + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication BasicAuth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration); + + // authentication BearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration); + + localVarHeaderParameter["Content-Type"] = "application/json"; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = + baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + localVarRequestOptions.data = serializeDataIfNeeded( + subscription, + localVarRequestOptions, + configuration + ); + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + }; + }; + +/** + * NotificationHaloRunV1alpha1SubscriptionApi - functional programming interface + * @export + */ +export const NotificationHaloRunV1alpha1SubscriptionApiFp = function ( + configuration?: Configuration +) { + const localVarAxiosParamCreator = + NotificationHaloRunV1alpha1SubscriptionApiAxiosParamCreator(configuration); + return { + /** + * Create notification.halo.run/v1alpha1/Subscription + * @param {Subscription} [subscription] Fresh subscription + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createnotificationHaloRunV1alpha1Subscription( + subscription?: Subscription, + options?: AxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.createnotificationHaloRunV1alpha1Subscription( + subscription, + options + ); + return createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + ); + }, + /** + * Delete notification.halo.run/v1alpha1/Subscription + * @param {string} name Name of subscription + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deletenotificationHaloRunV1alpha1Subscription( + name: string, + options?: AxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.deletenotificationHaloRunV1alpha1Subscription( + name, + options + ); + return createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + ); + }, + /** + * Get notification.halo.run/v1alpha1/Subscription + * @param {string} name Name of subscription + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getnotificationHaloRunV1alpha1Subscription( + name: string, + options?: AxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.getnotificationHaloRunV1alpha1Subscription( + name, + options + ); + return createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + ); + }, + /** + * List notification.halo.run/v1alpha1/Subscription + * @param {Array} [fieldSelector] Field selector for filtering. + * @param {Array} [labelSelector] Label selector for filtering. + * @param {number} [page] The page number. Zero indicates no page. + * @param {number} [size] Size of one page. Zero indicates no limit. + * @param {Array} [sort] Sort property and direction of the list result. Support sorting based on attribute name path. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listnotificationHaloRunV1alpha1Subscription( + fieldSelector?: Array, + labelSelector?: Array, + page?: number, + size?: number, + sort?: Array, + options?: AxiosRequestConfig + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.listnotificationHaloRunV1alpha1Subscription( + fieldSelector, + labelSelector, + page, + size, + sort, + options + ); + return createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + ); + }, + /** + * Update notification.halo.run/v1alpha1/Subscription + * @param {string} name Name of subscription + * @param {Subscription} [subscription] Updated subscription + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async updatenotificationHaloRunV1alpha1Subscription( + name: string, + subscription?: Subscription, + options?: AxiosRequestConfig + ): Promise< + (axios?: AxiosInstance, basePath?: string) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.updatenotificationHaloRunV1alpha1Subscription( + name, + subscription, + options + ); + return createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + ); + }, + }; +}; + +/** + * NotificationHaloRunV1alpha1SubscriptionApi - factory interface + * @export + */ +export const NotificationHaloRunV1alpha1SubscriptionApiFactory = function ( + configuration?: Configuration, + basePath?: string, + axios?: AxiosInstance +) { + const localVarFp = + NotificationHaloRunV1alpha1SubscriptionApiFp(configuration); + return { + /** + * Create notification.halo.run/v1alpha1/Subscription + * @param {NotificationHaloRunV1alpha1SubscriptionApiCreatenotificationHaloRunV1alpha1SubscriptionRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createnotificationHaloRunV1alpha1Subscription( + requestParameters: NotificationHaloRunV1alpha1SubscriptionApiCreatenotificationHaloRunV1alpha1SubscriptionRequest = {}, + options?: AxiosRequestConfig + ): AxiosPromise { + return localVarFp + .createnotificationHaloRunV1alpha1Subscription( + requestParameters.subscription, + options + ) + .then((request) => request(axios, basePath)); + }, + /** + * Delete notification.halo.run/v1alpha1/Subscription + * @param {NotificationHaloRunV1alpha1SubscriptionApiDeletenotificationHaloRunV1alpha1SubscriptionRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deletenotificationHaloRunV1alpha1Subscription( + requestParameters: NotificationHaloRunV1alpha1SubscriptionApiDeletenotificationHaloRunV1alpha1SubscriptionRequest, + options?: AxiosRequestConfig + ): AxiosPromise { + return localVarFp + .deletenotificationHaloRunV1alpha1Subscription( + requestParameters.name, + options + ) + .then((request) => request(axios, basePath)); + }, + /** + * Get notification.halo.run/v1alpha1/Subscription + * @param {NotificationHaloRunV1alpha1SubscriptionApiGetnotificationHaloRunV1alpha1SubscriptionRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getnotificationHaloRunV1alpha1Subscription( + requestParameters: NotificationHaloRunV1alpha1SubscriptionApiGetnotificationHaloRunV1alpha1SubscriptionRequest, + options?: AxiosRequestConfig + ): AxiosPromise { + return localVarFp + .getnotificationHaloRunV1alpha1Subscription( + requestParameters.name, + options + ) + .then((request) => request(axios, basePath)); + }, + /** + * List notification.halo.run/v1alpha1/Subscription + * @param {NotificationHaloRunV1alpha1SubscriptionApiListnotificationHaloRunV1alpha1SubscriptionRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listnotificationHaloRunV1alpha1Subscription( + requestParameters: NotificationHaloRunV1alpha1SubscriptionApiListnotificationHaloRunV1alpha1SubscriptionRequest = {}, + options?: AxiosRequestConfig + ): AxiosPromise { + return localVarFp + .listnotificationHaloRunV1alpha1Subscription( + requestParameters.fieldSelector, + requestParameters.labelSelector, + requestParameters.page, + requestParameters.size, + requestParameters.sort, + options + ) + .then((request) => request(axios, basePath)); + }, + /** + * Update notification.halo.run/v1alpha1/Subscription + * @param {NotificationHaloRunV1alpha1SubscriptionApiUpdatenotificationHaloRunV1alpha1SubscriptionRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updatenotificationHaloRunV1alpha1Subscription( + requestParameters: NotificationHaloRunV1alpha1SubscriptionApiUpdatenotificationHaloRunV1alpha1SubscriptionRequest, + options?: AxiosRequestConfig + ): AxiosPromise { + return localVarFp + .updatenotificationHaloRunV1alpha1Subscription( + requestParameters.name, + requestParameters.subscription, + options + ) + .then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * Request parameters for createnotificationHaloRunV1alpha1Subscription operation in NotificationHaloRunV1alpha1SubscriptionApi. + * @export + * @interface NotificationHaloRunV1alpha1SubscriptionApiCreatenotificationHaloRunV1alpha1SubscriptionRequest + */ +export interface NotificationHaloRunV1alpha1SubscriptionApiCreatenotificationHaloRunV1alpha1SubscriptionRequest { + /** + * Fresh subscription + * @type {Subscription} + * @memberof NotificationHaloRunV1alpha1SubscriptionApiCreatenotificationHaloRunV1alpha1Subscription + */ + readonly subscription?: Subscription; +} + +/** + * Request parameters for deletenotificationHaloRunV1alpha1Subscription operation in NotificationHaloRunV1alpha1SubscriptionApi. + * @export + * @interface NotificationHaloRunV1alpha1SubscriptionApiDeletenotificationHaloRunV1alpha1SubscriptionRequest + */ +export interface NotificationHaloRunV1alpha1SubscriptionApiDeletenotificationHaloRunV1alpha1SubscriptionRequest { + /** + * Name of subscription + * @type {string} + * @memberof NotificationHaloRunV1alpha1SubscriptionApiDeletenotificationHaloRunV1alpha1Subscription + */ + readonly name: string; +} + +/** + * Request parameters for getnotificationHaloRunV1alpha1Subscription operation in NotificationHaloRunV1alpha1SubscriptionApi. + * @export + * @interface NotificationHaloRunV1alpha1SubscriptionApiGetnotificationHaloRunV1alpha1SubscriptionRequest + */ +export interface NotificationHaloRunV1alpha1SubscriptionApiGetnotificationHaloRunV1alpha1SubscriptionRequest { + /** + * Name of subscription + * @type {string} + * @memberof NotificationHaloRunV1alpha1SubscriptionApiGetnotificationHaloRunV1alpha1Subscription + */ + readonly name: string; +} + +/** + * Request parameters for listnotificationHaloRunV1alpha1Subscription operation in NotificationHaloRunV1alpha1SubscriptionApi. + * @export + * @interface NotificationHaloRunV1alpha1SubscriptionApiListnotificationHaloRunV1alpha1SubscriptionRequest + */ +export interface NotificationHaloRunV1alpha1SubscriptionApiListnotificationHaloRunV1alpha1SubscriptionRequest { + /** + * Field selector for filtering. + * @type {Array} + * @memberof NotificationHaloRunV1alpha1SubscriptionApiListnotificationHaloRunV1alpha1Subscription + */ + readonly fieldSelector?: Array; + + /** + * Label selector for filtering. + * @type {Array} + * @memberof NotificationHaloRunV1alpha1SubscriptionApiListnotificationHaloRunV1alpha1Subscription + */ + readonly labelSelector?: Array; + + /** + * The page number. Zero indicates no page. + * @type {number} + * @memberof NotificationHaloRunV1alpha1SubscriptionApiListnotificationHaloRunV1alpha1Subscription + */ + readonly page?: number; + + /** + * Size of one page. Zero indicates no limit. + * @type {number} + * @memberof NotificationHaloRunV1alpha1SubscriptionApiListnotificationHaloRunV1alpha1Subscription + */ + readonly size?: number; + + /** + * Sort property and direction of the list result. Support sorting based on attribute name path. + * @type {Array} + * @memberof NotificationHaloRunV1alpha1SubscriptionApiListnotificationHaloRunV1alpha1Subscription + */ + readonly sort?: Array; +} + +/** + * Request parameters for updatenotificationHaloRunV1alpha1Subscription operation in NotificationHaloRunV1alpha1SubscriptionApi. + * @export + * @interface NotificationHaloRunV1alpha1SubscriptionApiUpdatenotificationHaloRunV1alpha1SubscriptionRequest + */ +export interface NotificationHaloRunV1alpha1SubscriptionApiUpdatenotificationHaloRunV1alpha1SubscriptionRequest { + /** + * Name of subscription + * @type {string} + * @memberof NotificationHaloRunV1alpha1SubscriptionApiUpdatenotificationHaloRunV1alpha1Subscription + */ + readonly name: string; + + /** + * Updated subscription + * @type {Subscription} + * @memberof NotificationHaloRunV1alpha1SubscriptionApiUpdatenotificationHaloRunV1alpha1Subscription + */ + readonly subscription?: Subscription; +} + +/** + * NotificationHaloRunV1alpha1SubscriptionApi - object-oriented interface + * @export + * @class NotificationHaloRunV1alpha1SubscriptionApi + * @extends {BaseAPI} + */ +export class NotificationHaloRunV1alpha1SubscriptionApi extends BaseAPI { + /** + * Create notification.halo.run/v1alpha1/Subscription + * @param {NotificationHaloRunV1alpha1SubscriptionApiCreatenotificationHaloRunV1alpha1SubscriptionRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof NotificationHaloRunV1alpha1SubscriptionApi + */ + public createnotificationHaloRunV1alpha1Subscription( + requestParameters: NotificationHaloRunV1alpha1SubscriptionApiCreatenotificationHaloRunV1alpha1SubscriptionRequest = {}, + options?: AxiosRequestConfig + ) { + return NotificationHaloRunV1alpha1SubscriptionApiFp(this.configuration) + .createnotificationHaloRunV1alpha1Subscription( + requestParameters.subscription, + options + ) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Delete notification.halo.run/v1alpha1/Subscription + * @param {NotificationHaloRunV1alpha1SubscriptionApiDeletenotificationHaloRunV1alpha1SubscriptionRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof NotificationHaloRunV1alpha1SubscriptionApi + */ + public deletenotificationHaloRunV1alpha1Subscription( + requestParameters: NotificationHaloRunV1alpha1SubscriptionApiDeletenotificationHaloRunV1alpha1SubscriptionRequest, + options?: AxiosRequestConfig + ) { + return NotificationHaloRunV1alpha1SubscriptionApiFp(this.configuration) + .deletenotificationHaloRunV1alpha1Subscription( + requestParameters.name, + options + ) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Get notification.halo.run/v1alpha1/Subscription + * @param {NotificationHaloRunV1alpha1SubscriptionApiGetnotificationHaloRunV1alpha1SubscriptionRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof NotificationHaloRunV1alpha1SubscriptionApi + */ + public getnotificationHaloRunV1alpha1Subscription( + requestParameters: NotificationHaloRunV1alpha1SubscriptionApiGetnotificationHaloRunV1alpha1SubscriptionRequest, + options?: AxiosRequestConfig + ) { + return NotificationHaloRunV1alpha1SubscriptionApiFp(this.configuration) + .getnotificationHaloRunV1alpha1Subscription( + requestParameters.name, + options + ) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * List notification.halo.run/v1alpha1/Subscription + * @param {NotificationHaloRunV1alpha1SubscriptionApiListnotificationHaloRunV1alpha1SubscriptionRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof NotificationHaloRunV1alpha1SubscriptionApi + */ + public listnotificationHaloRunV1alpha1Subscription( + requestParameters: NotificationHaloRunV1alpha1SubscriptionApiListnotificationHaloRunV1alpha1SubscriptionRequest = {}, + options?: AxiosRequestConfig + ) { + return NotificationHaloRunV1alpha1SubscriptionApiFp(this.configuration) + .listnotificationHaloRunV1alpha1Subscription( + requestParameters.fieldSelector, + requestParameters.labelSelector, + requestParameters.page, + requestParameters.size, + requestParameters.sort, + options + ) + .then((request) => request(this.axios, this.basePath)); + } + + /** + * Update notification.halo.run/v1alpha1/Subscription + * @param {NotificationHaloRunV1alpha1SubscriptionApiUpdatenotificationHaloRunV1alpha1SubscriptionRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof NotificationHaloRunV1alpha1SubscriptionApi + */ + public updatenotificationHaloRunV1alpha1Subscription( + requestParameters: NotificationHaloRunV1alpha1SubscriptionApiUpdatenotificationHaloRunV1alpha1SubscriptionRequest, + options?: AxiosRequestConfig + ) { + return NotificationHaloRunV1alpha1SubscriptionApiFp(this.configuration) + .updatenotificationHaloRunV1alpha1Subscription( + requestParameters.name, + requestParameters.subscription, + options + ) + .then((request) => request(this.axios, this.basePath)); + } +} diff --git a/console/packages/api-client/src/models/index.ts b/console/packages/api-client/src/models/index.ts index 88262a54b6..a1f22074de 100644 --- a/console/packages/api-client/src/models/index.ts +++ b/console/packages/api-client/src/models/index.ts @@ -63,6 +63,8 @@ export * from "./group-list"; export * from "./group-spec"; export * from "./group-status"; export * from "./install-from-uri-request"; +export * from "./interest-reason"; +export * from "./interest-reason-subject"; export * from "./license"; export * from "./listed-auth-provider"; export * from "./listed-comment"; @@ -79,6 +81,7 @@ export * from "./listed-single-page-vo"; export * from "./listed-single-page-vo-list"; export * from "./listed-user"; export * from "./login-history"; +export * from "./mark-specified-request"; export * from "./menu"; export * from "./menu-item"; export * from "./menu-item-list"; @@ -90,6 +93,16 @@ export * from "./menu-spec"; export * from "./menu-vo"; export * from "./metadata"; export * from "./navigation-post-vo"; +export * from "./notification"; +export * from "./notification-list"; +export * from "./notification-spec"; +export * from "./notification-template"; +export * from "./notification-template-list"; +export * from "./notification-template-spec"; +export * from "./notifier-descriptor"; +export * from "./notifier-descriptor-list"; +export * from "./notifier-descriptor-spec"; +export * from "./notifier-setting-ref"; export * from "./owner-info"; export * from "./pat-spec"; export * from "./personal-access-token"; @@ -115,6 +128,16 @@ export * from "./post-spec"; export * from "./post-status"; export * from "./post-vo"; export * from "./public-key-response"; +export * from "./reason"; +export * from "./reason-list"; +export * from "./reason-property"; +export * from "./reason-selector"; +export * from "./reason-spec"; +export * from "./reason-spec-attributes"; +export * from "./reason-subject"; +export * from "./reason-type"; +export * from "./reason-type-list"; +export * from "./reason-type-spec"; export * from "./ref"; export * from "./reply"; export * from "./reply-list"; @@ -154,6 +177,10 @@ export * from "./snapshot-list"; export * from "./stats"; export * from "./stats-vo"; export * from "./subject"; +export * from "./subscription"; +export * from "./subscription-list"; +export * from "./subscription-spec"; +export * from "./subscription-subscriber"; export * from "./system-initialization-request"; export * from "./tag"; export * from "./tag-list"; @@ -161,6 +188,7 @@ export * from "./tag-spec"; export * from "./tag-status"; export * from "./tag-vo"; export * from "./tag-vo-list"; +export * from "./template-content"; export * from "./template-descriptor"; export * from "./theme"; export * from "./theme-list"; diff --git a/console/packages/api-client/src/models/interest-reason-subject.ts b/console/packages/api-client/src/models/interest-reason-subject.ts new file mode 100644 index 0000000000..a7a693c3aa --- /dev/null +++ b/console/packages/api-client/src/models/interest-reason-subject.ts @@ -0,0 +1,39 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Halo Next API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.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. + */ + +/** + * The subject name of reason type to be interested in + * @export + * @interface InterestReasonSubject + */ +export interface InterestReasonSubject { + /** + * + * @type {string} + * @memberof InterestReasonSubject + */ + apiVersion: string; + /** + * + * @type {string} + * @memberof InterestReasonSubject + */ + kind: string; + /** + * if name is not specified, it presents all subjects of the specified reason type and custom resources + * @type {string} + * @memberof InterestReasonSubject + */ + name?: string; +} diff --git a/console/packages/api-client/src/models/interest-reason.ts b/console/packages/api-client/src/models/interest-reason.ts new file mode 100644 index 0000000000..c33a1d9348 --- /dev/null +++ b/console/packages/api-client/src/models/interest-reason.ts @@ -0,0 +1,37 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Halo Next API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.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. + */ + +// May contain unused imports in some cases +// @ts-ignore +import { InterestReasonSubject } from "./interest-reason-subject"; + +/** + * The reason to be interested in + * @export + * @interface InterestReason + */ +export interface InterestReason { + /** + * The name of the reason definition to be interested in + * @type {string} + * @memberof InterestReason + */ + reasonType: string; + /** + * + * @type {InterestReasonSubject} + * @memberof InterestReason + */ + subject: InterestReasonSubject; +} diff --git a/console/packages/api-client/src/models/mark-specified-request.ts b/console/packages/api-client/src/models/mark-specified-request.ts new file mode 100644 index 0000000000..ca4181d28e --- /dev/null +++ b/console/packages/api-client/src/models/mark-specified-request.ts @@ -0,0 +1,27 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Halo Next API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.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. + */ + +/** + * + * @export + * @interface MarkSpecifiedRequest + */ +export interface MarkSpecifiedRequest { + /** + * + * @type {Array} + * @memberof MarkSpecifiedRequest + */ + names?: Array; +} diff --git a/console/packages/api-client/src/models/notification-list.ts b/console/packages/api-client/src/models/notification-list.ts new file mode 100644 index 0000000000..ab305489d0 --- /dev/null +++ b/console/packages/api-client/src/models/notification-list.ts @@ -0,0 +1,79 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Halo Next API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.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. + */ + +// May contain unused imports in some cases +// @ts-ignore +import { Notification } from "./notification"; + +/** + * + * @export + * @interface NotificationList + */ +export interface NotificationList { + /** + * Indicates whether current page is the first page. + * @type {boolean} + * @memberof NotificationList + */ + first: boolean; + /** + * Indicates whether current page has previous page. + * @type {boolean} + * @memberof NotificationList + */ + hasNext: boolean; + /** + * Indicates whether current page has previous page. + * @type {boolean} + * @memberof NotificationList + */ + hasPrevious: boolean; + /** + * A chunk of items. + * @type {Array} + * @memberof NotificationList + */ + items: Array; + /** + * Indicates whether current page is the last page. + * @type {boolean} + * @memberof NotificationList + */ + last: boolean; + /** + * Page number, starts from 1. If not set or equal to 0, it means no pagination. + * @type {number} + * @memberof NotificationList + */ + page: number; + /** + * Size of each page. If not set or equal to 0, it means no pagination. + * @type {number} + * @memberof NotificationList + */ + size: number; + /** + * Total elements. + * @type {number} + * @memberof NotificationList + */ + total: number; + /** + * Indicates total pages. + * @type {number} + * @memberof NotificationList + */ + totalPages: number; +} diff --git a/console/packages/api-client/src/models/notification-spec.ts b/console/packages/api-client/src/models/notification-spec.ts new file mode 100644 index 0000000000..0d5cdc8b59 --- /dev/null +++ b/console/packages/api-client/src/models/notification-spec.ts @@ -0,0 +1,63 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Halo Next API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.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. + */ + +/** + * + * @export + * @interface NotificationSpec + */ +export interface NotificationSpec { + /** + * + * @type {string} + * @memberof NotificationSpec + */ + htmlContent: string; + /** + * + * @type {string} + * @memberof NotificationSpec + */ + lastReadAt?: string; + /** + * + * @type {string} + * @memberof NotificationSpec + */ + rawContent: string; + /** + * The name of reason + * @type {string} + * @memberof NotificationSpec + */ + reason: string; + /** + * The name of user + * @type {string} + * @memberof NotificationSpec + */ + recipient: string; + /** + * + * @type {string} + * @memberof NotificationSpec + */ + title: string; + /** + * + * @type {boolean} + * @memberof NotificationSpec + */ + unread?: boolean; +} diff --git a/console/packages/api-client/src/models/notification-template-list.ts b/console/packages/api-client/src/models/notification-template-list.ts new file mode 100644 index 0000000000..0eda98cfd0 --- /dev/null +++ b/console/packages/api-client/src/models/notification-template-list.ts @@ -0,0 +1,79 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Halo Next API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.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. + */ + +// May contain unused imports in some cases +// @ts-ignore +import { NotificationTemplate } from "./notification-template"; + +/** + * + * @export + * @interface NotificationTemplateList + */ +export interface NotificationTemplateList { + /** + * Indicates whether current page is the first page. + * @type {boolean} + * @memberof NotificationTemplateList + */ + first: boolean; + /** + * Indicates whether current page has previous page. + * @type {boolean} + * @memberof NotificationTemplateList + */ + hasNext: boolean; + /** + * Indicates whether current page has previous page. + * @type {boolean} + * @memberof NotificationTemplateList + */ + hasPrevious: boolean; + /** + * A chunk of items. + * @type {Array} + * @memberof NotificationTemplateList + */ + items: Array; + /** + * Indicates whether current page is the last page. + * @type {boolean} + * @memberof NotificationTemplateList + */ + last: boolean; + /** + * Page number, starts from 1. If not set or equal to 0, it means no pagination. + * @type {number} + * @memberof NotificationTemplateList + */ + page: number; + /** + * Size of each page. If not set or equal to 0, it means no pagination. + * @type {number} + * @memberof NotificationTemplateList + */ + size: number; + /** + * Total elements. + * @type {number} + * @memberof NotificationTemplateList + */ + total: number; + /** + * Indicates total pages. + * @type {number} + * @memberof NotificationTemplateList + */ + totalPages: number; +} diff --git a/console/packages/api-client/src/models/notification-template-spec.ts b/console/packages/api-client/src/models/notification-template-spec.ts new file mode 100644 index 0000000000..54e9e92c0b --- /dev/null +++ b/console/packages/api-client/src/models/notification-template-spec.ts @@ -0,0 +1,40 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Halo Next API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.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. + */ + +// May contain unused imports in some cases +// @ts-ignore +import { ReasonSelector } from "./reason-selector"; +// May contain unused imports in some cases +// @ts-ignore +import { TemplateContent } from "./template-content"; + +/** + * + * @export + * @interface NotificationTemplateSpec + */ +export interface NotificationTemplateSpec { + /** + * + * @type {ReasonSelector} + * @memberof NotificationTemplateSpec + */ + reasonSelector?: ReasonSelector; + /** + * + * @type {TemplateContent} + * @memberof NotificationTemplateSpec + */ + template?: TemplateContent; +} diff --git a/console/packages/api-client/src/models/notification-template.ts b/console/packages/api-client/src/models/notification-template.ts new file mode 100644 index 0000000000..8470f874f2 --- /dev/null +++ b/console/packages/api-client/src/models/notification-template.ts @@ -0,0 +1,52 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Halo Next API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.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. + */ + +// May contain unused imports in some cases +// @ts-ignore +import { Metadata } from "./metadata"; +// May contain unused imports in some cases +// @ts-ignore +import { NotificationTemplateSpec } from "./notification-template-spec"; + +/** + * + * @export + * @interface NotificationTemplate + */ +export interface NotificationTemplate { + /** + * + * @type {string} + * @memberof NotificationTemplate + */ + apiVersion: string; + /** + * + * @type {string} + * @memberof NotificationTemplate + */ + kind: string; + /** + * + * @type {Metadata} + * @memberof NotificationTemplate + */ + metadata: Metadata; + /** + * + * @type {NotificationTemplateSpec} + * @memberof NotificationTemplate + */ + spec?: NotificationTemplateSpec; +} diff --git a/console/packages/api-client/src/models/notification.ts b/console/packages/api-client/src/models/notification.ts new file mode 100644 index 0000000000..7704d94c5f --- /dev/null +++ b/console/packages/api-client/src/models/notification.ts @@ -0,0 +1,52 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Halo Next API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.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. + */ + +// May contain unused imports in some cases +// @ts-ignore +import { Metadata } from "./metadata"; +// May contain unused imports in some cases +// @ts-ignore +import { NotificationSpec } from "./notification-spec"; + +/** + * + * @export + * @interface Notification + */ +export interface Notification { + /** + * + * @type {string} + * @memberof Notification + */ + apiVersion: string; + /** + * + * @type {string} + * @memberof Notification + */ + kind: string; + /** + * + * @type {Metadata} + * @memberof Notification + */ + metadata: Metadata; + /** + * + * @type {NotificationSpec} + * @memberof Notification + */ + spec?: NotificationSpec; +} diff --git a/console/packages/api-client/src/models/notifier-descriptor-list.ts b/console/packages/api-client/src/models/notifier-descriptor-list.ts new file mode 100644 index 0000000000..9bb0cc8feb --- /dev/null +++ b/console/packages/api-client/src/models/notifier-descriptor-list.ts @@ -0,0 +1,79 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Halo Next API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.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. + */ + +// May contain unused imports in some cases +// @ts-ignore +import { NotifierDescriptor } from "./notifier-descriptor"; + +/** + * + * @export + * @interface NotifierDescriptorList + */ +export interface NotifierDescriptorList { + /** + * Indicates whether current page is the first page. + * @type {boolean} + * @memberof NotifierDescriptorList + */ + first: boolean; + /** + * Indicates whether current page has previous page. + * @type {boolean} + * @memberof NotifierDescriptorList + */ + hasNext: boolean; + /** + * Indicates whether current page has previous page. + * @type {boolean} + * @memberof NotifierDescriptorList + */ + hasPrevious: boolean; + /** + * A chunk of items. + * @type {Array} + * @memberof NotifierDescriptorList + */ + items: Array; + /** + * Indicates whether current page is the last page. + * @type {boolean} + * @memberof NotifierDescriptorList + */ + last: boolean; + /** + * Page number, starts from 1. If not set or equal to 0, it means no pagination. + * @type {number} + * @memberof NotifierDescriptorList + */ + page: number; + /** + * Size of each page. If not set or equal to 0, it means no pagination. + * @type {number} + * @memberof NotifierDescriptorList + */ + size: number; + /** + * Total elements. + * @type {number} + * @memberof NotifierDescriptorList + */ + total: number; + /** + * Indicates total pages. + * @type {number} + * @memberof NotifierDescriptorList + */ + totalPages: number; +} diff --git a/console/packages/api-client/src/models/notifier-descriptor-spec.ts b/console/packages/api-client/src/models/notifier-descriptor-spec.ts new file mode 100644 index 0000000000..70ce155bc0 --- /dev/null +++ b/console/packages/api-client/src/models/notifier-descriptor-spec.ts @@ -0,0 +1,55 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Halo Next API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.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. + */ + +// May contain unused imports in some cases +// @ts-ignore +import { NotifierSettingRef } from "./notifier-setting-ref"; + +/** + * + * @export + * @interface NotifierDescriptorSpec + */ +export interface NotifierDescriptorSpec { + /** + * + * @type {string} + * @memberof NotifierDescriptorSpec + */ + description?: string; + /** + * + * @type {string} + * @memberof NotifierDescriptorSpec + */ + displayName: string; + /** + * + * @type {string} + * @memberof NotifierDescriptorSpec + */ + notifierExtName: string; + /** + * + * @type {NotifierSettingRef} + * @memberof NotifierDescriptorSpec + */ + receiverSettingRef?: NotifierSettingRef; + /** + * + * @type {NotifierSettingRef} + * @memberof NotifierDescriptorSpec + */ + senderSettingRef?: NotifierSettingRef; +} diff --git a/console/packages/api-client/src/models/notifier-descriptor.ts b/console/packages/api-client/src/models/notifier-descriptor.ts new file mode 100644 index 0000000000..05647d901d --- /dev/null +++ b/console/packages/api-client/src/models/notifier-descriptor.ts @@ -0,0 +1,52 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Halo Next API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.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. + */ + +// May contain unused imports in some cases +// @ts-ignore +import { Metadata } from "./metadata"; +// May contain unused imports in some cases +// @ts-ignore +import { NotifierDescriptorSpec } from "./notifier-descriptor-spec"; + +/** + * + * @export + * @interface NotifierDescriptor + */ +export interface NotifierDescriptor { + /** + * + * @type {string} + * @memberof NotifierDescriptor + */ + apiVersion: string; + /** + * + * @type {string} + * @memberof NotifierDescriptor + */ + kind: string; + /** + * + * @type {Metadata} + * @memberof NotifierDescriptor + */ + metadata: Metadata; + /** + * + * @type {NotifierDescriptorSpec} + * @memberof NotifierDescriptor + */ + spec?: NotifierDescriptorSpec; +} diff --git a/console/packages/api-client/src/models/notifier-setting-ref.ts b/console/packages/api-client/src/models/notifier-setting-ref.ts new file mode 100644 index 0000000000..4842a80d12 --- /dev/null +++ b/console/packages/api-client/src/models/notifier-setting-ref.ts @@ -0,0 +1,33 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Halo Next API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.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. + */ + +/** + * + * @export + * @interface NotifierSettingRef + */ +export interface NotifierSettingRef { + /** + * + * @type {string} + * @memberof NotifierSettingRef + */ + group: string; + /** + * + * @type {string} + * @memberof NotifierSettingRef + */ + name: string; +} diff --git a/console/packages/api-client/src/models/reason-list.ts b/console/packages/api-client/src/models/reason-list.ts new file mode 100644 index 0000000000..966dc1ad96 --- /dev/null +++ b/console/packages/api-client/src/models/reason-list.ts @@ -0,0 +1,79 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Halo Next API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.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. + */ + +// May contain unused imports in some cases +// @ts-ignore +import { Reason } from "./reason"; + +/** + * + * @export + * @interface ReasonList + */ +export interface ReasonList { + /** + * Indicates whether current page is the first page. + * @type {boolean} + * @memberof ReasonList + */ + first: boolean; + /** + * Indicates whether current page has previous page. + * @type {boolean} + * @memberof ReasonList + */ + hasNext: boolean; + /** + * Indicates whether current page has previous page. + * @type {boolean} + * @memberof ReasonList + */ + hasPrevious: boolean; + /** + * A chunk of items. + * @type {Array} + * @memberof ReasonList + */ + items: Array; + /** + * Indicates whether current page is the last page. + * @type {boolean} + * @memberof ReasonList + */ + last: boolean; + /** + * Page number, starts from 1. If not set or equal to 0, it means no pagination. + * @type {number} + * @memberof ReasonList + */ + page: number; + /** + * Size of each page. If not set or equal to 0, it means no pagination. + * @type {number} + * @memberof ReasonList + */ + size: number; + /** + * Total elements. + * @type {number} + * @memberof ReasonList + */ + total: number; + /** + * Indicates total pages. + * @type {number} + * @memberof ReasonList + */ + totalPages: number; +} diff --git a/console/packages/api-client/src/models/reason-property.ts b/console/packages/api-client/src/models/reason-property.ts new file mode 100644 index 0000000000..b8123c6fc1 --- /dev/null +++ b/console/packages/api-client/src/models/reason-property.ts @@ -0,0 +1,45 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Halo Next API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.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. + */ + +/** + * + * @export + * @interface ReasonProperty + */ +export interface ReasonProperty { + /** + * + * @type {string} + * @memberof ReasonProperty + */ + description?: string; + /** + * + * @type {string} + * @memberof ReasonProperty + */ + name: string; + /** + * + * @type {boolean} + * @memberof ReasonProperty + */ + optional?: boolean; + /** + * + * @type {string} + * @memberof ReasonProperty + */ + type: string; +} diff --git a/console/packages/api-client/src/models/reason-selector.ts b/console/packages/api-client/src/models/reason-selector.ts new file mode 100644 index 0000000000..9fc079200e --- /dev/null +++ b/console/packages/api-client/src/models/reason-selector.ts @@ -0,0 +1,33 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Halo Next API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.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. + */ + +/** + * + * @export + * @interface ReasonSelector + */ +export interface ReasonSelector { + /** + * + * @type {string} + * @memberof ReasonSelector + */ + language: string; + /** + * + * @type {string} + * @memberof ReasonSelector + */ + reasonType: string; +} diff --git a/console/packages/api-client/src/models/reason-spec-attributes.ts b/console/packages/api-client/src/models/reason-spec-attributes.ts new file mode 100644 index 0000000000..69e0df65f7 --- /dev/null +++ b/console/packages/api-client/src/models/reason-spec-attributes.ts @@ -0,0 +1,27 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Halo Next API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.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. + */ + +/** + * Attributes used to transfer data + * @export + * @interface ReasonSpecAttributes + */ +export interface ReasonSpecAttributes { + /** + * + * @type {boolean} + * @memberof ReasonSpecAttributes + */ + empty?: boolean; +} diff --git a/console/packages/api-client/src/models/reason-spec.ts b/console/packages/api-client/src/models/reason-spec.ts new file mode 100644 index 0000000000..136aa8039f --- /dev/null +++ b/console/packages/api-client/src/models/reason-spec.ts @@ -0,0 +1,52 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Halo Next API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.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. + */ + +// May contain unused imports in some cases +// @ts-ignore +import { ReasonSpecAttributes } from "./reason-spec-attributes"; +// May contain unused imports in some cases +// @ts-ignore +import { ReasonSubject } from "./reason-subject"; + +/** + * + * @export + * @interface ReasonSpec + */ +export interface ReasonSpec { + /** + * + * @type {ReasonSpecAttributes} + * @memberof ReasonSpec + */ + attributes?: ReasonSpecAttributes; + /** + * + * @type {string} + * @memberof ReasonSpec + */ + author: string; + /** + * + * @type {string} + * @memberof ReasonSpec + */ + reasonType: string; + /** + * + * @type {ReasonSubject} + * @memberof ReasonSpec + */ + subject: ReasonSubject; +} diff --git a/console/packages/api-client/src/models/reason-subject.ts b/console/packages/api-client/src/models/reason-subject.ts new file mode 100644 index 0000000000..2955ca7de2 --- /dev/null +++ b/console/packages/api-client/src/models/reason-subject.ts @@ -0,0 +1,51 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Halo Next API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.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. + */ + +/** + * + * @export + * @interface ReasonSubject + */ +export interface ReasonSubject { + /** + * + * @type {string} + * @memberof ReasonSubject + */ + apiVersion: string; + /** + * + * @type {string} + * @memberof ReasonSubject + */ + kind: string; + /** + * + * @type {string} + * @memberof ReasonSubject + */ + name: string; + /** + * + * @type {string} + * @memberof ReasonSubject + */ + title: string; + /** + * + * @type {string} + * @memberof ReasonSubject + */ + url?: string; +} diff --git a/console/packages/api-client/src/models/reason-type-list.ts b/console/packages/api-client/src/models/reason-type-list.ts new file mode 100644 index 0000000000..c1ed630b2a --- /dev/null +++ b/console/packages/api-client/src/models/reason-type-list.ts @@ -0,0 +1,79 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Halo Next API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.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. + */ + +// May contain unused imports in some cases +// @ts-ignore +import { ReasonType } from "./reason-type"; + +/** + * + * @export + * @interface ReasonTypeList + */ +export interface ReasonTypeList { + /** + * Indicates whether current page is the first page. + * @type {boolean} + * @memberof ReasonTypeList + */ + first: boolean; + /** + * Indicates whether current page has previous page. + * @type {boolean} + * @memberof ReasonTypeList + */ + hasNext: boolean; + /** + * Indicates whether current page has previous page. + * @type {boolean} + * @memberof ReasonTypeList + */ + hasPrevious: boolean; + /** + * A chunk of items. + * @type {Array} + * @memberof ReasonTypeList + */ + items: Array; + /** + * Indicates whether current page is the last page. + * @type {boolean} + * @memberof ReasonTypeList + */ + last: boolean; + /** + * Page number, starts from 1. If not set or equal to 0, it means no pagination. + * @type {number} + * @memberof ReasonTypeList + */ + page: number; + /** + * Size of each page. If not set or equal to 0, it means no pagination. + * @type {number} + * @memberof ReasonTypeList + */ + size: number; + /** + * Total elements. + * @type {number} + * @memberof ReasonTypeList + */ + total: number; + /** + * Indicates total pages. + * @type {number} + * @memberof ReasonTypeList + */ + totalPages: number; +} diff --git a/console/packages/api-client/src/models/reason-type-spec.ts b/console/packages/api-client/src/models/reason-type-spec.ts new file mode 100644 index 0000000000..c02aace4d2 --- /dev/null +++ b/console/packages/api-client/src/models/reason-type-spec.ts @@ -0,0 +1,43 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Halo Next API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.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. + */ + +// May contain unused imports in some cases +// @ts-ignore +import { ReasonProperty } from "./reason-property"; + +/** + * + * @export + * @interface ReasonTypeSpec + */ +export interface ReasonTypeSpec { + /** + * + * @type {string} + * @memberof ReasonTypeSpec + */ + description: string; + /** + * + * @type {string} + * @memberof ReasonTypeSpec + */ + displayName: string; + /** + * + * @type {Array} + * @memberof ReasonTypeSpec + */ + properties?: Array; +} diff --git a/console/packages/api-client/src/models/reason-type.ts b/console/packages/api-client/src/models/reason-type.ts new file mode 100644 index 0000000000..c2e7d152f5 --- /dev/null +++ b/console/packages/api-client/src/models/reason-type.ts @@ -0,0 +1,52 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Halo Next API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.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. + */ + +// May contain unused imports in some cases +// @ts-ignore +import { Metadata } from "./metadata"; +// May contain unused imports in some cases +// @ts-ignore +import { ReasonTypeSpec } from "./reason-type-spec"; + +/** + * + * @export + * @interface ReasonType + */ +export interface ReasonType { + /** + * + * @type {string} + * @memberof ReasonType + */ + apiVersion: string; + /** + * + * @type {string} + * @memberof ReasonType + */ + kind: string; + /** + * + * @type {Metadata} + * @memberof ReasonType + */ + metadata: Metadata; + /** + * + * @type {ReasonTypeSpec} + * @memberof ReasonType + */ + spec?: ReasonTypeSpec; +} diff --git a/console/packages/api-client/src/models/reason.ts b/console/packages/api-client/src/models/reason.ts new file mode 100644 index 0000000000..dd810a5231 --- /dev/null +++ b/console/packages/api-client/src/models/reason.ts @@ -0,0 +1,52 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Halo Next API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.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. + */ + +// May contain unused imports in some cases +// @ts-ignore +import { Metadata } from "./metadata"; +// May contain unused imports in some cases +// @ts-ignore +import { ReasonSpec } from "./reason-spec"; + +/** + * + * @export + * @interface Reason + */ +export interface Reason { + /** + * + * @type {string} + * @memberof Reason + */ + apiVersion: string; + /** + * + * @type {string} + * @memberof Reason + */ + kind: string; + /** + * + * @type {Metadata} + * @memberof Reason + */ + metadata: Metadata; + /** + * + * @type {ReasonSpec} + * @memberof Reason + */ + spec?: ReasonSpec; +} diff --git a/console/packages/api-client/src/models/subscription-list.ts b/console/packages/api-client/src/models/subscription-list.ts new file mode 100644 index 0000000000..aa3254990f --- /dev/null +++ b/console/packages/api-client/src/models/subscription-list.ts @@ -0,0 +1,79 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Halo Next API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.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. + */ + +// May contain unused imports in some cases +// @ts-ignore +import { Subscription } from "./subscription"; + +/** + * + * @export + * @interface SubscriptionList + */ +export interface SubscriptionList { + /** + * Indicates whether current page is the first page. + * @type {boolean} + * @memberof SubscriptionList + */ + first: boolean; + /** + * Indicates whether current page has previous page. + * @type {boolean} + * @memberof SubscriptionList + */ + hasNext: boolean; + /** + * Indicates whether current page has previous page. + * @type {boolean} + * @memberof SubscriptionList + */ + hasPrevious: boolean; + /** + * A chunk of items. + * @type {Array} + * @memberof SubscriptionList + */ + items: Array; + /** + * Indicates whether current page is the last page. + * @type {boolean} + * @memberof SubscriptionList + */ + last: boolean; + /** + * Page number, starts from 1. If not set or equal to 0, it means no pagination. + * @type {number} + * @memberof SubscriptionList + */ + page: number; + /** + * Size of each page. If not set or equal to 0, it means no pagination. + * @type {number} + * @memberof SubscriptionList + */ + size: number; + /** + * Total elements. + * @type {number} + * @memberof SubscriptionList + */ + total: number; + /** + * Indicates total pages. + * @type {number} + * @memberof SubscriptionList + */ + totalPages: number; +} diff --git a/console/packages/api-client/src/models/subscription-spec.ts b/console/packages/api-client/src/models/subscription-spec.ts new file mode 100644 index 0000000000..c01667587a --- /dev/null +++ b/console/packages/api-client/src/models/subscription-spec.ts @@ -0,0 +1,52 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Halo Next API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.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. + */ + +// May contain unused imports in some cases +// @ts-ignore +import { InterestReason } from "./interest-reason"; +// May contain unused imports in some cases +// @ts-ignore +import { SubscriptionSubscriber } from "./subscription-subscriber"; + +/** + * + * @export + * @interface SubscriptionSpec + */ +export interface SubscriptionSpec { + /** + * Perhaps users need to unsubscribe and interact without receiving notifications again + * @type {boolean} + * @memberof SubscriptionSpec + */ + disabled?: boolean; + /** + * + * @type {InterestReason} + * @memberof SubscriptionSpec + */ + reason: InterestReason; + /** + * + * @type {SubscriptionSubscriber} + * @memberof SubscriptionSpec + */ + subscriber: SubscriptionSubscriber; + /** + * The token to unsubscribe + * @type {string} + * @memberof SubscriptionSpec + */ + unsubscribeToken: string; +} diff --git a/console/packages/api-client/src/models/subscription-subscriber.ts b/console/packages/api-client/src/models/subscription-subscriber.ts new file mode 100644 index 0000000000..af19db6929 --- /dev/null +++ b/console/packages/api-client/src/models/subscription-subscriber.ts @@ -0,0 +1,27 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Halo Next API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.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. + */ + +/** + * The subscriber to be notified + * @export + * @interface SubscriptionSubscriber + */ +export interface SubscriptionSubscriber { + /** + * + * @type {string} + * @memberof SubscriptionSubscriber + */ + name?: string; +} diff --git a/console/packages/api-client/src/models/subscription.ts b/console/packages/api-client/src/models/subscription.ts new file mode 100644 index 0000000000..7069662758 --- /dev/null +++ b/console/packages/api-client/src/models/subscription.ts @@ -0,0 +1,52 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Halo Next API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.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. + */ + +// May contain unused imports in some cases +// @ts-ignore +import { Metadata } from "./metadata"; +// May contain unused imports in some cases +// @ts-ignore +import { SubscriptionSpec } from "./subscription-spec"; + +/** + * + * @export + * @interface Subscription + */ +export interface Subscription { + /** + * + * @type {string} + * @memberof Subscription + */ + apiVersion: string; + /** + * + * @type {string} + * @memberof Subscription + */ + kind: string; + /** + * + * @type {Metadata} + * @memberof Subscription + */ + metadata: Metadata; + /** + * + * @type {SubscriptionSpec} + * @memberof Subscription + */ + spec?: SubscriptionSpec; +} diff --git a/console/packages/api-client/src/models/template-content.ts b/console/packages/api-client/src/models/template-content.ts new file mode 100644 index 0000000000..6f82baa83a --- /dev/null +++ b/console/packages/api-client/src/models/template-content.ts @@ -0,0 +1,39 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Halo Next API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.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. + */ + +/** + * + * @export + * @interface TemplateContent + */ +export interface TemplateContent { + /** + * + * @type {string} + * @memberof TemplateContent + */ + htmlBody?: string; + /** + * + * @type {string} + * @memberof TemplateContent + */ + rawBody?: string; + /** + * + * @type {string} + * @memberof TemplateContent + */ + title: string; +} diff --git a/console/packages/components/src/icons/icons.ts b/console/packages/components/src/icons/icons.ts index 2dff29dc2a..d7ca48dd70 100644 --- a/console/packages/components/src/icons/icons.ts +++ b/console/packages/components/src/icons/icons.ts @@ -66,6 +66,7 @@ import IconZoomOutLine from "~icons/ri/zoom-out-line"; import IconArrowLeftRightLine from "~icons/ri/arrow-left-right-line"; import IconArrowUpDownLine from "~icons/ri/arrow-up-down-line"; import IconRiUpload2Fill from "~icons/ri/upload-2-fill"; +import IconNotificationBadgeLine from "~icons/ri/notification-badge-line"; export { IconDashboard, @@ -136,4 +137,5 @@ export { IconArrowLeftRightLine, IconArrowUpDownLine, IconRiUpload2Fill, + IconNotificationBadgeLine, }; diff --git a/console/src/layouts/BasicLayout.vue b/console/src/layouts/BasicLayout.vue index 4aa16ffb0e..6d26ba1c99 100644 --- a/console/src/layouts/BasicLayout.vue +++ b/console/src/layouts/BasicLayout.vue @@ -302,6 +302,15 @@ onMounted(() => { > {{ $t("core.sidebar.operations.profile.button") }} + + {{ $t("core.sidebar.operations.notifications.button") }} + {{ $t("core.sidebar.operations.logout.button") }} diff --git a/console/src/locales/en.yaml b/console/src/locales/en.yaml index 4879d9b7bc..8d655d985a 100644 --- a/console/src/locales/en.yaml +++ b/console/src/locales/en.yaml @@ -79,6 +79,8 @@ core: button: Profile visit_homepage: title: Visit homepage + notifications: + button: Notifications dashboard: title: Dashboard actions: @@ -987,6 +989,18 @@ core: website: Website help_page: Help page authentication_url: Login URL + notification: + title: Notifications + tabs: + unread: Unread + read: Read + empty: + titles: + unread: No unread notifications + read: No read notifications + operations: + mark_as_read: + button: Mark as read setting: title: Settings actuator: @@ -1258,6 +1272,7 @@ core: submit: Submit detail: Detail select: Select + view_all: View all radio: "yes": Yes "no": No diff --git a/console/src/locales/zh-CN.yaml b/console/src/locales/zh-CN.yaml index d11b0eefd8..2a3f9895d4 100644 --- a/console/src/locales/zh-CN.yaml +++ b/console/src/locales/zh-CN.yaml @@ -79,6 +79,8 @@ core: button: 个人资料 visit_homepage: title: 访问首页 + notifications: + button: 我的消息 dashboard: title: 仪表板 actions: @@ -987,6 +989,18 @@ core: website: 网站 help_page: 帮助页面 authentication_url: 登录入口 + notification: + title: 消息 + tabs: + unread: 未读 + read: 已读 + empty: + titles: + unread: 当前没有未读的消息 + read: 当前没有已读的消息 + operations: + mark_as_read: + button: 标记为已读 setting: title: 设置 actuator: @@ -1258,6 +1272,7 @@ core: submit: 提交 detail: 详情 select: 选择 + view_all: 查看全部 radio: "yes": 是 "no": 否 diff --git a/console/src/locales/zh-TW.yaml b/console/src/locales/zh-TW.yaml index ccd6695eda..0029781fab 100644 --- a/console/src/locales/zh-TW.yaml +++ b/console/src/locales/zh-TW.yaml @@ -79,6 +79,8 @@ core: button: 個人資料 visit_homepage: title: 訪問首頁 + notifications: + button: 我的訊息 dashboard: title: 儀表板 actions: @@ -987,6 +989,18 @@ core: website: 網站 help_page: 幫助頁面 authentication_url: 登入入口 + notification: + title: 訊息 + tabs: + unread: 未讀 + read: 已讀 + empty: + titles: + unread: 目前沒有未讀的訊息 + read: 目前沒有已讀的訊息 + operations: + mark_as_read: + button: 標記為已讀 setting: title: 設置 actuator: @@ -1258,6 +1272,7 @@ core: submit: 提交 detail: 詳情 select: 選擇 + view_all: 查看全部 radio: "yes": 是 "no": 否 diff --git a/console/src/modules/dashboard/Dashboard.vue b/console/src/modules/dashboard/Dashboard.vue index 00d867c5b6..727b483691 100644 --- a/console/src/modules/dashboard/Dashboard.vue +++ b/console/src/modules/dashboard/Dashboard.vue @@ -187,6 +187,7 @@ const widgetsGroup = [ widgets: [ { x: 0, y: 0, w: 3, h: 3, i: 0, widget: "ViewsStatsWidget" }, { x: 0, y: 0, w: 6, h: 10, i: 1, widget: "QuickLinkWidget" }, + { x: 0, y: 0, w: 6, h: 10, i: 2, widget: "NotificationWidget" }, ], }, ]; @@ -242,8 +243,8 @@ const layout = useStorage("widgets", [ w: 6, h: 12, i: 5, - widget: "RecentPublishedWidget", - permissions: ["system:posts:view"], + widget: "NotificationWidget", + permissions: [], }, ]); diff --git a/console/src/modules/index.ts b/console/src/modules/index.ts index c770ff10c2..c3f5a66a36 100644 --- a/console/src/modules/index.ts +++ b/console/src/modules/index.ts @@ -1,3 +1,4 @@ +// fixme: add supports for auto import import dashboardModule from "./dashboard/module"; import postModule from "./contents/posts/module"; import pageModule from "./contents/pages/module"; diff --git a/console/src/modules/system/settings/SystemSettings.vue b/console/src/modules/system/settings/SystemSettings.vue index 91e3486a02..6c285ff3bb 100644 --- a/console/src/modules/system/settings/SystemSettings.vue +++ b/console/src/modules/system/settings/SystemSettings.vue @@ -18,6 +18,7 @@ import type { Component } from "vue"; import { markRaw } from "vue"; import SettingTab from "./tabs/Setting.vue"; import { useRouteQuery } from "@vueuse/router"; +import NotificationsTab from "./tabs/Notifications.vue"; const { t } = useI18n(); @@ -60,6 +61,13 @@ const { data: setting } = useQuery({ if (!activeTab.value) { activeTab.value = tabs.value[0].id; } + + // TODO: use integrations center to refactor this + tabs.value.push({ + id: "notification", + label: "通知设置", + component: markRaw(NotificationsTab), + }); } }, }); diff --git a/console/src/modules/system/settings/tabs/NotificationSetting.vue b/console/src/modules/system/settings/tabs/NotificationSetting.vue new file mode 100644 index 0000000000..30a0778d8f --- /dev/null +++ b/console/src/modules/system/settings/tabs/NotificationSetting.vue @@ -0,0 +1,102 @@ + + + diff --git a/console/src/modules/system/settings/tabs/Notifications.vue b/console/src/modules/system/settings/tabs/Notifications.vue new file mode 100644 index 0000000000..ebbe7b5392 --- /dev/null +++ b/console/src/modules/system/settings/tabs/Notifications.vue @@ -0,0 +1,74 @@ + + + diff --git a/console/src/modules/system/users/Notifications.vue b/console/src/modules/system/users/Notifications.vue new file mode 100644 index 0000000000..33374915f2 --- /dev/null +++ b/console/src/modules/system/users/Notifications.vue @@ -0,0 +1,129 @@ + + + diff --git a/console/src/modules/system/users/components/NotificationContent.vue b/console/src/modules/system/users/components/NotificationContent.vue new file mode 100644 index 0000000000..562a7cb901 --- /dev/null +++ b/console/src/modules/system/users/components/NotificationContent.vue @@ -0,0 +1,43 @@ + + + diff --git a/console/src/modules/system/users/components/NotificationListItem.vue b/console/src/modules/system/users/components/NotificationListItem.vue new file mode 100644 index 0000000000..ff7a633d3a --- /dev/null +++ b/console/src/modules/system/users/components/NotificationListItem.vue @@ -0,0 +1,91 @@ + + diff --git a/console/src/modules/system/users/module.ts b/console/src/modules/system/users/module.ts index d437af010b..9b0fa9f1b0 100644 --- a/console/src/modules/system/users/module.ts +++ b/console/src/modules/system/users/module.ts @@ -8,10 +8,13 @@ import Login from "./Login.vue"; import { IconUserSettings } from "@halo-dev/components"; import { markRaw } from "vue"; import Binding from "./Binding.vue"; +import Notifications from "./Notifications.vue"; +import NotificationWidget from "./widgets/NotificationWidget.vue"; export default definePlugin({ components: { UserStatsWidget, + NotificationWidget, }, routes: [ { @@ -72,6 +75,20 @@ export default definePlugin({ }, ], }, + { + path: "-/notifications", + component: BasicLayout, + children: [ + { + path: "", + name: "UserNotifications", + component: Notifications, + meta: { + title: "core.notification.title", + }, + }, + ], + }, ], }, ], diff --git a/console/src/modules/system/users/widgets/NotificationWidget.vue b/console/src/modules/system/users/widgets/NotificationWidget.vue new file mode 100644 index 0000000000..a054d012ca --- /dev/null +++ b/console/src/modules/system/users/widgets/NotificationWidget.vue @@ -0,0 +1,104 @@ + + + diff --git a/console/src/utils/api-client.ts b/console/src/utils/api-client.ts index 0a709fe1c9..fbcd484868 100644 --- a/console/src/utils/api-client.ts +++ b/console/src/utils/api-client.ts @@ -11,6 +11,8 @@ import { ApiConsoleHaloRunV1alpha1IndicesApi, ApiConsoleHaloRunV1alpha1AuthProviderApi, ApiConsoleHaloRunV1alpha1SystemApi, + ApiConsoleHaloRunV1alpha1NotifierApi, + ApiNotificationHaloRunV1alpha1NotificationApi, ContentHaloRunV1alpha1CategoryApi, ContentHaloRunV1alpha1CommentApi, ContentHaloRunV1alpha1PostApi, @@ -40,6 +42,7 @@ import { ApiHaloRunV1alpha1UserApi, MigrationHaloRunV1alpha1BackupApi, ApiConsoleMigrationHaloRunV1alpha1MigrationApi, + NotificationHaloRunV1alpha1NotifierDescriptorApi, ApiSecurityHaloRunV1alpha1PersonalAccessTokenApi, SecurityHaloRunV1alpha1PersonalAccessTokenApi, } from "@halo-dev/api-client"; @@ -180,6 +183,11 @@ function setupApiClient(axios: AxiosInstance) { axios ), backup: new MigrationHaloRunV1alpha1BackupApi(undefined, baseURL, axios), + notifierDescriptors: new NotificationHaloRunV1alpha1NotifierDescriptorApi( + undefined, + baseURL, + axios + ), pat: new SecurityHaloRunV1alpha1PersonalAccessTokenApi( undefined, baseURL, @@ -221,6 +229,16 @@ function setupApiClient(axios: AxiosInstance) { axios ), system: new ApiConsoleHaloRunV1alpha1SystemApi(undefined, baseURL, axios), + notifier: new ApiConsoleHaloRunV1alpha1NotifierApi( + undefined, + baseURL, + axios + ), + notification: new ApiNotificationHaloRunV1alpha1NotificationApi( + undefined, + baseURL, + axios + ), pat: new ApiSecurityHaloRunV1alpha1PersonalAccessTokenApi( undefined, baseURL,