jack-kafka-instance-sdk
Version:
RHOAS Kafka Instance Adminstration SDK
438 lines (437 loc) • 27 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.AclsApi = exports.AclsApiFactory = exports.AclsApiFp = exports.AclsApiAxiosParamCreator = 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");
/**
* AclsApi - axios parameter creator
* @export
*/
const AclsApiAxiosParamCreator = function (configuration) {
return {
/**
* Creates a new ACL binding for a Kafka instance.
* @summary Create ACL binding
* @param {AclBinding} aclBinding ACL to create.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createAcl: (aclBinding, options = {}) => __awaiter(this, void 0, void 0, function* () {
// verify required parameter 'aclBinding' is not null or undefined
(0, common_1.assertParamExists)('createAcl', 'aclBinding', aclBinding);
const localVarPath = `/api/v1/acls`;
// 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)(aclBinding, localVarRequestOptions, configuration);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
}),
/**
* Deletes ACL bindings that match the query parameters.
* @summary Delete ACL bindings
* @param {AclResourceTypeFilter} [resourceType] ACL Resource Type Filter
* @param {string} [resourceName] ACL Resource Name Filter
* @param {AclPatternTypeFilter} [patternType] ACL Pattern Type Filter
* @param {string} [principal] ACL Principal Filter. Either a specific user or the wildcard user `User:*` may be provided. - When fetching by a specific user, the results will also include ACL bindings that apply to all users. - When deleting, ACL bindings to be delete must match the provided `principal` exactly.
* @param {AclOperationFilter} [operation] ACL Operation Filter. The ACL binding operation provided should be valid for the resource type in the request, if not `ANY`.
* @param {AclPermissionTypeFilter} [permission] ACL Permission Type Filter
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
deleteAcls: (resourceType, resourceName, patternType, principal, operation, permission, options = {}) => __awaiter(this, void 0, void 0, function* () {
const localVarPath = `/api/v1/acls`;
// 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);
if (resourceType !== undefined) {
localVarQueryParameter['resourceType'] = resourceType;
}
if (resourceName !== undefined) {
localVarQueryParameter['resourceName'] = resourceName;
}
if (patternType !== undefined) {
localVarQueryParameter['patternType'] = patternType;
}
if (principal !== undefined) {
localVarQueryParameter['principal'] = principal;
}
if (operation !== undefined) {
localVarQueryParameter['operation'] = operation;
}
if (permission !== undefined) {
localVarQueryParameter['permission'] = permission;
}
(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,
};
}),
/**
* Retrieve the resources and associated operations that may have ACLs configured.
* @summary Retrieve allowed ACL resources and operations
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getAclResourceOperations: (options = {}) => __awaiter(this, void 0, void 0, function* () {
const localVarPath = `/api/v1/acls/resource-operations`;
// 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);
(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 of the available ACL bindings, or the list of bindings that meet the user\'s URL query parameters. If no parameters are specified, all ACL bindings known to the system will be returned (with paging).
* @summary List ACL bindings
* @param {AclResourceTypeFilter} [resourceType] ACL Resource Type Filter
* @param {string} [resourceName] ACL Resource Name Filter
* @param {AclPatternTypeFilter} [patternType] ACL Pattern Type Filter
* @param {string} [principal] ACL Principal Filter. Either a specific user or the wildcard user `User:*` may be provided. - When fetching by a specific user, the results will also include ACL bindings that apply to all users. - When deleting, ACL bindings to be delete must match the provided `principal` exactly.
* @param {AclOperationFilter} [operation] ACL Operation Filter. The ACL binding operation provided should be valid for the resource type in the request, if not `ANY`.
* @param {AclPermissionTypeFilter} [permission] ACL Permission Type Filter
* @param {number} [page] Page number
* @param {number} [size] Number of records per page
* @param {SortDirection} [order] Order items are sorted
* @param {AclBindingOrderKey} [orderKey]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getAcls: (resourceType, resourceName, patternType, principal, operation, permission, page, size, order, orderKey, options = {}) => __awaiter(this, void 0, void 0, function* () {
const localVarPath = `/api/v1/acls`;
// 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 (resourceType !== undefined) {
localVarQueryParameter['resourceType'] = resourceType;
}
if (resourceName !== undefined) {
localVarQueryParameter['resourceName'] = resourceName;
}
if (patternType !== undefined) {
localVarQueryParameter['patternType'] = patternType;
}
if (principal !== undefined) {
localVarQueryParameter['principal'] = principal;
}
if (operation !== undefined) {
localVarQueryParameter['operation'] = operation;
}
if (permission !== undefined) {
localVarQueryParameter['permission'] = permission;
}
if (page !== undefined) {
localVarQueryParameter['page'] = page;
}
if (size !== undefined) {
localVarQueryParameter['size'] = size;
}
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,
};
}),
};
};
exports.AclsApiAxiosParamCreator = AclsApiAxiosParamCreator;
/**
* AclsApi - functional programming interface
* @export
*/
const AclsApiFp = function (configuration) {
const localVarAxiosParamCreator = (0, exports.AclsApiAxiosParamCreator)(configuration);
return {
/**
* Creates a new ACL binding for a Kafka instance.
* @summary Create ACL binding
* @param {AclBinding} aclBinding ACL to create.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createAcl(aclBinding, options) {
return __awaiter(this, void 0, void 0, function* () {
const localVarAxiosArgs = yield localVarAxiosParamCreator.createAcl(aclBinding, options);
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
});
},
/**
* Deletes ACL bindings that match the query parameters.
* @summary Delete ACL bindings
* @param {AclResourceTypeFilter} [resourceType] ACL Resource Type Filter
* @param {string} [resourceName] ACL Resource Name Filter
* @param {AclPatternTypeFilter} [patternType] ACL Pattern Type Filter
* @param {string} [principal] ACL Principal Filter. Either a specific user or the wildcard user `User:*` may be provided. - When fetching by a specific user, the results will also include ACL bindings that apply to all users. - When deleting, ACL bindings to be delete must match the provided `principal` exactly.
* @param {AclOperationFilter} [operation] ACL Operation Filter. The ACL binding operation provided should be valid for the resource type in the request, if not `ANY`.
* @param {AclPermissionTypeFilter} [permission] ACL Permission Type Filter
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
deleteAcls(resourceType, resourceName, patternType, principal, operation, permission, options) {
return __awaiter(this, void 0, void 0, function* () {
const localVarAxiosArgs = yield localVarAxiosParamCreator.deleteAcls(resourceType, resourceName, patternType, principal, operation, permission, options);
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
});
},
/**
* Retrieve the resources and associated operations that may have ACLs configured.
* @summary Retrieve allowed ACL resources and operations
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getAclResourceOperations(options) {
return __awaiter(this, void 0, void 0, function* () {
const localVarAxiosArgs = yield localVarAxiosParamCreator.getAclResourceOperations(options);
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
});
},
/**
* Returns a list of all of the available ACL bindings, or the list of bindings that meet the user\'s URL query parameters. If no parameters are specified, all ACL bindings known to the system will be returned (with paging).
* @summary List ACL bindings
* @param {AclResourceTypeFilter} [resourceType] ACL Resource Type Filter
* @param {string} [resourceName] ACL Resource Name Filter
* @param {AclPatternTypeFilter} [patternType] ACL Pattern Type Filter
* @param {string} [principal] ACL Principal Filter. Either a specific user or the wildcard user `User:*` may be provided. - When fetching by a specific user, the results will also include ACL bindings that apply to all users. - When deleting, ACL bindings to be delete must match the provided `principal` exactly.
* @param {AclOperationFilter} [operation] ACL Operation Filter. The ACL binding operation provided should be valid for the resource type in the request, if not `ANY`.
* @param {AclPermissionTypeFilter} [permission] ACL Permission Type Filter
* @param {number} [page] Page number
* @param {number} [size] Number of records per page
* @param {SortDirection} [order] Order items are sorted
* @param {AclBindingOrderKey} [orderKey]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getAcls(resourceType, resourceName, patternType, principal, operation, permission, page, size, order, orderKey, options) {
return __awaiter(this, void 0, void 0, function* () {
const localVarAxiosArgs = yield localVarAxiosParamCreator.getAcls(resourceType, resourceName, patternType, principal, operation, permission, page, size, order, orderKey, options);
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
});
},
};
};
exports.AclsApiFp = AclsApiFp;
/**
* AclsApi - factory interface
* @export
*/
const AclsApiFactory = function (configuration, basePath, axios) {
const localVarFp = (0, exports.AclsApiFp)(configuration);
return {
/**
* Creates a new ACL binding for a Kafka instance.
* @summary Create ACL binding
* @param {AclBinding} aclBinding ACL to create.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createAcl(aclBinding, options) {
return localVarFp.createAcl(aclBinding, options).then((request) => request(axios, basePath));
},
/**
* Deletes ACL bindings that match the query parameters.
* @summary Delete ACL bindings
* @param {AclResourceTypeFilter} [resourceType] ACL Resource Type Filter
* @param {string} [resourceName] ACL Resource Name Filter
* @param {AclPatternTypeFilter} [patternType] ACL Pattern Type Filter
* @param {string} [principal] ACL Principal Filter. Either a specific user or the wildcard user `User:*` may be provided. - When fetching by a specific user, the results will also include ACL bindings that apply to all users. - When deleting, ACL bindings to be delete must match the provided `principal` exactly.
* @param {AclOperationFilter} [operation] ACL Operation Filter. The ACL binding operation provided should be valid for the resource type in the request, if not `ANY`.
* @param {AclPermissionTypeFilter} [permission] ACL Permission Type Filter
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
deleteAcls(resourceType, resourceName, patternType, principal, operation, permission, options) {
return localVarFp.deleteAcls(resourceType, resourceName, patternType, principal, operation, permission, options).then((request) => request(axios, basePath));
},
/**
* Retrieve the resources and associated operations that may have ACLs configured.
* @summary Retrieve allowed ACL resources and operations
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getAclResourceOperations(options) {
return localVarFp.getAclResourceOperations(options).then((request) => request(axios, basePath));
},
/**
* Returns a list of all of the available ACL bindings, or the list of bindings that meet the user\'s URL query parameters. If no parameters are specified, all ACL bindings known to the system will be returned (with paging).
* @summary List ACL bindings
* @param {AclResourceTypeFilter} [resourceType] ACL Resource Type Filter
* @param {string} [resourceName] ACL Resource Name Filter
* @param {AclPatternTypeFilter} [patternType] ACL Pattern Type Filter
* @param {string} [principal] ACL Principal Filter. Either a specific user or the wildcard user `User:*` may be provided. - When fetching by a specific user, the results will also include ACL bindings that apply to all users. - When deleting, ACL bindings to be delete must match the provided `principal` exactly.
* @param {AclOperationFilter} [operation] ACL Operation Filter. The ACL binding operation provided should be valid for the resource type in the request, if not `ANY`.
* @param {AclPermissionTypeFilter} [permission] ACL Permission Type Filter
* @param {number} [page] Page number
* @param {number} [size] Number of records per page
* @param {SortDirection} [order] Order items are sorted
* @param {AclBindingOrderKey} [orderKey]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getAcls(resourceType, resourceName, patternType, principal, operation, permission, page, size, order, orderKey, options) {
return localVarFp.getAcls(resourceType, resourceName, patternType, principal, operation, permission, page, size, order, orderKey, options).then((request) => request(axios, basePath));
},
};
};
exports.AclsApiFactory = AclsApiFactory;
/**
* AclsApi - object-oriented interface
* @export
* @class AclsApi
* @extends {BaseAPI}
*/
class AclsApi extends base_1.BaseAPI {
/**
* Creates a new ACL binding for a Kafka instance.
* @summary Create ACL binding
* @param {AclBinding} aclBinding ACL to create.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof AclsApi
*/
createAcl(aclBinding, options) {
return (0, exports.AclsApiFp)(this.configuration).createAcl(aclBinding, options).then((request) => request(this.axios, this.basePath));
}
/**
* Deletes ACL bindings that match the query parameters.
* @summary Delete ACL bindings
* @param {AclResourceTypeFilter} [resourceType] ACL Resource Type Filter
* @param {string} [resourceName] ACL Resource Name Filter
* @param {AclPatternTypeFilter} [patternType] ACL Pattern Type Filter
* @param {string} [principal] ACL Principal Filter. Either a specific user or the wildcard user `User:*` may be provided. - When fetching by a specific user, the results will also include ACL bindings that apply to all users. - When deleting, ACL bindings to be delete must match the provided `principal` exactly.
* @param {AclOperationFilter} [operation] ACL Operation Filter. The ACL binding operation provided should be valid for the resource type in the request, if not `ANY`.
* @param {AclPermissionTypeFilter} [permission] ACL Permission Type Filter
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof AclsApi
*/
deleteAcls(resourceType, resourceName, patternType, principal, operation, permission, options) {
return (0, exports.AclsApiFp)(this.configuration).deleteAcls(resourceType, resourceName, patternType, principal, operation, permission, options).then((request) => request(this.axios, this.basePath));
}
/**
* Retrieve the resources and associated operations that may have ACLs configured.
* @summary Retrieve allowed ACL resources and operations
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof AclsApi
*/
getAclResourceOperations(options) {
return (0, exports.AclsApiFp)(this.configuration).getAclResourceOperations(options).then((request) => request(this.axios, this.basePath));
}
/**
* Returns a list of all of the available ACL bindings, or the list of bindings that meet the user\'s URL query parameters. If no parameters are specified, all ACL bindings known to the system will be returned (with paging).
* @summary List ACL bindings
* @param {AclResourceTypeFilter} [resourceType] ACL Resource Type Filter
* @param {string} [resourceName] ACL Resource Name Filter
* @param {AclPatternTypeFilter} [patternType] ACL Pattern Type Filter
* @param {string} [principal] ACL Principal Filter. Either a specific user or the wildcard user `User:*` may be provided. - When fetching by a specific user, the results will also include ACL bindings that apply to all users. - When deleting, ACL bindings to be delete must match the provided `principal` exactly.
* @param {AclOperationFilter} [operation] ACL Operation Filter. The ACL binding operation provided should be valid for the resource type in the request, if not `ANY`.
* @param {AclPermissionTypeFilter} [permission] ACL Permission Type Filter
* @param {number} [page] Page number
* @param {number} [size] Number of records per page
* @param {SortDirection} [order] Order items are sorted
* @param {AclBindingOrderKey} [orderKey]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof AclsApi
*/
getAcls(resourceType, resourceName, patternType, principal, operation, permission, page, size, order, orderKey, options) {
return (0, exports.AclsApiFp)(this.configuration).getAcls(resourceType, resourceName, patternType, principal, operation, permission, page, size, order, orderKey, options).then((request) => request(this.axios, this.basePath));
}
}
exports.AclsApi = AclsApi;