UNPKG

jack-service-accounts-sdk

Version:
239 lines (216 loc) 11.4 kB
/* tslint:disable */ /* eslint-disable */ /** * sso.redhat.com API documentation * This is the API documentation for sso.redhat.com * * The version of the OpenAPI document: 5.0.19-SNAPSHOT * Contact: it-user-team-list@redhat.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import globalAxios, { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; import { Configuration } from '../configuration'; // 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 { AcsClientRequestData } from '../model'; // @ts-ignore import { AcsClientResponseData } from '../model'; // @ts-ignore import { RedHatErrorRepresentation } from '../model'; // @ts-ignore import { ValidationExceptionData } from '../model'; /** * AcsTenantsApi - axios parameter creator * @export */ export const AcsTenantsApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * Create an ACS managed central client. Created ACS managed central clients are associated with the supplied organization id. * @summary Create ACS managed central client * @param {AcsClientRequestData} acsClientRequestData The name, redirect URIs and the organization id of the ACS managed central client * @param {*} [options] Override http request option. * @throws {RequiredError} */ createAcsClient: async (acsClientRequestData: AcsClientRequestData, options: AxiosRequestConfig = {}): Promise<RequestArgs> => { // verify required parameter 'acsClientRequestData' is not null or undefined assertParamExists('createAcsClient', 'acsClientRequestData', acsClientRequestData) const localVarPath = `/apis/beta/acs/v1`; // 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 serviceAccounts required // oauth required await setOAuthToObject(localVarHeaderParameter, "serviceAccounts", ["api.iam.clients"], 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(acsClientRequestData, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Delete ACS managed central client by clientId. Throws not found exception if the client is not found * @summary Delete ACS managed central client * @param {string} clientId * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteAcsClient: async (clientId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => { // verify required parameter 'clientId' is not null or undefined assertParamExists('deleteAcsClient', 'clientId', clientId) const localVarPath = `/apis/beta/acs/v1/{clientId}` .replace(`{${"clientId"}}`, encodeURIComponent(String(clientId))); // 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 serviceAccounts required // oauth required await setOAuthToObject(localVarHeaderParameter, "serviceAccounts", ["api.iam.clients"], configuration) setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, } }; /** * AcsTenantsApi - functional programming interface * @export */ export const AcsTenantsApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = AcsTenantsApiAxiosParamCreator(configuration) return { /** * Create an ACS managed central client. Created ACS managed central clients are associated with the supplied organization id. * @summary Create ACS managed central client * @param {AcsClientRequestData} acsClientRequestData The name, redirect URIs and the organization id of the ACS managed central client * @param {*} [options] Override http request option. * @throws {RequiredError} */ async createAcsClient(acsClientRequestData: AcsClientRequestData, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AcsClientResponseData>> { const localVarAxiosArgs = await localVarAxiosParamCreator.createAcsClient(acsClientRequestData, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Delete ACS managed central client by clientId. Throws not found exception if the client is not found * @summary Delete ACS managed central client * @param {string} clientId * @param {*} [options] Override http request option. * @throws {RequiredError} */ async deleteAcsClient(clientId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteAcsClient(clientId, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } }; /** * AcsTenantsApi - factory interface * @export */ export const AcsTenantsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = AcsTenantsApiFp(configuration) return { /** * Create an ACS managed central client. Created ACS managed central clients are associated with the supplied organization id. * @summary Create ACS managed central client * @param {AcsClientRequestData} acsClientRequestData The name, redirect URIs and the organization id of the ACS managed central client * @param {*} [options] Override http request option. * @throws {RequiredError} */ createAcsClient(acsClientRequestData: AcsClientRequestData, options?: any): AxiosPromise<AcsClientResponseData> { return localVarFp.createAcsClient(acsClientRequestData, options).then((request) => request(axios, basePath)); }, /** * Delete ACS managed central client by clientId. Throws not found exception if the client is not found * @summary Delete ACS managed central client * @param {string} clientId * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteAcsClient(clientId: string, options?: any): AxiosPromise<void> { return localVarFp.deleteAcsClient(clientId, options).then((request) => request(axios, basePath)); }, }; }; /** * AcsTenantsApi - interface * @export * @interface AcsTenantsApi */ export interface AcsTenantsApiInterface { /** * Create an ACS managed central client. Created ACS managed central clients are associated with the supplied organization id. * @summary Create ACS managed central client * @param {AcsClientRequestData} acsClientRequestData The name, redirect URIs and the organization id of the ACS managed central client * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AcsTenantsApiInterface */ createAcsClient(acsClientRequestData: AcsClientRequestData, options?: AxiosRequestConfig): AxiosPromise<AcsClientResponseData>; /** * Delete ACS managed central client by clientId. Throws not found exception if the client is not found * @summary Delete ACS managed central client * @param {string} clientId * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AcsTenantsApiInterface */ deleteAcsClient(clientId: string, options?: AxiosRequestConfig): AxiosPromise<void>; } /** * AcsTenantsApi - object-oriented interface * @export * @class AcsTenantsApi * @extends {BaseAPI} */ export class AcsTenantsApi extends BaseAPI implements AcsTenantsApiInterface { /** * Create an ACS managed central client. Created ACS managed central clients are associated with the supplied organization id. * @summary Create ACS managed central client * @param {AcsClientRequestData} acsClientRequestData The name, redirect URIs and the organization id of the ACS managed central client * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AcsTenantsApi */ public createAcsClient(acsClientRequestData: AcsClientRequestData, options?: AxiosRequestConfig) { return AcsTenantsApiFp(this.configuration).createAcsClient(acsClientRequestData, options).then((request) => request(this.axios, this.basePath)); } /** * Delete ACS managed central client by clientId. Throws not found exception if the client is not found * @summary Delete ACS managed central client * @param {string} clientId * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AcsTenantsApi */ public deleteAcsClient(clientId: string, options?: AxiosRequestConfig) { return AcsTenantsApiFp(this.configuration).deleteAcsClient(clientId, options).then((request) => request(this.axios, this.basePath)); } }