/* tslint:disable */ /* eslint-disable */ /** * The Association for Cube Commons * The CubeCommons API caters to each and every whim of the Frontend, i.e. it receives, bundles, packages and formats data exactly as the Frontend needs it. * * The version of the OpenAPI document: 0.9.95 * Contact: tech@cubecommons.ca * * 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 { CreateProfileRequest } from '../models'; // @ts-ignore import { CreateProfileResponse } from '../models'; // @ts-ignore import { ErrorResponse } from '../models'; // @ts-ignore import { GetProfileResponse } from '../models'; // @ts-ignore import { UpdateProfileRequest } from '../models'; // @ts-ignore import { UpdateProfileResponse } from '../models'; /** * ProfileApi - axios parameter creator * @export */ export const ProfileApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * Create Profile * @summary Create Profile * @param {CreateProfileRequest} createProfileRequest Create Profile Request * @param {*} [options] Override http request option. * @throws {RequiredError} */ createProfile: async (createProfileRequest: CreateProfileRequest, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'createProfileRequest' is not null or undefined assertParamExists('createProfile', 'createProfileRequest', createProfileRequest) const localVarPath = `/profiles`; // 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 jwt_logged_in 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(createProfileRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Get profile details. * @summary Get profile details * @param {string} profileId Profile ID * @param {*} [options] Override http request option. * @throws {RequiredError} */ getProfile: async (profileId: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'profileId' is not null or undefined assertParamExists('getProfile', 'profileId', profileId) const localVarPath = `/profiles/{profileId}` .replace(`{${"profileId"}}`, encodeURIComponent(String(profileId))); // 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 jwt_logged_in 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 all of the profiles * @summary Get all of the profiles * @param {*} [options] Override http request option. * @throws {RequiredError} */ getProfiles: async (options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/profiles`; // 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 jwt_logged_in 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 Profile. * @summary Update Profile * @param {string} profileId Profile ID * @param {UpdateProfileRequest} updateProfileRequest Profile Update * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateProfile: async (profileId: string, updateProfileRequest: UpdateProfileRequest, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'profileId' is not null or undefined assertParamExists('updateProfile', 'profileId', profileId) // verify required parameter 'updateProfileRequest' is not null or undefined assertParamExists('updateProfile', 'updateProfileRequest', updateProfileRequest) const localVarPath = `/profiles/{profileId}` .replace(`{${"profileId"}}`, encodeURIComponent(String(profileId))); // 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 jwt_logged_in 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(updateProfileRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, } }; /** * ProfileApi - functional programming interface * @export */ export const ProfileApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = ProfileApiAxiosParamCreator(configuration) return { /** * Create Profile * @summary Create Profile * @param {CreateProfileRequest} createProfileRequest Create Profile Request * @param {*} [options] Override http request option. * @throws {RequiredError} */ async createProfile(createProfileRequest: CreateProfileRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.createProfile(createProfileRequest, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Get profile details. * @summary Get profile details * @param {string} profileId Profile ID * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getProfile(profileId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getProfile(profileId, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Get all of the profiles * @summary Get all of the profiles * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getProfiles(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getProfiles(options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Update Profile. * @summary Update Profile * @param {string} profileId Profile ID * @param {UpdateProfileRequest} updateProfileRequest Profile Update * @param {*} [options] Override http request option. * @throws {RequiredError} */ async updateProfile(profileId: string, updateProfileRequest: UpdateProfileRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.updateProfile(profileId, updateProfileRequest, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } }; /** * ProfileApi - factory interface * @export */ export const ProfileApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = ProfileApiFp(configuration) return { /** * Create Profile * @summary Create Profile * @param {CreateProfileRequest} createProfileRequest Create Profile Request * @param {*} [options] Override http request option. * @throws {RequiredError} */ createProfile(createProfileRequest: CreateProfileRequest, options?: any): AxiosPromise { return localVarFp.createProfile(createProfileRequest, options).then((request) => request(axios, basePath)); }, /** * Get profile details. * @summary Get profile details * @param {string} profileId Profile ID * @param {*} [options] Override http request option. * @throws {RequiredError} */ getProfile(profileId: string, options?: any): AxiosPromise { return localVarFp.getProfile(profileId, options).then((request) => request(axios, basePath)); }, /** * Get all of the profiles * @summary Get all of the profiles * @param {*} [options] Override http request option. * @throws {RequiredError} */ getProfiles(options?: any): AxiosPromise { return localVarFp.getProfiles(options).then((request) => request(axios, basePath)); }, /** * Update Profile. * @summary Update Profile * @param {string} profileId Profile ID * @param {UpdateProfileRequest} updateProfileRequest Profile Update * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateProfile(profileId: string, updateProfileRequest: UpdateProfileRequest, options?: any): AxiosPromise { return localVarFp.updateProfile(profileId, updateProfileRequest, options).then((request) => request(axios, basePath)); }, }; }; /** * ProfileApi - interface * @export * @interface ProfileApi */ export interface ProfileApiInterface { /** * Create Profile * @summary Create Profile * @param {CreateProfileRequest} createProfileRequest Create Profile Request * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ProfileApiInterface */ createProfile(createProfileRequest: CreateProfileRequest, options?: AxiosRequestConfig): AxiosPromise; /** * Get profile details. * @summary Get profile details * @param {string} profileId Profile ID * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ProfileApiInterface */ getProfile(profileId: string, options?: AxiosRequestConfig): AxiosPromise; /** * Get all of the profiles * @summary Get all of the profiles * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ProfileApiInterface */ getProfiles(options?: AxiosRequestConfig): AxiosPromise; /** * Update Profile. * @summary Update Profile * @param {string} profileId Profile ID * @param {UpdateProfileRequest} updateProfileRequest Profile Update * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ProfileApiInterface */ updateProfile(profileId: string, updateProfileRequest: UpdateProfileRequest, options?: AxiosRequestConfig): AxiosPromise; } /** * ProfileApi - object-oriented interface * @export * @class ProfileApi * @extends {BaseAPI} */ export class ProfileApi extends BaseAPI implements ProfileApiInterface { /** * Create Profile * @summary Create Profile * @param {CreateProfileRequest} createProfileRequest Create Profile Request * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ProfileApi */ public createProfile(createProfileRequest: CreateProfileRequest, options?: AxiosRequestConfig) { return ProfileApiFp(this.configuration).createProfile(createProfileRequest, options).then((request) => request(this.axios, this.basePath)); } /** * Get profile details. * @summary Get profile details * @param {string} profileId Profile ID * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ProfileApi */ public getProfile(profileId: string, options?: AxiosRequestConfig) { return ProfileApiFp(this.configuration).getProfile(profileId, options).then((request) => request(this.axios, this.basePath)); } /** * Get all of the profiles * @summary Get all of the profiles * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ProfileApi */ public getProfiles(options?: AxiosRequestConfig) { return ProfileApiFp(this.configuration).getProfiles(options).then((request) => request(this.axios, this.basePath)); } /** * Update Profile. * @summary Update Profile * @param {string} profileId Profile ID * @param {UpdateProfileRequest} updateProfileRequest Profile Update * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ProfileApi */ public updateProfile(profileId: string, updateProfileRequest: UpdateProfileRequest, options?: AxiosRequestConfig) { return ProfileApiFp(this.configuration).updateProfile(profileId, updateProfileRequest, options).then((request) => request(this.axios, this.basePath)); } }