fix: correct the kind definition in the Device extension (#6222)

#### What type of PR is this?

/area core
/kind bug
/milestone 2.17.x

#### What this PR does / why we need it:

修复 Device 模型中,Kind 定义错误的问题。

#### Which issue(s) this PR fixes:

Fixes https://github.com/halo-dev/halo/issues/6221

#### Does this PR introduce a user-facing change?

```release-note
None 
```
pull/6176/head
Ryan Wang 2024-07-01 11:05:16 +08:00 committed by GitHub
parent 9e1cd02c41
commit ceb97458d4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 828 additions and 163 deletions

View File

@ -12186,8 +12186,8 @@
},
"/apis/security.halo.run/v1alpha1/devices": {
"get": {
"description": "List v1alpha1",
"operationId": "listv1alpha1",
"description": "List Device",
"operationId": "listDevice",
"parameters": [
{
"description": "Page number. Default is 0.",
@ -12246,7 +12246,7 @@
"content": {
"*/*": {
"schema": {
"$ref": "#/components/schemas/v1alpha1List"
"$ref": "#/components/schemas/DeviceList"
}
}
},
@ -12254,12 +12254,12 @@
}
},
"tags": [
"v1alpha1V1alpha1"
"DeviceV1alpha1"
]
},
"post": {
"description": "Create v1alpha1",
"operationId": "createv1alpha1",
"description": "Create Device",
"operationId": "createDevice",
"requestBody": {
"content": {
"*/*": {
@ -12283,14 +12283,14 @@
}
},
"tags": [
"v1alpha1V1alpha1"
"DeviceV1alpha1"
]
}
},
"/apis/security.halo.run/v1alpha1/devices/{name}": {
"delete": {
"description": "Delete v1alpha1",
"operationId": "deletev1alpha1",
"description": "Delete Device",
"operationId": "deleteDevice",
"parameters": [
{
"description": "Name of device",
@ -12308,12 +12308,12 @@
}
},
"tags": [
"v1alpha1V1alpha1"
"DeviceV1alpha1"
]
},
"get": {
"description": "Get v1alpha1",
"operationId": "getv1alpha1",
"description": "Get Device",
"operationId": "getDevice",
"parameters": [
{
"description": "Name of device",
@ -12338,12 +12338,12 @@
}
},
"tags": [
"v1alpha1V1alpha1"
"DeviceV1alpha1"
]
},
"patch": {
"description": "Patch v1alpha1",
"operationId": "patchv1alpha1",
"description": "Patch Device",
"operationId": "patchDevice",
"parameters": [
{
"description": "Name of device",
@ -12377,12 +12377,12 @@
}
},
"tags": [
"v1alpha1V1alpha1"
"DeviceV1alpha1"
]
},
"put": {
"description": "Update v1alpha1",
"operationId": "updatev1alpha1",
"description": "Update Device",
"operationId": "updateDevice",
"parameters": [
{
"description": "Name of device",
@ -12417,7 +12417,7 @@
}
},
"tags": [
"v1alpha1V1alpha1"
"DeviceV1alpha1"
]
}
},
@ -16646,6 +16646,65 @@
}
}
},
"DeviceList": {
"required": [
"first",
"hasNext",
"hasPrevious",
"items",
"last",
"page",
"size",
"total",
"totalPages"
],
"type": "object",
"properties": {
"first": {
"type": "boolean",
"description": "Indicates whether current page is the first page."
},
"hasNext": {
"type": "boolean",
"description": "Indicates whether current page has previous page."
},
"hasPrevious": {
"type": "boolean",
"description": "Indicates whether current page has previous page."
},
"items": {
"type": "array",
"description": "A chunk of items.",
"items": {
"$ref": "#/components/schemas/Device"
}
},
"last": {
"type": "boolean",
"description": "Indicates whether current page is the last page."
},
"page": {
"type": "integer",
"description": "Page number, starts from 1. If not set or equal to 0, it means no pagination.",
"format": "int32"
},
"size": {
"type": "integer",
"description": "Size of each page. If not set or equal to 0, it means no pagination.",
"format": "int32"
},
"total": {
"type": "integer",
"description": "Total elements.",
"format": "int64"
},
"totalPages": {
"type": "integer",
"description": "Indicates total pages.",
"format": "int64"
}
}
},
"DeviceSpec": {
"required": [
"ipAddress",
@ -22939,65 +22998,6 @@
"type": "string"
}
}
},
"v1alpha1List": {
"required": [
"first",
"hasNext",
"hasPrevious",
"items",
"last",
"page",
"size",
"total",
"totalPages"
],
"type": "object",
"properties": {
"first": {
"type": "boolean",
"description": "Indicates whether current page is the first page."
},
"hasNext": {
"type": "boolean",
"description": "Indicates whether current page has previous page."
},
"hasPrevious": {
"type": "boolean",
"description": "Indicates whether current page has previous page."
},
"items": {
"type": "array",
"description": "A chunk of items.",
"items": {
"$ref": "#/components/schemas/Device"
}
},
"last": {
"type": "boolean",
"description": "Indicates whether current page is the last page."
},
"page": {
"type": "integer",
"description": "Page number, starts from 1. If not set or equal to 0, it means no pagination.",
"format": "int32"
},
"size": {
"type": "integer",
"description": "Size of each page. If not set or equal to 0, it means no pagination.",
"format": "int32"
},
"total": {
"type": "integer",
"description": "Total elements.",
"format": "int64"
},
"totalPages": {
"type": "integer",
"description": "Indicates total pages.",
"format": "int64"
}
}
}
},
"securitySchemes": {

View File

@ -5944,8 +5944,8 @@
},
"/apis/security.halo.run/v1alpha1/devices": {
"get": {
"description": "List v1alpha1",
"operationId": "listv1alpha1",
"description": "List Device",
"operationId": "listDevice",
"parameters": [
{
"description": "Page number. Default is 0.",
@ -6004,7 +6004,7 @@
"content": {
"*/*": {
"schema": {
"$ref": "#/components/schemas/v1alpha1List"
"$ref": "#/components/schemas/DeviceList"
}
}
},
@ -6012,12 +6012,12 @@
}
},
"tags": [
"v1alpha1V1alpha1"
"DeviceV1alpha1"
]
},
"post": {
"description": "Create v1alpha1",
"operationId": "createv1alpha1",
"description": "Create Device",
"operationId": "createDevice",
"requestBody": {
"content": {
"*/*": {
@ -6041,14 +6041,14 @@
}
},
"tags": [
"v1alpha1V1alpha1"
"DeviceV1alpha1"
]
}
},
"/apis/security.halo.run/v1alpha1/devices/{name}": {
"delete": {
"description": "Delete v1alpha1",
"operationId": "deletev1alpha1",
"description": "Delete Device",
"operationId": "deleteDevice",
"parameters": [
{
"description": "Name of device",
@ -6066,12 +6066,12 @@
}
},
"tags": [
"v1alpha1V1alpha1"
"DeviceV1alpha1"
]
},
"get": {
"description": "Get v1alpha1",
"operationId": "getv1alpha1",
"description": "Get Device",
"operationId": "getDevice",
"parameters": [
{
"description": "Name of device",
@ -6096,12 +6096,12 @@
}
},
"tags": [
"v1alpha1V1alpha1"
"DeviceV1alpha1"
]
},
"patch": {
"description": "Patch v1alpha1",
"operationId": "patchv1alpha1",
"description": "Patch Device",
"operationId": "patchDevice",
"parameters": [
{
"description": "Name of device",
@ -6135,12 +6135,12 @@
}
},
"tags": [
"v1alpha1V1alpha1"
"DeviceV1alpha1"
]
},
"put": {
"description": "Update v1alpha1",
"operationId": "updatev1alpha1",
"description": "Update Device",
"operationId": "updateDevice",
"parameters": [
{
"description": "Name of device",
@ -6175,7 +6175,7 @@
}
},
"tags": [
"v1alpha1V1alpha1"
"DeviceV1alpha1"
]
}
},
@ -9042,6 +9042,65 @@
}
}
},
"DeviceList": {
"required": [
"first",
"hasNext",
"hasPrevious",
"items",
"last",
"page",
"size",
"total",
"totalPages"
],
"type": "object",
"properties": {
"first": {
"type": "boolean",
"description": "Indicates whether current page is the first page."
},
"hasNext": {
"type": "boolean",
"description": "Indicates whether current page has previous page."
},
"hasPrevious": {
"type": "boolean",
"description": "Indicates whether current page has previous page."
},
"items": {
"type": "array",
"description": "A chunk of items.",
"items": {
"$ref": "#/components/schemas/Device"
}
},
"last": {
"type": "boolean",
"description": "Indicates whether current page is the last page."
},
"page": {
"type": "integer",
"description": "Page number, starts from 1. If not set or equal to 0, it means no pagination.",
"format": "int32"
},
"size": {
"type": "integer",
"description": "Size of each page. If not set or equal to 0, it means no pagination.",
"format": "int32"
},
"total": {
"type": "integer",
"description": "Total elements.",
"format": "int64"
},
"totalPages": {
"type": "integer",
"description": "Indicates total pages.",
"format": "int64"
}
}
},
"DeviceSpec": {
"required": [
"ipAddress",
@ -12624,65 +12683,6 @@
"type": "string"
}
}
},
"v1alpha1List": {
"required": [
"first",
"hasNext",
"hasPrevious",
"items",
"last",
"page",
"size",
"total",
"totalPages"
],
"type": "object",
"properties": {
"first": {
"type": "boolean",
"description": "Indicates whether current page is the first page."
},
"hasNext": {
"type": "boolean",
"description": "Indicates whether current page has previous page."
},
"hasPrevious": {
"type": "boolean",
"description": "Indicates whether current page has previous page."
},
"items": {
"type": "array",
"description": "A chunk of items.",
"items": {
"$ref": "#/components/schemas/Device"
}
},
"last": {
"type": "boolean",
"description": "Indicates whether current page is the last page."
},
"page": {
"type": "integer",
"description": "Page number, starts from 1. If not set or equal to 0, it means no pagination.",
"format": "int32"
},
"size": {
"type": "integer",
"description": "Size of each page. If not set or equal to 0, it means no pagination.",
"format": "int32"
},
"total": {
"type": "integer",
"description": "Total elements.",
"format": "int64"
},
"totalPages": {
"type": "integer",
"description": "Indicates total pages.",
"format": "int64"
}
}
}
},
"securitySchemes": {

View File

@ -19,7 +19,7 @@ import run.halo.app.extension.GVK;
public class Device extends AbstractExtension {
public static final String GROUP = "security.halo.run";
public static final String VERSION = "v1alpha1";
public static final String KIND = "v1alpha1";
public static final String KIND = "Device";
@Schema(requiredMode = REQUIRED)
private Spec spec;

View File

@ -16,6 +16,7 @@ api/comment-v1alpha1-console-api.ts
api/comment-v1alpha1-public-api.ts
api/config-map-v1alpha1-api.ts
api/counter-v1alpha1-api.ts
api/device-v1alpha1-api.ts
api/device-v1alpha1-uc-api.ts
api/extension-definition-v1alpha1-api.ts
api/extension-point-definition-v1alpha1-api.ts
@ -74,7 +75,6 @@ api/user-connection-v1alpha1-api.ts
api/user-v1alpha1-api.ts
api/user-v1alpha1-console-api.ts
api/user-v1alpha1-public-api.ts
api/v1alpha1-v1alpha1-api.ts
base.ts
common.ts
configuration.ts
@ -135,6 +135,7 @@ models/create-user-request.ts
models/custom-templates.ts
models/dashboard-stats.ts
models/detailed-user.ts
models/device-list.ts
models/device-spec.ts
models/device-status.ts
models/device.ts
@ -327,6 +328,5 @@ models/user-permission.ts
models/user-spec.ts
models/user-status.ts
models/user.ts
models/v1alpha1-list.ts
models/verify-code-request.ts
models/vote-request.ts

View File

@ -29,6 +29,7 @@ export * from './api/comment-v1alpha1-console-api';
export * from './api/comment-v1alpha1-public-api';
export * from './api/config-map-v1alpha1-api';
export * from './api/counter-v1alpha1-api';
export * from './api/device-v1alpha1-api';
export * from './api/device-v1alpha1-uc-api';
export * from './api/extension-definition-v1alpha1-api';
export * from './api/extension-point-definition-v1alpha1-api';
@ -87,5 +88,4 @@ export * from './api/user-connection-v1alpha1-api';
export * from './api/user-v1alpha1-api';
export * from './api/user-v1alpha1-console-api';
export * from './api/user-v1alpha1-public-api';
export * from './api/v1alpha1-v1alpha1-api';

View File

@ -0,0 +1,665 @@
/* tslint:disable */
/* eslint-disable */
/**
* Halo
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.17.0-SNAPSHOT
*
*
* 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, RawAxiosRequestConfig } 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, operationServerMap } from '../base';
// @ts-ignore
import { Device } from '../models';
// @ts-ignore
import { DeviceList } from '../models';
// @ts-ignore
import { JsonPatchInner } from '../models';
/**
* DeviceV1alpha1Api - axios parameter creator
* @export
*/
export const DeviceV1alpha1ApiAxiosParamCreator = function (configuration?: Configuration) {
return {
/**
* Create Device
* @param {Device} [device] Fresh device
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createDevice: async (device?: Device, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/apis/security.halo.run/v1alpha1/devices`;
// 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(device, localVarRequestOptions, configuration)
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Delete Device
* @param {string} name Name of device
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
deleteDevice: async (name: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'name' is not null or undefined
assertParamExists('deleteDevice', 'name', name)
const localVarPath = `/apis/security.halo.run/v1alpha1/devices/{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 Device
* @param {string} name Name of device
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getDevice: async (name: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'name' is not null or undefined
assertParamExists('getDevice', 'name', name)
const localVarPath = `/apis/security.halo.run/v1alpha1/devices/{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 Device
* @param {number} [page] Page number. Default is 0.
* @param {number} [size] Size number. Default is 0.
* @param {Array<string>} [labelSelector] Label selector. e.g.: hidden!&#x3D;true
* @param {Array<string>} [fieldSelector] Field selector. e.g.: metadata.name&#x3D;&#x3D;halo
* @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
listDevice: async (page?: number, size?: number, labelSelector?: Array<string>, fieldSelector?: Array<string>, sort?: Array<string>, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/apis/security.halo.run/v1alpha1/devices`;
// 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 (page !== undefined) {
localVarQueryParameter['page'] = page;
}
if (size !== undefined) {
localVarQueryParameter['size'] = size;
}
if (labelSelector) {
localVarQueryParameter['labelSelector'] = labelSelector;
}
if (fieldSelector) {
localVarQueryParameter['fieldSelector'] = fieldSelector;
}
if (sort) {
localVarQueryParameter['sort'] = sort;
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Patch Device
* @param {string} name Name of device
* @param {Array<JsonPatchInner>} [jsonPatchInner]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
patchDevice: async (name: string, jsonPatchInner?: Array<JsonPatchInner>, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'name' is not null or undefined
assertParamExists('patchDevice', 'name', name)
const localVarPath = `/apis/security.halo.run/v1alpha1/devices/{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: 'PATCH', ...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-patch+json';
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
localVarRequestOptions.data = serializeDataIfNeeded(jsonPatchInner, localVarRequestOptions, configuration)
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Update Device
* @param {string} name Name of device
* @param {Device} [device] Updated device
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateDevice: async (name: string, device?: Device, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'name' is not null or undefined
assertParamExists('updateDevice', 'name', name)
const localVarPath = `/apis/security.halo.run/v1alpha1/devices/{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(device, localVarRequestOptions, configuration)
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
}
};
/**
* DeviceV1alpha1Api - functional programming interface
* @export
*/
export const DeviceV1alpha1ApiFp = function(configuration?: Configuration) {
const localVarAxiosParamCreator = DeviceV1alpha1ApiAxiosParamCreator(configuration)
return {
/**
* Create Device
* @param {Device} [device] Fresh device
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async createDevice(device?: Device, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Device>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.createDevice(device, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['DeviceV1alpha1Api.createDevice']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
* Delete Device
* @param {string} name Name of device
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async deleteDevice(name: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.deleteDevice(name, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['DeviceV1alpha1Api.deleteDevice']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
* Get Device
* @param {string} name Name of device
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getDevice(name: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Device>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.getDevice(name, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['DeviceV1alpha1Api.getDevice']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
* List Device
* @param {number} [page] Page number. Default is 0.
* @param {number} [size] Size number. Default is 0.
* @param {Array<string>} [labelSelector] Label selector. e.g.: hidden!&#x3D;true
* @param {Array<string>} [fieldSelector] Field selector. e.g.: metadata.name&#x3D;&#x3D;halo
* @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async listDevice(page?: number, size?: number, labelSelector?: Array<string>, fieldSelector?: Array<string>, sort?: Array<string>, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<DeviceList>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.listDevice(page, size, labelSelector, fieldSelector, sort, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['DeviceV1alpha1Api.listDevice']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
* Patch Device
* @param {string} name Name of device
* @param {Array<JsonPatchInner>} [jsonPatchInner]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async patchDevice(name: string, jsonPatchInner?: Array<JsonPatchInner>, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Device>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.patchDevice(name, jsonPatchInner, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['DeviceV1alpha1Api.patchDevice']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
* Update Device
* @param {string} name Name of device
* @param {Device} [device] Updated device
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async updateDevice(name: string, device?: Device, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Device>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.updateDevice(name, device, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['DeviceV1alpha1Api.updateDevice']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
}
};
/**
* DeviceV1alpha1Api - factory interface
* @export
*/
export const DeviceV1alpha1ApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
const localVarFp = DeviceV1alpha1ApiFp(configuration)
return {
/**
* Create Device
* @param {DeviceV1alpha1ApiCreateDeviceRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createDevice(requestParameters: DeviceV1alpha1ApiCreateDeviceRequest = {}, options?: RawAxiosRequestConfig): AxiosPromise<Device> {
return localVarFp.createDevice(requestParameters.device, options).then((request) => request(axios, basePath));
},
/**
* Delete Device
* @param {DeviceV1alpha1ApiDeleteDeviceRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
deleteDevice(requestParameters: DeviceV1alpha1ApiDeleteDeviceRequest, options?: RawAxiosRequestConfig): AxiosPromise<void> {
return localVarFp.deleteDevice(requestParameters.name, options).then((request) => request(axios, basePath));
},
/**
* Get Device
* @param {DeviceV1alpha1ApiGetDeviceRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getDevice(requestParameters: DeviceV1alpha1ApiGetDeviceRequest, options?: RawAxiosRequestConfig): AxiosPromise<Device> {
return localVarFp.getDevice(requestParameters.name, options).then((request) => request(axios, basePath));
},
/**
* List Device
* @param {DeviceV1alpha1ApiListDeviceRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
listDevice(requestParameters: DeviceV1alpha1ApiListDeviceRequest = {}, options?: RawAxiosRequestConfig): AxiosPromise<DeviceList> {
return localVarFp.listDevice(requestParameters.page, requestParameters.size, requestParameters.labelSelector, requestParameters.fieldSelector, requestParameters.sort, options).then((request) => request(axios, basePath));
},
/**
* Patch Device
* @param {DeviceV1alpha1ApiPatchDeviceRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
patchDevice(requestParameters: DeviceV1alpha1ApiPatchDeviceRequest, options?: RawAxiosRequestConfig): AxiosPromise<Device> {
return localVarFp.patchDevice(requestParameters.name, requestParameters.jsonPatchInner, options).then((request) => request(axios, basePath));
},
/**
* Update Device
* @param {DeviceV1alpha1ApiUpdateDeviceRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateDevice(requestParameters: DeviceV1alpha1ApiUpdateDeviceRequest, options?: RawAxiosRequestConfig): AxiosPromise<Device> {
return localVarFp.updateDevice(requestParameters.name, requestParameters.device, options).then((request) => request(axios, basePath));
},
};
};
/**
* Request parameters for createDevice operation in DeviceV1alpha1Api.
* @export
* @interface DeviceV1alpha1ApiCreateDeviceRequest
*/
export interface DeviceV1alpha1ApiCreateDeviceRequest {
/**
* Fresh device
* @type {Device}
* @memberof DeviceV1alpha1ApiCreateDevice
*/
readonly device?: Device
}
/**
* Request parameters for deleteDevice operation in DeviceV1alpha1Api.
* @export
* @interface DeviceV1alpha1ApiDeleteDeviceRequest
*/
export interface DeviceV1alpha1ApiDeleteDeviceRequest {
/**
* Name of device
* @type {string}
* @memberof DeviceV1alpha1ApiDeleteDevice
*/
readonly name: string
}
/**
* Request parameters for getDevice operation in DeviceV1alpha1Api.
* @export
* @interface DeviceV1alpha1ApiGetDeviceRequest
*/
export interface DeviceV1alpha1ApiGetDeviceRequest {
/**
* Name of device
* @type {string}
* @memberof DeviceV1alpha1ApiGetDevice
*/
readonly name: string
}
/**
* Request parameters for listDevice operation in DeviceV1alpha1Api.
* @export
* @interface DeviceV1alpha1ApiListDeviceRequest
*/
export interface DeviceV1alpha1ApiListDeviceRequest {
/**
* Page number. Default is 0.
* @type {number}
* @memberof DeviceV1alpha1ApiListDevice
*/
readonly page?: number
/**
* Size number. Default is 0.
* @type {number}
* @memberof DeviceV1alpha1ApiListDevice
*/
readonly size?: number
/**
* Label selector. e.g.: hidden!&#x3D;true
* @type {Array<string>}
* @memberof DeviceV1alpha1ApiListDevice
*/
readonly labelSelector?: Array<string>
/**
* Field selector. e.g.: metadata.name&#x3D;&#x3D;halo
* @type {Array<string>}
* @memberof DeviceV1alpha1ApiListDevice
*/
readonly fieldSelector?: Array<string>
/**
* Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
* @type {Array<string>}
* @memberof DeviceV1alpha1ApiListDevice
*/
readonly sort?: Array<string>
}
/**
* Request parameters for patchDevice operation in DeviceV1alpha1Api.
* @export
* @interface DeviceV1alpha1ApiPatchDeviceRequest
*/
export interface DeviceV1alpha1ApiPatchDeviceRequest {
/**
* Name of device
* @type {string}
* @memberof DeviceV1alpha1ApiPatchDevice
*/
readonly name: string
/**
*
* @type {Array<JsonPatchInner>}
* @memberof DeviceV1alpha1ApiPatchDevice
*/
readonly jsonPatchInner?: Array<JsonPatchInner>
}
/**
* Request parameters for updateDevice operation in DeviceV1alpha1Api.
* @export
* @interface DeviceV1alpha1ApiUpdateDeviceRequest
*/
export interface DeviceV1alpha1ApiUpdateDeviceRequest {
/**
* Name of device
* @type {string}
* @memberof DeviceV1alpha1ApiUpdateDevice
*/
readonly name: string
/**
* Updated device
* @type {Device}
* @memberof DeviceV1alpha1ApiUpdateDevice
*/
readonly device?: Device
}
/**
* DeviceV1alpha1Api - object-oriented interface
* @export
* @class DeviceV1alpha1Api
* @extends {BaseAPI}
*/
export class DeviceV1alpha1Api extends BaseAPI {
/**
* Create Device
* @param {DeviceV1alpha1ApiCreateDeviceRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof DeviceV1alpha1Api
*/
public createDevice(requestParameters: DeviceV1alpha1ApiCreateDeviceRequest = {}, options?: RawAxiosRequestConfig) {
return DeviceV1alpha1ApiFp(this.configuration).createDevice(requestParameters.device, options).then((request) => request(this.axios, this.basePath));
}
/**
* Delete Device
* @param {DeviceV1alpha1ApiDeleteDeviceRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof DeviceV1alpha1Api
*/
public deleteDevice(requestParameters: DeviceV1alpha1ApiDeleteDeviceRequest, options?: RawAxiosRequestConfig) {
return DeviceV1alpha1ApiFp(this.configuration).deleteDevice(requestParameters.name, options).then((request) => request(this.axios, this.basePath));
}
/**
* Get Device
* @param {DeviceV1alpha1ApiGetDeviceRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof DeviceV1alpha1Api
*/
public getDevice(requestParameters: DeviceV1alpha1ApiGetDeviceRequest, options?: RawAxiosRequestConfig) {
return DeviceV1alpha1ApiFp(this.configuration).getDevice(requestParameters.name, options).then((request) => request(this.axios, this.basePath));
}
/**
* List Device
* @param {DeviceV1alpha1ApiListDeviceRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof DeviceV1alpha1Api
*/
public listDevice(requestParameters: DeviceV1alpha1ApiListDeviceRequest = {}, options?: RawAxiosRequestConfig) {
return DeviceV1alpha1ApiFp(this.configuration).listDevice(requestParameters.page, requestParameters.size, requestParameters.labelSelector, requestParameters.fieldSelector, requestParameters.sort, options).then((request) => request(this.axios, this.basePath));
}
/**
* Patch Device
* @param {DeviceV1alpha1ApiPatchDeviceRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof DeviceV1alpha1Api
*/
public patchDevice(requestParameters: DeviceV1alpha1ApiPatchDeviceRequest, options?: RawAxiosRequestConfig) {
return DeviceV1alpha1ApiFp(this.configuration).patchDevice(requestParameters.name, requestParameters.jsonPatchInner, options).then((request) => request(this.axios, this.basePath));
}
/**
* Update Device
* @param {DeviceV1alpha1ApiUpdateDeviceRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof DeviceV1alpha1Api
*/
public updateDevice(requestParameters: DeviceV1alpha1ApiUpdateDeviceRequest, options?: RawAxiosRequestConfig) {
return DeviceV1alpha1ApiFp(this.configuration).updateDevice(requestParameters.name, requestParameters.device, options).then((request) => request(this.axios, this.basePath));
}
}

View File

@ -1,10 +1,10 @@
/* tslint:disable */
/* eslint-disable */
/**
* Halo Next API
* Halo
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.0.0
* The version of the OpenAPI document: 2.17.0-SNAPSHOT
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@ -54,6 +54,7 @@ export * from './custom-templates';
export * from './dashboard-stats';
export * from './detailed-user';
export * from './device';
export * from './device-list';
export * from './device-spec';
export * from './device-status';
export * from './email-config-validation-request';
@ -244,6 +245,5 @@ export * from './user-list';
export * from './user-permission';
export * from './user-spec';
export * from './user-status';
export * from './v1alpha1-list';
export * from './verify-code-request';
export * from './vote-request';