identity-admin-api-client-typescript
Version:
Openapi generated typescript-axios client for CloudHospital Admin
527 lines (473 loc) • 22.5 kB
text/typescript
/* tslint:disable */
/* eslint-disable */
/**
* CloudHospital IdentityServer Admin Api INT
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: v1
*
*
* 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 { PersistedGrantApiDto } from '../models';
// @ts-ignore
import { PersistedGrantSubjectsApiDto } from '../models';
// @ts-ignore
import { PersistedGrantsApiDto } from '../models';
/**
* PersistedGrantsApi - axios parameter creator
* @export
*/
export const PersistedGrantsApiAxiosParamCreator = function (configuration?: Configuration) {
return {
/**
*
* @param {string} id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiPersistedGrantsIdDelete: async (id: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'id' is not null or undefined
assertParamExists('apiPersistedGrantsIdDelete', 'id', id)
const localVarPath = `/api/PersistedGrants/{id}`
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
// 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 oauth2 required
// oauth required
await setOAuthToObject(localVarHeaderParameter, "oauth2", ["cloudhospital_identity_admin_api"], configuration)
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @param {string} id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiPersistedGrantsIdGet: async (id: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'id' is not null or undefined
assertParamExists('apiPersistedGrantsIdGet', 'id', id)
const localVarPath = `/api/PersistedGrants/{id}`
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
// 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 oauth2 required
// oauth required
await setOAuthToObject(localVarHeaderParameter, "oauth2", ["cloudhospital_identity_admin_api"], configuration)
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @param {string} [searchText]
* @param {number} [page]
* @param {number} [pageSize]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiPersistedGrantsSubjectsGet: async (searchText?: string, page?: number, pageSize?: number, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/api/PersistedGrants/Subjects`;
// 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 oauth2 required
// oauth required
await setOAuthToObject(localVarHeaderParameter, "oauth2", ["cloudhospital_identity_admin_api"], configuration)
if (searchText !== undefined) {
localVarQueryParameter['searchText'] = searchText;
}
if (page !== undefined) {
localVarQueryParameter['page'] = page;
}
if (pageSize !== undefined) {
localVarQueryParameter['pageSize'] = pageSize;
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @param {string} subjectId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiPersistedGrantsSubjectsSubjectIdDelete: async (subjectId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'subjectId' is not null or undefined
assertParamExists('apiPersistedGrantsSubjectsSubjectIdDelete', 'subjectId', subjectId)
const localVarPath = `/api/PersistedGrants/Subjects/{subjectId}`
.replace(`{${"subjectId"}}`, encodeURIComponent(String(subjectId)));
// 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 oauth2 required
// oauth required
await setOAuthToObject(localVarHeaderParameter, "oauth2", ["cloudhospital_identity_admin_api"], configuration)
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @param {string} subjectId
* @param {number} [page]
* @param {number} [pageSize]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiPersistedGrantsSubjectsSubjectIdGet: async (subjectId: string, page?: number, pageSize?: number, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'subjectId' is not null or undefined
assertParamExists('apiPersistedGrantsSubjectsSubjectIdGet', 'subjectId', subjectId)
const localVarPath = `/api/PersistedGrants/Subjects/{subjectId}`
.replace(`{${"subjectId"}}`, encodeURIComponent(String(subjectId)));
// 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 oauth2 required
// oauth required
await setOAuthToObject(localVarHeaderParameter, "oauth2", ["cloudhospital_identity_admin_api"], configuration)
if (page !== undefined) {
localVarQueryParameter['page'] = page;
}
if (pageSize !== undefined) {
localVarQueryParameter['pageSize'] = pageSize;
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
}
};
/**
* PersistedGrantsApi - functional programming interface
* @export
*/
export const PersistedGrantsApiFp = function(configuration?: Configuration) {
const localVarAxiosParamCreator = PersistedGrantsApiAxiosParamCreator(configuration)
return {
/**
*
* @param {string} id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiPersistedGrantsIdDelete(id: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.apiPersistedGrantsIdDelete(id, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
*
* @param {string} id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiPersistedGrantsIdGet(id: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PersistedGrantApiDto>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.apiPersistedGrantsIdGet(id, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
*
* @param {string} [searchText]
* @param {number} [page]
* @param {number} [pageSize]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiPersistedGrantsSubjectsGet(searchText?: string, page?: number, pageSize?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PersistedGrantSubjectsApiDto>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.apiPersistedGrantsSubjectsGet(searchText, page, pageSize, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
*
* @param {string} subjectId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiPersistedGrantsSubjectsSubjectIdDelete(subjectId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.apiPersistedGrantsSubjectsSubjectIdDelete(subjectId, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
*
* @param {string} subjectId
* @param {number} [page]
* @param {number} [pageSize]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiPersistedGrantsSubjectsSubjectIdGet(subjectId: string, page?: number, pageSize?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PersistedGrantsApiDto>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.apiPersistedGrantsSubjectsSubjectIdGet(subjectId, page, pageSize, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
}
};
/**
* PersistedGrantsApi - factory interface
* @export
*/
export const PersistedGrantsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
const localVarFp = PersistedGrantsApiFp(configuration)
return {
/**
*
* @param {string} id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiPersistedGrantsIdDelete(id: string, options?: any): AxiosPromise<void> {
return localVarFp.apiPersistedGrantsIdDelete(id, options).then((request) => request(axios, basePath));
},
/**
*
* @param {string} id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiPersistedGrantsIdGet(id: string, options?: any): AxiosPromise<PersistedGrantApiDto> {
return localVarFp.apiPersistedGrantsIdGet(id, options).then((request) => request(axios, basePath));
},
/**
*
* @param {string} [searchText]
* @param {number} [page]
* @param {number} [pageSize]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiPersistedGrantsSubjectsGet(searchText?: string, page?: number, pageSize?: number, options?: any): AxiosPromise<PersistedGrantSubjectsApiDto> {
return localVarFp.apiPersistedGrantsSubjectsGet(searchText, page, pageSize, options).then((request) => request(axios, basePath));
},
/**
*
* @param {string} subjectId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiPersistedGrantsSubjectsSubjectIdDelete(subjectId: string, options?: any): AxiosPromise<void> {
return localVarFp.apiPersistedGrantsSubjectsSubjectIdDelete(subjectId, options).then((request) => request(axios, basePath));
},
/**
*
* @param {string} subjectId
* @param {number} [page]
* @param {number} [pageSize]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiPersistedGrantsSubjectsSubjectIdGet(subjectId: string, page?: number, pageSize?: number, options?: any): AxiosPromise<PersistedGrantsApiDto> {
return localVarFp.apiPersistedGrantsSubjectsSubjectIdGet(subjectId, page, pageSize, options).then((request) => request(axios, basePath));
},
};
};
/**
* Request parameters for apiPersistedGrantsIdDelete operation in PersistedGrantsApi.
* @export
* @interface PersistedGrantsApiApiPersistedGrantsIdDeleteRequest
*/
export interface PersistedGrantsApiApiPersistedGrantsIdDeleteRequest {
/**
*
* @type {string}
* @memberof PersistedGrantsApiApiPersistedGrantsIdDelete
*/
readonly id: string
}
/**
* Request parameters for apiPersistedGrantsIdGet operation in PersistedGrantsApi.
* @export
* @interface PersistedGrantsApiApiPersistedGrantsIdGetRequest
*/
export interface PersistedGrantsApiApiPersistedGrantsIdGetRequest {
/**
*
* @type {string}
* @memberof PersistedGrantsApiApiPersistedGrantsIdGet
*/
readonly id: string
}
/**
* Request parameters for apiPersistedGrantsSubjectsGet operation in PersistedGrantsApi.
* @export
* @interface PersistedGrantsApiApiPersistedGrantsSubjectsGetRequest
*/
export interface PersistedGrantsApiApiPersistedGrantsSubjectsGetRequest {
/**
*
* @type {string}
* @memberof PersistedGrantsApiApiPersistedGrantsSubjectsGet
*/
readonly searchText?: string
/**
*
* @type {number}
* @memberof PersistedGrantsApiApiPersistedGrantsSubjectsGet
*/
readonly page?: number
/**
*
* @type {number}
* @memberof PersistedGrantsApiApiPersistedGrantsSubjectsGet
*/
readonly pageSize?: number
}
/**
* Request parameters for apiPersistedGrantsSubjectsSubjectIdDelete operation in PersistedGrantsApi.
* @export
* @interface PersistedGrantsApiApiPersistedGrantsSubjectsSubjectIdDeleteRequest
*/
export interface PersistedGrantsApiApiPersistedGrantsSubjectsSubjectIdDeleteRequest {
/**
*
* @type {string}
* @memberof PersistedGrantsApiApiPersistedGrantsSubjectsSubjectIdDelete
*/
readonly subjectId: string
}
/**
* Request parameters for apiPersistedGrantsSubjectsSubjectIdGet operation in PersistedGrantsApi.
* @export
* @interface PersistedGrantsApiApiPersistedGrantsSubjectsSubjectIdGetRequest
*/
export interface PersistedGrantsApiApiPersistedGrantsSubjectsSubjectIdGetRequest {
/**
*
* @type {string}
* @memberof PersistedGrantsApiApiPersistedGrantsSubjectsSubjectIdGet
*/
readonly subjectId: string
/**
*
* @type {number}
* @memberof PersistedGrantsApiApiPersistedGrantsSubjectsSubjectIdGet
*/
readonly page?: number
/**
*
* @type {number}
* @memberof PersistedGrantsApiApiPersistedGrantsSubjectsSubjectIdGet
*/
readonly pageSize?: number
}
/**
* PersistedGrantsApi - object-oriented interface
* @export
* @class PersistedGrantsApi
* @extends {BaseAPI}
*/
export class PersistedGrantsApi extends BaseAPI {
/**
*
* @param {PersistedGrantsApiApiPersistedGrantsIdDeleteRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof PersistedGrantsApi
*/
public apiPersistedGrantsIdDelete(requestParameters: PersistedGrantsApiApiPersistedGrantsIdDeleteRequest, options?: AxiosRequestConfig) {
return PersistedGrantsApiFp(this.configuration).apiPersistedGrantsIdDelete(requestParameters.id, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @param {PersistedGrantsApiApiPersistedGrantsIdGetRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof PersistedGrantsApi
*/
public apiPersistedGrantsIdGet(requestParameters: PersistedGrantsApiApiPersistedGrantsIdGetRequest, options?: AxiosRequestConfig) {
return PersistedGrantsApiFp(this.configuration).apiPersistedGrantsIdGet(requestParameters.id, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @param {PersistedGrantsApiApiPersistedGrantsSubjectsGetRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof PersistedGrantsApi
*/
public apiPersistedGrantsSubjectsGet(requestParameters: PersistedGrantsApiApiPersistedGrantsSubjectsGetRequest = {}, options?: AxiosRequestConfig) {
return PersistedGrantsApiFp(this.configuration).apiPersistedGrantsSubjectsGet(requestParameters.searchText, requestParameters.page, requestParameters.pageSize, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @param {PersistedGrantsApiApiPersistedGrantsSubjectsSubjectIdDeleteRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof PersistedGrantsApi
*/
public apiPersistedGrantsSubjectsSubjectIdDelete(requestParameters: PersistedGrantsApiApiPersistedGrantsSubjectsSubjectIdDeleteRequest, options?: AxiosRequestConfig) {
return PersistedGrantsApiFp(this.configuration).apiPersistedGrantsSubjectsSubjectIdDelete(requestParameters.subjectId, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @param {PersistedGrantsApiApiPersistedGrantsSubjectsSubjectIdGetRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof PersistedGrantsApi
*/
public apiPersistedGrantsSubjectsSubjectIdGet(requestParameters: PersistedGrantsApiApiPersistedGrantsSubjectsSubjectIdGetRequest, options?: AxiosRequestConfig) {
return PersistedGrantsApiFp(this.configuration).apiPersistedGrantsSubjectsSubjectIdGet(requestParameters.subjectId, requestParameters.page, requestParameters.pageSize, options).then((request) => request(this.axios, this.basePath));
}
}