jack-kafka-instance-sdk
Version:
RHOAS Kafka Instance Adminstration SDK
431 lines (430 loc) • 24.5 kB
JavaScript
;
/* tslint:disable */
/* eslint-disable */
/**
* Kafka Instance API
* API for interacting with Kafka Instance. Includes Produce, Consume and Admin APIs
*
* The version of the OpenAPI document: 0.14.1-SNAPSHOT
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.GroupsApi = exports.GroupsApiFactory = exports.GroupsApiFp = exports.GroupsApiAxiosParamCreator = void 0;
const axios_1 = require("axios");
// Some imports not used depending on template conditions
// @ts-ignore
const common_1 = require("../common");
// @ts-ignore
const base_1 = require("../base");
/**
* GroupsApi - axios parameter creator
* @export
*/
const GroupsApiAxiosParamCreator = function (configuration) {
return {
/**
* Delete a consumer group, along with its consumers.
* @summary Delete a consumer group.
* @param {string} consumerGroupId Consumer group identifier
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
deleteConsumerGroupById: (consumerGroupId, options = {}) => __awaiter(this, void 0, void 0, function* () {
// verify required parameter 'consumerGroupId' is not null or undefined
(0, common_1.assertParamExists)('deleteConsumerGroupById', 'consumerGroupId', consumerGroupId);
const localVarPath = `/api/v1/consumer-groups/{consumerGroupId}`
.replace(`{${"consumerGroupId"}}`, encodeURIComponent(String(consumerGroupId)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'DELETE' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication Bearer required
// http bearer authentication required
yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
// authentication OAuth2 required
// oauth required
yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "OAuth2", [], configuration);
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
}),
/**
*
* @summary Get a single consumer group by its unique ID.
* @param {string} consumerGroupId Consumer group identifier
* @param {SortDirection} [order] Order items are sorted
* @param {ConsumerGroupDescriptionOrderKey} [orderKey]
* @param {number} [partitionFilter] Value of partition to include. Value -1 means filter is not active.
* @param {string} [topic] Filter consumer groups for a specific topic
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getConsumerGroupById: (consumerGroupId, order, orderKey, partitionFilter, topic, options = {}) => __awaiter(this, void 0, void 0, function* () {
// verify required parameter 'consumerGroupId' is not null or undefined
(0, common_1.assertParamExists)('getConsumerGroupById', 'consumerGroupId', consumerGroupId);
const localVarPath = `/api/v1/consumer-groups/{consumerGroupId}`
.replace(`{${"consumerGroupId"}}`, encodeURIComponent(String(consumerGroupId)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication Bearer required
// http bearer authentication required
yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
// authentication OAuth2 required
// oauth required
yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "OAuth2", [], configuration);
if (order !== undefined) {
localVarQueryParameter['order'] = order;
}
if (orderKey !== undefined) {
localVarQueryParameter['orderKey'] = orderKey;
}
if (partitionFilter !== undefined) {
localVarQueryParameter['partitionFilter'] = partitionFilter;
}
if (topic !== undefined) {
localVarQueryParameter['topic'] = topic;
}
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
}),
/**
* Returns a list of all consumer groups for a particular Kafka instance. The consumer groups returned are limited to those records the requestor is authorized to view.
* @summary List of consumer groups in the Kafka instance.
* @param {number} [offset] Offset of the first record to return, zero-based
* @param {number} [limit] Maximum number of records to return
* @param {number} [size] Number of records per page
* @param {number} [page] Page number
* @param {string} [topic] Return consumer groups where the topic name contains this value
* @param {string} [groupIdFilter] Return the consumer groups where the ID contains this value
* @param {SortDirection} [order] Order items are sorted
* @param {ConsumerGroupOrderKey} [orderKey]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getConsumerGroups: (offset, limit, size, page, topic, groupIdFilter, order, orderKey, options = {}) => __awaiter(this, void 0, void 0, function* () {
const localVarPath = `/api/v1/consumer-groups`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication Bearer required
// http bearer authentication required
yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
// authentication OAuth2 required
// oauth required
yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "OAuth2", [], configuration);
if (offset !== undefined) {
localVarQueryParameter['offset'] = offset;
}
if (limit !== undefined) {
localVarQueryParameter['limit'] = limit;
}
if (size !== undefined) {
localVarQueryParameter['size'] = size;
}
if (page !== undefined) {
localVarQueryParameter['page'] = page;
}
if (topic !== undefined) {
localVarQueryParameter['topic'] = topic;
}
if (groupIdFilter !== undefined) {
localVarQueryParameter['group-id-filter'] = groupIdFilter;
}
if (order !== undefined) {
localVarQueryParameter['order'] = order;
}
if (orderKey !== undefined) {
localVarQueryParameter['orderKey'] = orderKey;
}
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
}),
/**
* Reset the offset for a particular consumer group.
* @summary Reset the offset for a consumer group.
* @param {string} consumerGroupId Consumer group identifier
* @param {ConsumerGroupResetOffsetParameters} consumerGroupResetOffsetParameters
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
resetConsumerGroupOffset: (consumerGroupId, consumerGroupResetOffsetParameters, options = {}) => __awaiter(this, void 0, void 0, function* () {
// verify required parameter 'consumerGroupId' is not null or undefined
(0, common_1.assertParamExists)('resetConsumerGroupOffset', 'consumerGroupId', consumerGroupId);
// verify required parameter 'consumerGroupResetOffsetParameters' is not null or undefined
(0, common_1.assertParamExists)('resetConsumerGroupOffset', 'consumerGroupResetOffsetParameters', consumerGroupResetOffsetParameters);
const localVarPath = `/api/v1/consumer-groups/{consumerGroupId}/reset-offset`
.replace(`{${"consumerGroupId"}}`, encodeURIComponent(String(consumerGroupId)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication Bearer required
// http bearer authentication required
yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
// authentication OAuth2 required
// oauth required
yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "OAuth2", [], configuration);
localVarHeaderParameter['Content-Type'] = 'application/json';
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(consumerGroupResetOffsetParameters, localVarRequestOptions, configuration);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
}),
};
};
exports.GroupsApiAxiosParamCreator = GroupsApiAxiosParamCreator;
/**
* GroupsApi - functional programming interface
* @export
*/
const GroupsApiFp = function (configuration) {
const localVarAxiosParamCreator = (0, exports.GroupsApiAxiosParamCreator)(configuration);
return {
/**
* Delete a consumer group, along with its consumers.
* @summary Delete a consumer group.
* @param {string} consumerGroupId Consumer group identifier
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
deleteConsumerGroupById(consumerGroupId, options) {
return __awaiter(this, void 0, void 0, function* () {
const localVarAxiosArgs = yield localVarAxiosParamCreator.deleteConsumerGroupById(consumerGroupId, options);
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
});
},
/**
*
* @summary Get a single consumer group by its unique ID.
* @param {string} consumerGroupId Consumer group identifier
* @param {SortDirection} [order] Order items are sorted
* @param {ConsumerGroupDescriptionOrderKey} [orderKey]
* @param {number} [partitionFilter] Value of partition to include. Value -1 means filter is not active.
* @param {string} [topic] Filter consumer groups for a specific topic
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getConsumerGroupById(consumerGroupId, order, orderKey, partitionFilter, topic, options) {
return __awaiter(this, void 0, void 0, function* () {
const localVarAxiosArgs = yield localVarAxiosParamCreator.getConsumerGroupById(consumerGroupId, order, orderKey, partitionFilter, topic, options);
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
});
},
/**
* Returns a list of all consumer groups for a particular Kafka instance. The consumer groups returned are limited to those records the requestor is authorized to view.
* @summary List of consumer groups in the Kafka instance.
* @param {number} [offset] Offset of the first record to return, zero-based
* @param {number} [limit] Maximum number of records to return
* @param {number} [size] Number of records per page
* @param {number} [page] Page number
* @param {string} [topic] Return consumer groups where the topic name contains this value
* @param {string} [groupIdFilter] Return the consumer groups where the ID contains this value
* @param {SortDirection} [order] Order items are sorted
* @param {ConsumerGroupOrderKey} [orderKey]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getConsumerGroups(offset, limit, size, page, topic, groupIdFilter, order, orderKey, options) {
return __awaiter(this, void 0, void 0, function* () {
const localVarAxiosArgs = yield localVarAxiosParamCreator.getConsumerGroups(offset, limit, size, page, topic, groupIdFilter, order, orderKey, options);
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
});
},
/**
* Reset the offset for a particular consumer group.
* @summary Reset the offset for a consumer group.
* @param {string} consumerGroupId Consumer group identifier
* @param {ConsumerGroupResetOffsetParameters} consumerGroupResetOffsetParameters
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
resetConsumerGroupOffset(consumerGroupId, consumerGroupResetOffsetParameters, options) {
return __awaiter(this, void 0, void 0, function* () {
const localVarAxiosArgs = yield localVarAxiosParamCreator.resetConsumerGroupOffset(consumerGroupId, consumerGroupResetOffsetParameters, options);
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
});
},
};
};
exports.GroupsApiFp = GroupsApiFp;
/**
* GroupsApi - factory interface
* @export
*/
const GroupsApiFactory = function (configuration, basePath, axios) {
const localVarFp = (0, exports.GroupsApiFp)(configuration);
return {
/**
* Delete a consumer group, along with its consumers.
* @summary Delete a consumer group.
* @param {string} consumerGroupId Consumer group identifier
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
deleteConsumerGroupById(consumerGroupId, options) {
return localVarFp.deleteConsumerGroupById(consumerGroupId, options).then((request) => request(axios, basePath));
},
/**
*
* @summary Get a single consumer group by its unique ID.
* @param {string} consumerGroupId Consumer group identifier
* @param {SortDirection} [order] Order items are sorted
* @param {ConsumerGroupDescriptionOrderKey} [orderKey]
* @param {number} [partitionFilter] Value of partition to include. Value -1 means filter is not active.
* @param {string} [topic] Filter consumer groups for a specific topic
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getConsumerGroupById(consumerGroupId, order, orderKey, partitionFilter, topic, options) {
return localVarFp.getConsumerGroupById(consumerGroupId, order, orderKey, partitionFilter, topic, options).then((request) => request(axios, basePath));
},
/**
* Returns a list of all consumer groups for a particular Kafka instance. The consumer groups returned are limited to those records the requestor is authorized to view.
* @summary List of consumer groups in the Kafka instance.
* @param {number} [offset] Offset of the first record to return, zero-based
* @param {number} [limit] Maximum number of records to return
* @param {number} [size] Number of records per page
* @param {number} [page] Page number
* @param {string} [topic] Return consumer groups where the topic name contains this value
* @param {string} [groupIdFilter] Return the consumer groups where the ID contains this value
* @param {SortDirection} [order] Order items are sorted
* @param {ConsumerGroupOrderKey} [orderKey]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getConsumerGroups(offset, limit, size, page, topic, groupIdFilter, order, orderKey, options) {
return localVarFp.getConsumerGroups(offset, limit, size, page, topic, groupIdFilter, order, orderKey, options).then((request) => request(axios, basePath));
},
/**
* Reset the offset for a particular consumer group.
* @summary Reset the offset for a consumer group.
* @param {string} consumerGroupId Consumer group identifier
* @param {ConsumerGroupResetOffsetParameters} consumerGroupResetOffsetParameters
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
resetConsumerGroupOffset(consumerGroupId, consumerGroupResetOffsetParameters, options) {
return localVarFp.resetConsumerGroupOffset(consumerGroupId, consumerGroupResetOffsetParameters, options).then((request) => request(axios, basePath));
},
};
};
exports.GroupsApiFactory = GroupsApiFactory;
/**
* GroupsApi - object-oriented interface
* @export
* @class GroupsApi
* @extends {BaseAPI}
*/
class GroupsApi extends base_1.BaseAPI {
/**
* Delete a consumer group, along with its consumers.
* @summary Delete a consumer group.
* @param {string} consumerGroupId Consumer group identifier
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof GroupsApi
*/
deleteConsumerGroupById(consumerGroupId, options) {
return (0, exports.GroupsApiFp)(this.configuration).deleteConsumerGroupById(consumerGroupId, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary Get a single consumer group by its unique ID.
* @param {string} consumerGroupId Consumer group identifier
* @param {SortDirection} [order] Order items are sorted
* @param {ConsumerGroupDescriptionOrderKey} [orderKey]
* @param {number} [partitionFilter] Value of partition to include. Value -1 means filter is not active.
* @param {string} [topic] Filter consumer groups for a specific topic
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof GroupsApi
*/
getConsumerGroupById(consumerGroupId, order, orderKey, partitionFilter, topic, options) {
return (0, exports.GroupsApiFp)(this.configuration).getConsumerGroupById(consumerGroupId, order, orderKey, partitionFilter, topic, options).then((request) => request(this.axios, this.basePath));
}
/**
* Returns a list of all consumer groups for a particular Kafka instance. The consumer groups returned are limited to those records the requestor is authorized to view.
* @summary List of consumer groups in the Kafka instance.
* @param {number} [offset] Offset of the first record to return, zero-based
* @param {number} [limit] Maximum number of records to return
* @param {number} [size] Number of records per page
* @param {number} [page] Page number
* @param {string} [topic] Return consumer groups where the topic name contains this value
* @param {string} [groupIdFilter] Return the consumer groups where the ID contains this value
* @param {SortDirection} [order] Order items are sorted
* @param {ConsumerGroupOrderKey} [orderKey]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof GroupsApi
*/
getConsumerGroups(offset, limit, size, page, topic, groupIdFilter, order, orderKey, options) {
return (0, exports.GroupsApiFp)(this.configuration).getConsumerGroups(offset, limit, size, page, topic, groupIdFilter, order, orderKey, options).then((request) => request(this.axios, this.basePath));
}
/**
* Reset the offset for a particular consumer group.
* @summary Reset the offset for a consumer group.
* @param {string} consumerGroupId Consumer group identifier
* @param {ConsumerGroupResetOffsetParameters} consumerGroupResetOffsetParameters
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof GroupsApi
*/
resetConsumerGroupOffset(consumerGroupId, consumerGroupResetOffsetParameters, options) {
return (0, exports.GroupsApiFp)(this.configuration).resetConsumerGroupOffset(consumerGroupId, consumerGroupResetOffsetParameters, options).then((request) => request(this.axios, this.basePath));
}
}
exports.GroupsApi = GroupsApi;