mirror of https://github.com/halo-dev/halo
273 lines
12 KiB
TypeScript
273 lines
12 KiB
TypeScript
/* 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.21.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';
|
|
/**
|
|
* PolicyAlpha1ConsoleApi - axios parameter creator
|
|
* @export
|
|
*/
|
|
export const PolicyAlpha1ConsoleApiAxiosParamCreator = function (configuration?: Configuration) {
|
|
return {
|
|
/**
|
|
* Get policy config by group
|
|
* @param {string} name Name of the policy
|
|
* @param {string} group Name of the group
|
|
* @param {*} [options] Override http request option.
|
|
* @throws {RequiredError}
|
|
*/
|
|
getPolicyConfigByGroup: async (name: string, group: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
// verify required parameter 'name' is not null or undefined
|
|
assertParamExists('getPolicyConfigByGroup', 'name', name)
|
|
// verify required parameter 'group' is not null or undefined
|
|
assertParamExists('getPolicyConfigByGroup', 'group', group)
|
|
const localVarPath = `/apis/console.api.storage.halo.run/v1alpha1/policies/{name}/configs/{group}`
|
|
.replace(`{${"name"}}`, encodeURIComponent(String(name)))
|
|
.replace(`{${"group"}}`, encodeURIComponent(String(group)));
|
|
// 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,
|
|
};
|
|
},
|
|
/**
|
|
* Update policy config by group
|
|
* @param {string} name Name of the policy
|
|
* @param {string} group Name of the group
|
|
* @param {object} body
|
|
* @param {*} [options] Override http request option.
|
|
* @throws {RequiredError}
|
|
*/
|
|
updatePolicyConfigByGroup: async (name: string, group: string, body: object, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
// verify required parameter 'name' is not null or undefined
|
|
assertParamExists('updatePolicyConfigByGroup', 'name', name)
|
|
// verify required parameter 'group' is not null or undefined
|
|
assertParamExists('updatePolicyConfigByGroup', 'group', group)
|
|
// verify required parameter 'body' is not null or undefined
|
|
assertParamExists('updatePolicyConfigByGroup', 'body', body)
|
|
const localVarPath = `/apis/console.api.storage.halo.run/v1alpha1/policies/{name}/configs/{group}`
|
|
.replace(`{${"name"}}`, encodeURIComponent(String(name)))
|
|
.replace(`{${"group"}}`, encodeURIComponent(String(group)));
|
|
// 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(body, localVarRequestOptions, configuration)
|
|
|
|
return {
|
|
url: toPathString(localVarUrlObj),
|
|
options: localVarRequestOptions,
|
|
};
|
|
},
|
|
}
|
|
};
|
|
|
|
/**
|
|
* PolicyAlpha1ConsoleApi - functional programming interface
|
|
* @export
|
|
*/
|
|
export const PolicyAlpha1ConsoleApiFp = function(configuration?: Configuration) {
|
|
const localVarAxiosParamCreator = PolicyAlpha1ConsoleApiAxiosParamCreator(configuration)
|
|
return {
|
|
/**
|
|
* Get policy config by group
|
|
* @param {string} name Name of the policy
|
|
* @param {string} group Name of the group
|
|
* @param {*} [options] Override http request option.
|
|
* @throws {RequiredError}
|
|
*/
|
|
async getPolicyConfigByGroup(name: string, group: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<object>> {
|
|
const localVarAxiosArgs = await localVarAxiosParamCreator.getPolicyConfigByGroup(name, group, options);
|
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
const localVarOperationServerBasePath = operationServerMap['PolicyAlpha1ConsoleApi.getPolicyConfigByGroup']?.[localVarOperationServerIndex]?.url;
|
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
},
|
|
/**
|
|
* Update policy config by group
|
|
* @param {string} name Name of the policy
|
|
* @param {string} group Name of the group
|
|
* @param {object} body
|
|
* @param {*} [options] Override http request option.
|
|
* @throws {RequiredError}
|
|
*/
|
|
async updatePolicyConfigByGroup(name: string, group: string, body: object, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
|
|
const localVarAxiosArgs = await localVarAxiosParamCreator.updatePolicyConfigByGroup(name, group, body, options);
|
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
const localVarOperationServerBasePath = operationServerMap['PolicyAlpha1ConsoleApi.updatePolicyConfigByGroup']?.[localVarOperationServerIndex]?.url;
|
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
},
|
|
}
|
|
};
|
|
|
|
/**
|
|
* PolicyAlpha1ConsoleApi - factory interface
|
|
* @export
|
|
*/
|
|
export const PolicyAlpha1ConsoleApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
|
|
const localVarFp = PolicyAlpha1ConsoleApiFp(configuration)
|
|
return {
|
|
/**
|
|
* Get policy config by group
|
|
* @param {PolicyAlpha1ConsoleApiGetPolicyConfigByGroupRequest} requestParameters Request parameters.
|
|
* @param {*} [options] Override http request option.
|
|
* @throws {RequiredError}
|
|
*/
|
|
getPolicyConfigByGroup(requestParameters: PolicyAlpha1ConsoleApiGetPolicyConfigByGroupRequest, options?: RawAxiosRequestConfig): AxiosPromise<object> {
|
|
return localVarFp.getPolicyConfigByGroup(requestParameters.name, requestParameters.group, options).then((request) => request(axios, basePath));
|
|
},
|
|
/**
|
|
* Update policy config by group
|
|
* @param {PolicyAlpha1ConsoleApiUpdatePolicyConfigByGroupRequest} requestParameters Request parameters.
|
|
* @param {*} [options] Override http request option.
|
|
* @throws {RequiredError}
|
|
*/
|
|
updatePolicyConfigByGroup(requestParameters: PolicyAlpha1ConsoleApiUpdatePolicyConfigByGroupRequest, options?: RawAxiosRequestConfig): AxiosPromise<void> {
|
|
return localVarFp.updatePolicyConfigByGroup(requestParameters.name, requestParameters.group, requestParameters.body, options).then((request) => request(axios, basePath));
|
|
},
|
|
};
|
|
};
|
|
|
|
/**
|
|
* Request parameters for getPolicyConfigByGroup operation in PolicyAlpha1ConsoleApi.
|
|
* @export
|
|
* @interface PolicyAlpha1ConsoleApiGetPolicyConfigByGroupRequest
|
|
*/
|
|
export interface PolicyAlpha1ConsoleApiGetPolicyConfigByGroupRequest {
|
|
/**
|
|
* Name of the policy
|
|
* @type {string}
|
|
* @memberof PolicyAlpha1ConsoleApiGetPolicyConfigByGroup
|
|
*/
|
|
readonly name: string
|
|
|
|
/**
|
|
* Name of the group
|
|
* @type {string}
|
|
* @memberof PolicyAlpha1ConsoleApiGetPolicyConfigByGroup
|
|
*/
|
|
readonly group: string
|
|
}
|
|
|
|
/**
|
|
* Request parameters for updatePolicyConfigByGroup operation in PolicyAlpha1ConsoleApi.
|
|
* @export
|
|
* @interface PolicyAlpha1ConsoleApiUpdatePolicyConfigByGroupRequest
|
|
*/
|
|
export interface PolicyAlpha1ConsoleApiUpdatePolicyConfigByGroupRequest {
|
|
/**
|
|
* Name of the policy
|
|
* @type {string}
|
|
* @memberof PolicyAlpha1ConsoleApiUpdatePolicyConfigByGroup
|
|
*/
|
|
readonly name: string
|
|
|
|
/**
|
|
* Name of the group
|
|
* @type {string}
|
|
* @memberof PolicyAlpha1ConsoleApiUpdatePolicyConfigByGroup
|
|
*/
|
|
readonly group: string
|
|
|
|
/**
|
|
*
|
|
* @type {object}
|
|
* @memberof PolicyAlpha1ConsoleApiUpdatePolicyConfigByGroup
|
|
*/
|
|
readonly body: object
|
|
}
|
|
|
|
/**
|
|
* PolicyAlpha1ConsoleApi - object-oriented interface
|
|
* @export
|
|
* @class PolicyAlpha1ConsoleApi
|
|
* @extends {BaseAPI}
|
|
*/
|
|
export class PolicyAlpha1ConsoleApi extends BaseAPI {
|
|
/**
|
|
* Get policy config by group
|
|
* @param {PolicyAlpha1ConsoleApiGetPolicyConfigByGroupRequest} requestParameters Request parameters.
|
|
* @param {*} [options] Override http request option.
|
|
* @throws {RequiredError}
|
|
* @memberof PolicyAlpha1ConsoleApi
|
|
*/
|
|
public getPolicyConfigByGroup(requestParameters: PolicyAlpha1ConsoleApiGetPolicyConfigByGroupRequest, options?: RawAxiosRequestConfig) {
|
|
return PolicyAlpha1ConsoleApiFp(this.configuration).getPolicyConfigByGroup(requestParameters.name, requestParameters.group, options).then((request) => request(this.axios, this.basePath));
|
|
}
|
|
|
|
/**
|
|
* Update policy config by group
|
|
* @param {PolicyAlpha1ConsoleApiUpdatePolicyConfigByGroupRequest} requestParameters Request parameters.
|
|
* @param {*} [options] Override http request option.
|
|
* @throws {RequiredError}
|
|
* @memberof PolicyAlpha1ConsoleApi
|
|
*/
|
|
public updatePolicyConfigByGroup(requestParameters: PolicyAlpha1ConsoleApiUpdatePolicyConfigByGroupRequest, options?: RawAxiosRequestConfig) {
|
|
return PolicyAlpha1ConsoleApiFp(this.configuration).updatePolicyConfigByGroup(requestParameters.name, requestParameters.group, requestParameters.body, options).then((request) => request(this.axios, this.basePath));
|
|
}
|
|
}
|
|
|