/* tslint:disable */ /* eslint-disable */ /** * Apicurio Registry API [v2] * Apicurio Registry is a datastore for standard event schemas and API designs. Apicurio Registry enables developers to manage and share the structure of their data using a REST interface. For example, client applications can dynamically push or pull the latest updates to or from the registry without needing to redeploy. Apicurio Registry also enables developers to create rules that govern how registry content can evolve over time. For example, this includes rules for content validation and version compatibility. The Apicurio Registry REST API enables client applications to manage the artifacts in the registry. This API provides create, read, update, and delete operations for schema and API artifacts, rules, versions, and metadata. The supported artifact types include: - Apache Avro schema - AsyncAPI specification - Google protocol buffers - GraphQL schema - JSON Schema - Kafka Connect schema - OpenAPI specification - Web Services Description Language - XML Schema Definition **Important**: The Apicurio Registry REST API is available from `https://MY-REGISTRY-URL/apis/registry/v2` by default. Therefore you must prefix all API operation paths with `../apis/registry/v2` in this case. For example: `../apis/registry/v2/ids/globalIds/{globalId}`. * * The version of the OpenAPI document: 2.4.x * Contact: apicurio@lists.jboss.org * * 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 { CreateGroupMetaData } from '../model'; // @ts-ignore import { GroupMetaData } from '../model'; // @ts-ignore import { GroupSearchResults } from '../model'; // @ts-ignore import { SortBy } from '../model'; // @ts-ignore import { SortOrder } from '../model'; /** * GroupsApi - axios parameter creator * @export */ export const GroupsApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * Creates a new group. This operation can fail for the following reasons: * A server error occurred (HTTP error `500`) * The group already exist (HTTP error `409`) * @summary Create a new group * @param {CreateGroupMetaData} createGroupMetaData * @param {*} [options] Override http request option. * @throws {RequiredError} */ createGroup: async (createGroupMetaData: CreateGroupMetaData, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'createGroupMetaData' is not null or undefined assertParamExists('createGroup', 'createGroupMetaData', createGroupMetaData) const localVarPath = `/groups`; // 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; localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(createGroupMetaData, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Deletes a group by identifier. This operation can fail for the following reasons: * A server error occurred (HTTP error `500`) * The group does not exist (HTTP error `404`) * @summary Delete a group by the specified ID. * @param {string} groupId The artifact group ID. Must be a string provided by the client, representing the name of the grouping of artifacts. * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteGroupById: async (groupId: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'groupId' is not null or undefined assertParamExists('deleteGroupById', 'groupId', groupId) const localVarPath = `/groups/{groupId}` .replace(`{${"groupId"}}`, encodeURIComponent(String(groupId))); // 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; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Returns a group using the specified id. This operation can fail for the following reasons: * No group exists with the specified ID (HTTP error `404`) * A server error occurred (HTTP error `500`) * @summary Get a group by the specified ID. * @param {string} groupId The artifact group ID. Must be a string provided by the client, representing the name of the grouping of artifacts. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getGroupById: async (groupId: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'groupId' is not null or undefined assertParamExists('getGroupById', 'groupId', groupId) const localVarPath = `/groups/{groupId}` .replace(`{${"groupId"}}`, encodeURIComponent(String(groupId))); // 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; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Returns a list of all groups. This list is paged. * @summary List groups * @param {number} [limit] The number of groups to return. Defaults to 20. * @param {number} [offset] The number of groups to skip before starting the result set. Defaults to 0. * @param {SortOrder} [order] Sort order, ascending (`asc`) or descending (`desc`). * @param {SortBy} [orderby] The field to sort by. Can be one of: * `name` * `createdOn` * @param {*} [options] Override http request option. * @throws {RequiredError} */ listGroups: async (limit?: number, offset?: number, order?: SortOrder, orderby?: SortBy, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/groups`; // 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; if (limit !== undefined) { localVarQueryParameter['limit'] = limit; } if (offset !== undefined) { localVarQueryParameter['offset'] = offset; } if (order !== undefined) { localVarQueryParameter['order'] = order; } if (orderby !== undefined) { localVarQueryParameter['orderby'] = orderby; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, } }; /** * GroupsApi - functional programming interface * @export */ export const GroupsApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = GroupsApiAxiosParamCreator(configuration) return { /** * Creates a new group. This operation can fail for the following reasons: * A server error occurred (HTTP error `500`) * The group already exist (HTTP error `409`) * @summary Create a new group * @param {CreateGroupMetaData} createGroupMetaData * @param {*} [options] Override http request option. * @throws {RequiredError} */ async createGroup(createGroupMetaData: CreateGroupMetaData, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.createGroup(createGroupMetaData, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Deletes a group by identifier. This operation can fail for the following reasons: * A server error occurred (HTTP error `500`) * The group does not exist (HTTP error `404`) * @summary Delete a group by the specified ID. * @param {string} groupId The artifact group ID. Must be a string provided by the client, representing the name of the grouping of artifacts. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async deleteGroupById(groupId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteGroupById(groupId, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Returns a group using the specified id. This operation can fail for the following reasons: * No group exists with the specified ID (HTTP error `404`) * A server error occurred (HTTP error `500`) * @summary Get a group by the specified ID. * @param {string} groupId The artifact group ID. Must be a string provided by the client, representing the name of the grouping of artifacts. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getGroupById(groupId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getGroupById(groupId, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Returns a list of all groups. This list is paged. * @summary List groups * @param {number} [limit] The number of groups to return. Defaults to 20. * @param {number} [offset] The number of groups to skip before starting the result set. Defaults to 0. * @param {SortOrder} [order] Sort order, ascending (`asc`) or descending (`desc`). * @param {SortBy} [orderby] The field to sort by. Can be one of: * `name` * `createdOn` * @param {*} [options] Override http request option. * @throws {RequiredError} */ async listGroups(limit?: number, offset?: number, order?: SortOrder, orderby?: SortBy, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.listGroups(limit, offset, order, orderby, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } }; /** * GroupsApi - factory interface * @export */ export const GroupsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = GroupsApiFp(configuration) return { /** * Creates a new group. This operation can fail for the following reasons: * A server error occurred (HTTP error `500`) * The group already exist (HTTP error `409`) * @summary Create a new group * @param {CreateGroupMetaData} createGroupMetaData * @param {*} [options] Override http request option. * @throws {RequiredError} */ createGroup(createGroupMetaData: CreateGroupMetaData, options?: any): AxiosPromise { return localVarFp.createGroup(createGroupMetaData, options).then((request) => request(axios, basePath)); }, /** * Deletes a group by identifier. This operation can fail for the following reasons: * A server error occurred (HTTP error `500`) * The group does not exist (HTTP error `404`) * @summary Delete a group by the specified ID. * @param {string} groupId The artifact group ID. Must be a string provided by the client, representing the name of the grouping of artifacts. * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteGroupById(groupId: string, options?: any): AxiosPromise { return localVarFp.deleteGroupById(groupId, options).then((request) => request(axios, basePath)); }, /** * Returns a group using the specified id. This operation can fail for the following reasons: * No group exists with the specified ID (HTTP error `404`) * A server error occurred (HTTP error `500`) * @summary Get a group by the specified ID. * @param {string} groupId The artifact group ID. Must be a string provided by the client, representing the name of the grouping of artifacts. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getGroupById(groupId: string, options?: any): AxiosPromise { return localVarFp.getGroupById(groupId, options).then((request) => request(axios, basePath)); }, /** * Returns a list of all groups. This list is paged. * @summary List groups * @param {number} [limit] The number of groups to return. Defaults to 20. * @param {number} [offset] The number of groups to skip before starting the result set. Defaults to 0. * @param {SortOrder} [order] Sort order, ascending (`asc`) or descending (`desc`). * @param {SortBy} [orderby] The field to sort by. Can be one of: * `name` * `createdOn` * @param {*} [options] Override http request option. * @throws {RequiredError} */ listGroups(limit?: number, offset?: number, order?: SortOrder, orderby?: SortBy, options?: any): AxiosPromise { return localVarFp.listGroups(limit, offset, order, orderby, options).then((request) => request(axios, basePath)); }, }; }; /** * GroupsApi - interface * @export * @interface GroupsApi */ export interface GroupsApiInterface { /** * Creates a new group. This operation can fail for the following reasons: * A server error occurred (HTTP error `500`) * The group already exist (HTTP error `409`) * @summary Create a new group * @param {CreateGroupMetaData} createGroupMetaData * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof GroupsApiInterface */ createGroup(createGroupMetaData: CreateGroupMetaData, options?: AxiosRequestConfig): AxiosPromise; /** * Deletes a group by identifier. This operation can fail for the following reasons: * A server error occurred (HTTP error `500`) * The group does not exist (HTTP error `404`) * @summary Delete a group by the specified ID. * @param {string} groupId The artifact group ID. Must be a string provided by the client, representing the name of the grouping of artifacts. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof GroupsApiInterface */ deleteGroupById(groupId: string, options?: AxiosRequestConfig): AxiosPromise; /** * Returns a group using the specified id. This operation can fail for the following reasons: * No group exists with the specified ID (HTTP error `404`) * A server error occurred (HTTP error `500`) * @summary Get a group by the specified ID. * @param {string} groupId The artifact group ID. Must be a string provided by the client, representing the name of the grouping of artifacts. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof GroupsApiInterface */ getGroupById(groupId: string, options?: AxiosRequestConfig): AxiosPromise; /** * Returns a list of all groups. This list is paged. * @summary List groups * @param {number} [limit] The number of groups to return. Defaults to 20. * @param {number} [offset] The number of groups to skip before starting the result set. Defaults to 0. * @param {SortOrder} [order] Sort order, ascending (`asc`) or descending (`desc`). * @param {SortBy} [orderby] The field to sort by. Can be one of: * `name` * `createdOn` * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof GroupsApiInterface */ listGroups(limit?: number, offset?: number, order?: SortOrder, orderby?: SortBy, options?: AxiosRequestConfig): AxiosPromise; } /** * GroupsApi - object-oriented interface * @export * @class GroupsApi * @extends {BaseAPI} */ export class GroupsApi extends BaseAPI implements GroupsApiInterface { /** * Creates a new group. This operation can fail for the following reasons: * A server error occurred (HTTP error `500`) * The group already exist (HTTP error `409`) * @summary Create a new group * @param {CreateGroupMetaData} createGroupMetaData * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof GroupsApi */ public createGroup(createGroupMetaData: CreateGroupMetaData, options?: AxiosRequestConfig) { return GroupsApiFp(this.configuration).createGroup(createGroupMetaData, options).then((request) => request(this.axios, this.basePath)); } /** * Deletes a group by identifier. This operation can fail for the following reasons: * A server error occurred (HTTP error `500`) * The group does not exist (HTTP error `404`) * @summary Delete a group by the specified ID. * @param {string} groupId The artifact group ID. Must be a string provided by the client, representing the name of the grouping of artifacts. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof GroupsApi */ public deleteGroupById(groupId: string, options?: AxiosRequestConfig) { return GroupsApiFp(this.configuration).deleteGroupById(groupId, options).then((request) => request(this.axios, this.basePath)); } /** * Returns a group using the specified id. This operation can fail for the following reasons: * No group exists with the specified ID (HTTP error `404`) * A server error occurred (HTTP error `500`) * @summary Get a group by the specified ID. * @param {string} groupId The artifact group ID. Must be a string provided by the client, representing the name of the grouping of artifacts. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof GroupsApi */ public getGroupById(groupId: string, options?: AxiosRequestConfig) { return GroupsApiFp(this.configuration).getGroupById(groupId, options).then((request) => request(this.axios, this.basePath)); } /** * Returns a list of all groups. This list is paged. * @summary List groups * @param {number} [limit] The number of groups to return. Defaults to 20. * @param {number} [offset] The number of groups to skip before starting the result set. Defaults to 0. * @param {SortOrder} [order] Sort order, ascending (`asc`) or descending (`desc`). * @param {SortBy} [orderby] The field to sort by. Can be one of: * `name` * `createdOn` * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof GroupsApi */ public listGroups(limit?: number, offset?: number, order?: SortOrder, orderby?: SortBy, options?: AxiosRequestConfig) { return GroupsApiFp(this.configuration).listGroups(limit, offset, order, orderby, options).then((request) => request(this.axios, this.basePath)); } }