UNPKG

jack-kafka-management-sdk

Version:
776 lines 63.2 kB
"use strict"; /* tslint:disable */ /* eslint-disable */ /** * Kafka Management API * Kafka Management API is a REST API to manage Kafka instances * * The version of the OpenAPI document: 1.15.0 * Contact: rhosak-support@redhat.com * * 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.DefaultApi = exports.DefaultApiFactory = exports.DefaultApiFp = exports.DefaultApiAxiosParamCreator = 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"); /** * DefaultApi - axios parameter creator * @export */ const DefaultApiAxiosParamCreator = function (configuration) { return { /** * Creates a Kafka request * @param {boolean} async Perform the action in an asynchronous manner * @param {KafkaRequestPayload} kafkaRequestPayload Kafka data * @param {*} [options] Override http request option. * @throws {RequiredError} */ createKafka: (async, kafkaRequestPayload, options = {}) => __awaiter(this, void 0, void 0, function* () { // verify required parameter 'async' is not null or undefined (0, common_1.assertParamExists)('createKafka', 'async', async); // verify required parameter 'kafkaRequestPayload' is not null or undefined (0, common_1.assertParamExists)('createKafka', 'kafkaRequestPayload', kafkaRequestPayload); const localVarPath = `/api/kafkas_mgmt/v1/kafkas`; // 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); if (async !== undefined) { localVarQueryParameter['async'] = async; } 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)(kafkaRequestPayload, localVarRequestOptions, configuration); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }), /** * Deletes a Kafka request by ID * @param {string} id The ID of record * @param {boolean} async Perform the action in an asynchronous manner * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteKafkaById: (id, async, options = {}) => __awaiter(this, void 0, void 0, function* () { // verify required parameter 'id' is not null or undefined (0, common_1.assertParamExists)('deleteKafkaById', 'id', id); // verify required parameter 'async' is not null or undefined (0, common_1.assertParamExists)('deleteKafkaById', 'async', async); const localVarPath = `/api/kafkas_mgmt/v1/kafkas/{id}` .replace(`{${"id"}}`, encodeURIComponent(String(id))); // 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); if (async !== undefined) { localVarQueryParameter['async'] = async; } (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 all metrics in scrapeable format for a given kafka id * @param {string} id The ID of record * @param {*} [options] Override http request option. * @throws {RequiredError} */ federateMetrics: (id, options = {}) => __awaiter(this, void 0, void 0, function* () { // verify required parameter 'id' is not null or undefined (0, common_1.assertParamExists)('federateMetrics', 'id', id); const localVarPath = `/api/kafkas_mgmt/v1/kafkas/{id}/metrics/federate` .replace(`{${"id"}}`, encodeURIComponent(String(id))); // 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); (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 the list of supported regions of the supported cloud provider * @param {string} id The ID of record * @param {string} [page] Page index * @param {string} [size] Number of items in each page * @param {*} [options] Override http request option. * @throws {RequiredError} */ getCloudProviderRegions: (id, page, size, options = {}) => __awaiter(this, void 0, void 0, function* () { // verify required parameter 'id' is not null or undefined (0, common_1.assertParamExists)('getCloudProviderRegions', 'id', id); const localVarPath = `/api/kafkas_mgmt/v1/cloud_providers/{id}/regions` .replace(`{${"id"}}`, encodeURIComponent(String(id))); // 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); if (page !== undefined) { localVarQueryParameter['page'] = page; } if (size !== undefined) { localVarQueryParameter['size'] = size; } (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 the list of supported cloud providers * @param {string} [page] Page index * @param {string} [size] Number of items in each page * @param {*} [options] Override http request option. * @throws {RequiredError} */ getCloudProviders: (page, size, options = {}) => __awaiter(this, void 0, void 0, function* () { const localVarPath = `/api/kafkas_mgmt/v1/cloud_providers`; // 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); if (page !== undefined) { localVarQueryParameter['page'] = page; } if (size !== undefined) { localVarQueryParameter['size'] = size; } (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 the list of supported Kafka instance types and sizes filtered by cloud provider and region * @param {string} cloudProvider ID of the supported cloud provider * @param {string} cloudRegion Name of the supported cloud provider region * @param {*} [options] Override http request option. * @throws {RequiredError} */ getInstanceTypesByCloudProviderAndRegion: (cloudProvider, cloudRegion, options = {}) => __awaiter(this, void 0, void 0, function* () { // verify required parameter 'cloudProvider' is not null or undefined (0, common_1.assertParamExists)('getInstanceTypesByCloudProviderAndRegion', 'cloudProvider', cloudProvider); // verify required parameter 'cloudRegion' is not null or undefined (0, common_1.assertParamExists)('getInstanceTypesByCloudProviderAndRegion', 'cloudRegion', cloudRegion); const localVarPath = `/api/kafkas_mgmt/v1/instance_types/{cloud_provider}/{cloud_region}` .replace(`{${"cloud_provider"}}`, encodeURIComponent(String(cloudProvider))) .replace(`{${"cloud_region"}}`, encodeURIComponent(String(cloudRegion))); // 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); (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 Kafka request by ID * @param {string} id The ID of record * @param {*} [options] Override http request option. * @throws {RequiredError} */ getKafkaById: (id, options = {}) => __awaiter(this, void 0, void 0, function* () { // verify required parameter 'id' is not null or undefined (0, common_1.assertParamExists)('getKafkaById', 'id', id); const localVarPath = `/api/kafkas_mgmt/v1/kafkas/{id}` .replace(`{${"id"}}`, encodeURIComponent(String(id))); // 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); (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 Kafka requests * @param {string} [page] Page index * @param {string} [size] Number of items in each page * @param {string} [orderBy] Specifies the order by criteria. The syntax of this parameter is similar to the syntax of the &#x60;order by&#x60; clause of an SQL statement. Each query can be ordered by any of the following &#x60;kafkaRequests&#x60; fields: * bootstrap_server_host * admin_api_server_url * cloud_provider * cluster_id * created_at * href * id * instance_type * multi_az * name * organisation_id * owner * reauthentication_enabled * region * status * updated_at * version For example, to return all Kafka instances ordered by their name, use the following syntax: &#x60;&#x60;&#x60;sql name asc &#x60;&#x60;&#x60; To return all Kafka instances ordered by their name _and_ created date, use the following syntax: &#x60;&#x60;&#x60;sql name asc, created_at asc &#x60;&#x60;&#x60; If the parameter isn\&#39;t provided, or if the value is empty, then the results are ordered by name. * @param {string} [search] Search criteria. The syntax of this parameter is similar to the syntax of the &#x60;where&#x60; clause of an SQL statement. Allowed fields in the search are &#x60;cloud_provider&#x60;, &#x60;name&#x60;, &#x60;owner&#x60;, &#x60;region&#x60;, &#x60;status&#x60; and &#x60;cluster_id&#x60;. Allowed comparators are &#x60;&lt;&gt;&#x60;, &#x60;&#x3D;&#x60;, &#x60;IN&#x60;, &#x60;NOT IN&#x60;, &#x60;LIKE&#x60;, or &#x60;ILIKE&#x60;. Allowed joins are &#x60;AND&#x60; and &#x60;OR&#x60;. However, you can use a maximum of 10 joins in a search query. Examples: To return a Kafka instance with the name &#x60;my-kafka&#x60; and the region &#x60;aws&#x60;, use the following syntax: &#x60;&#x60;&#x60; name &#x3D; my-kafka and cloud_provider &#x3D; aws &#x60;&#x60;&#x60; To return a Kafka instance with a name that starts with &#x60;my&#x60;, use the following syntax: &#x60;&#x60;&#x60; name like my%25 &#x60;&#x60;&#x60; To return a Kafka instance with a name containing &#x60;test&#x60; matching any character case combinations, use the following syntax: &#x60;&#x60;&#x60; name ilike %25test%25 &#x60;&#x60;&#x60; If the parameter isn\&#39;t provided, or if the value is empty, then all the Kafka instances that the user has permission to see are returned. Note. If the query is invalid, an error is returned. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getKafkas: (page, size, orderBy, search, options = {}) => __awaiter(this, void 0, void 0, function* () { const localVarPath = `/api/kafkas_mgmt/v1/kafkas`; // 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); if (page !== undefined) { localVarQueryParameter['page'] = page; } if (size !== undefined) { localVarQueryParameter['size'] = size; } if (orderBy !== undefined) { localVarQueryParameter['orderBy'] = orderBy; } if (search !== undefined) { localVarQueryParameter['search'] = search; } (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 metrics with instant query by Kafka ID * @param {string} id The ID of record * @param {Array<string>} [filters] List of metrics to fetch. Fetch all metrics when empty. List entries are Kafka internal metric names. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getMetricsByInstantQuery: (id, filters, options = {}) => __awaiter(this, void 0, void 0, function* () { // verify required parameter 'id' is not null or undefined (0, common_1.assertParamExists)('getMetricsByInstantQuery', 'id', id); const localVarPath = `/api/kafkas_mgmt/v1/kafkas/{id}/metrics/query` .replace(`{${"id"}}`, encodeURIComponent(String(id))); // 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); if (filters) { localVarQueryParameter['filters'] = filters; } (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 metrics with timeseries range query by Kafka ID * @param {string} id The ID of record * @param {number} duration The length of time in minutes for which to return the metrics * @param {number} interval The interval in seconds between data points * @param {Array<string>} [filters] List of metrics to fetch. Fetch all metrics when empty. List entries are Kafka internal metric names. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getMetricsByRangeQuery: (id, duration, interval, filters, options = {}) => __awaiter(this, void 0, void 0, function* () { // verify required parameter 'id' is not null or undefined (0, common_1.assertParamExists)('getMetricsByRangeQuery', 'id', id); // verify required parameter 'duration' is not null or undefined (0, common_1.assertParamExists)('getMetricsByRangeQuery', 'duration', duration); // verify required parameter 'interval' is not null or undefined (0, common_1.assertParamExists)('getMetricsByRangeQuery', 'interval', interval); const localVarPath = `/api/kafkas_mgmt/v1/kafkas/{id}/metrics/query_range` .replace(`{${"id"}}`, encodeURIComponent(String(id))); // 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); if (duration !== undefined) { localVarQueryParameter['duration'] = duration; } if (interval !== undefined) { localVarQueryParameter['interval'] = interval; } if (filters) { localVarQueryParameter['filters'] = filters; } (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 the kafka Service Fleet Manager API version metadata * @param {*} [options] Override http request option. * @throws {RequiredError} */ getVersionMetadata: (options = {}) => __awaiter(this, void 0, void 0, function* () { const localVarPath = `/api/kafkas_mgmt/v1`; // 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 = {}; (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, }; }), /** * Promote a Kafka instance. Promotion is performed asynchronously. The `async` query parameter has to be set to `true`. Only kafka instances with an `eval` billing_model are supported * @param {string} id The ID of record * @param {boolean} async Perform the action in an asynchronous manner. False by default. * @param {KafkaPromoteRequest} kafkaPromoteRequest Kafka promotion request * @param {*} [options] Override http request option. * @throws {RequiredError} */ promoteKafka: (id, async, kafkaPromoteRequest, options = {}) => __awaiter(this, void 0, void 0, function* () { // verify required parameter 'id' is not null or undefined (0, common_1.assertParamExists)('promoteKafka', 'id', id); // verify required parameter 'async' is not null or undefined (0, common_1.assertParamExists)('promoteKafka', 'async', async); // verify required parameter 'kafkaPromoteRequest' is not null or undefined (0, common_1.assertParamExists)('promoteKafka', 'kafkaPromoteRequest', kafkaPromoteRequest); const localVarPath = `/api/kafkas_mgmt/v1/kafkas/{id}/promote` .replace(`{${"id"}}`, encodeURIComponent(String(id))); // 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); if (async !== undefined) { localVarQueryParameter['async'] = async; } 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)(kafkaPromoteRequest, localVarRequestOptions, configuration); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }), /** * Update a Kafka instance by id * @param {string} id The ID of record * @param {KafkaUpdateRequest} kafkaUpdateRequest Update owner of kafka * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateKafkaById: (id, kafkaUpdateRequest, options = {}) => __awaiter(this, void 0, void 0, function* () { // verify required parameter 'id' is not null or undefined (0, common_1.assertParamExists)('updateKafkaById', 'id', id); // verify required parameter 'kafkaUpdateRequest' is not null or undefined (0, common_1.assertParamExists)('updateKafkaById', 'kafkaUpdateRequest', kafkaUpdateRequest); const localVarPath = `/api/kafkas_mgmt/v1/kafkas/{id}` .replace(`{${"id"}}`, encodeURIComponent(String(id))); // 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: 'PATCH' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication Bearer required // http bearer authentication required yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, 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)(kafkaUpdateRequest, localVarRequestOptions, configuration); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }), }; }; exports.DefaultApiAxiosParamCreator = DefaultApiAxiosParamCreator; /** * DefaultApi - functional programming interface * @export */ const DefaultApiFp = function (configuration) { const localVarAxiosParamCreator = (0, exports.DefaultApiAxiosParamCreator)(configuration); return { /** * Creates a Kafka request * @param {boolean} async Perform the action in an asynchronous manner * @param {KafkaRequestPayload} kafkaRequestPayload Kafka data * @param {*} [options] Override http request option. * @throws {RequiredError} */ createKafka(async, kafkaRequestPayload, options) { return __awaiter(this, void 0, void 0, function* () { const localVarAxiosArgs = yield localVarAxiosParamCreator.createKafka(async, kafkaRequestPayload, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }); }, /** * Deletes a Kafka request by ID * @param {string} id The ID of record * @param {boolean} async Perform the action in an asynchronous manner * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteKafkaById(id, async, options) { return __awaiter(this, void 0, void 0, function* () { const localVarAxiosArgs = yield localVarAxiosParamCreator.deleteKafkaById(id, async, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }); }, /** * Returns all metrics in scrapeable format for a given kafka id * @param {string} id The ID of record * @param {*} [options] Override http request option. * @throws {RequiredError} */ federateMetrics(id, options) { return __awaiter(this, void 0, void 0, function* () { const localVarAxiosArgs = yield localVarAxiosParamCreator.federateMetrics(id, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }); }, /** * Returns the list of supported regions of the supported cloud provider * @param {string} id The ID of record * @param {string} [page] Page index * @param {string} [size] Number of items in each page * @param {*} [options] Override http request option. * @throws {RequiredError} */ getCloudProviderRegions(id, page, size, options) { return __awaiter(this, void 0, void 0, function* () { const localVarAxiosArgs = yield localVarAxiosParamCreator.getCloudProviderRegions(id, page, size, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }); }, /** * Returns the list of supported cloud providers * @param {string} [page] Page index * @param {string} [size] Number of items in each page * @param {*} [options] Override http request option. * @throws {RequiredError} */ getCloudProviders(page, size, options) { return __awaiter(this, void 0, void 0, function* () { const localVarAxiosArgs = yield localVarAxiosParamCreator.getCloudProviders(page, size, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }); }, /** * Returns the list of supported Kafka instance types and sizes filtered by cloud provider and region * @param {string} cloudProvider ID of the supported cloud provider * @param {string} cloudRegion Name of the supported cloud provider region * @param {*} [options] Override http request option. * @throws {RequiredError} */ getInstanceTypesByCloudProviderAndRegion(cloudProvider, cloudRegion, options) { return __awaiter(this, void 0, void 0, function* () { const localVarAxiosArgs = yield localVarAxiosParamCreator.getInstanceTypesByCloudProviderAndRegion(cloudProvider, cloudRegion, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }); }, /** * Returns a Kafka request by ID * @param {string} id The ID of record * @param {*} [options] Override http request option. * @throws {RequiredError} */ getKafkaById(id, options) { return __awaiter(this, void 0, void 0, function* () { const localVarAxiosArgs = yield localVarAxiosParamCreator.getKafkaById(id, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }); }, /** * Returns a list of Kafka requests * @param {string} [page] Page index * @param {string} [size] Number of items in each page * @param {string} [orderBy] Specifies the order by criteria. The syntax of this parameter is similar to the syntax of the &#x60;order by&#x60; clause of an SQL statement. Each query can be ordered by any of the following &#x60;kafkaRequests&#x60; fields: * bootstrap_server_host * admin_api_server_url * cloud_provider * cluster_id * created_at * href * id * instance_type * multi_az * name * organisation_id * owner * reauthentication_enabled * region * status * updated_at * version For example, to return all Kafka instances ordered by their name, use the following syntax: &#x60;&#x60;&#x60;sql name asc &#x60;&#x60;&#x60; To return all Kafka instances ordered by their name _and_ created date, use the following syntax: &#x60;&#x60;&#x60;sql name asc, created_at asc &#x60;&#x60;&#x60; If the parameter isn\&#39;t provided, or if the value is empty, then the results are ordered by name. * @param {string} [search] Search criteria. The syntax of this parameter is similar to the syntax of the &#x60;where&#x60; clause of an SQL statement. Allowed fields in the search are &#x60;cloud_provider&#x60;, &#x60;name&#x60;, &#x60;owner&#x60;, &#x60;region&#x60;, &#x60;status&#x60; and &#x60;cluster_id&#x60;. Allowed comparators are &#x60;&lt;&gt;&#x60;, &#x60;&#x3D;&#x60;, &#x60;IN&#x60;, &#x60;NOT IN&#x60;, &#x60;LIKE&#x60;, or &#x60;ILIKE&#x60;. Allowed joins are &#x60;AND&#x60; and &#x60;OR&#x60;. However, you can use a maximum of 10 joins in a search query. Examples: To return a Kafka instance with the name &#x60;my-kafka&#x60; and the region &#x60;aws&#x60;, use the following syntax: &#x60;&#x60;&#x60; name &#x3D; my-kafka and cloud_provider &#x3D; aws &#x60;&#x60;&#x60; To return a Kafka instance with a name that starts with &#x60;my&#x60;, use the following syntax: &#x60;&#x60;&#x60; name like my%25 &#x60;&#x60;&#x60; To return a Kafka instance with a name containing &#x60;test&#x60; matching any character case combinations, use the following syntax: &#x60;&#x60;&#x60; name ilike %25test%25 &#x60;&#x60;&#x60; If the parameter isn\&#39;t provided, or if the value is empty, then all the Kafka instances that the user has permission to see are returned. Note. If the query is invalid, an error is returned. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getKafkas(page, size, orderBy, search, options) { return __awaiter(this, void 0, void 0, function* () { const localVarAxiosArgs = yield localVarAxiosParamCreator.getKafkas(page, size, orderBy, search, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }); }, /** * Returns metrics with instant query by Kafka ID * @param {string} id The ID of record * @param {Array<string>} [filters] List of metrics to fetch. Fetch all metrics when empty. List entries are Kafka internal metric names. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getMetricsByInstantQuery(id, filters, options) { return __awaiter(this, void 0, void 0, function* () { const localVarAxiosArgs = yield localVarAxiosParamCreator.getMetricsByInstantQuery(id, filters, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }); }, /** * Returns metrics with timeseries range query by Kafka ID * @param {string} id The ID of record * @param {number} duration The length of time in minutes for which to return the metrics * @param {number} interval The interval in seconds between data points * @param {Array<string>} [filters] List of metrics to fetch. Fetch all metrics when empty. List entries are Kafka internal metric names. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getMetricsByRangeQuery(id, duration, interval, filters, options) { return __awaiter(this, void 0, void 0, function* () { const localVarAxiosArgs = yield localVarAxiosParamCreator.getMetricsByRangeQuery(id, duration, interval, filters, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }); }, /** * Returns the kafka Service Fleet Manager API version metadata * @param {*} [options] Override http request option. * @throws {RequiredError} */ getVersionMetadata(options) { return __awaiter(this, void 0, void 0, function* () { const localVarAxiosArgs = yield localVarAxiosParamCreator.getVersionMetadata(options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }); }, /** * Promote a Kafka instance. Promotion is performed asynchronously. The `async` query parameter has to be set to `true`. Only kafka instances with an `eval` billing_model are supported * @param {string} id The ID of record * @param {boolean} async Perform the action in an asynchronous manner. False by default. * @param {KafkaPromoteRequest} kafkaPromoteRequest Kafka promotion request * @param {*} [options] Override http request option. * @throws {RequiredError} */ promoteKafka(id, async, kafkaPromoteRequest, options) { return __awaiter(this, void 0, void 0, function* () { const localVarAxiosArgs = yield localVarAxiosParamCreator.promoteKafka(id, async, kafkaPromoteRequest, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }); }, /** * Update a Kafka instance by id * @param {string} id The ID of record * @param {KafkaUpdateRequest} kafkaUpdateRequest Update owner of kafka * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateKafkaById(id, kafkaUpdateRequest, options) { return __awaiter(this, void 0, void 0, function* () { const localVarAxiosArgs = yield localVarAxiosParamCreator.updateKafkaById(id, kafkaUpdateRequest, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }); }, }; }; exports.DefaultApiFp = DefaultApiFp; /** * DefaultApi - factory interface * @export */ const DefaultApiFactory = function (configuration, basePath, axios) { const localVarFp = (0, exports.DefaultApiFp)(configuration); return { /** * Creates a Kafka request * @param {boolean} async Perform the action in an asynchronous manner * @param {KafkaRequestPayload} kafkaRequestPayload Kafka data * @param {*} [options] Override http request option. * @throws {RequiredError} */ createKafka(async, kafkaRequestPayload, options) { return localVarFp.createKafka(async, kafkaRequestPayload, options).then((request) => request(axios, basePath)); }, /** * Deletes a Kafka request by ID * @param {string} id The ID of record * @param {boolean} async Perform the action in an asynchronous manner * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteKafkaById(id, async, options) { return localVarFp.deleteKafkaById(id, async, options).then((request) => request(axios, basePath)); }, /** * Returns all metrics in scrapeable format for a given kafka id * @param {string} id The ID of record * @param {*} [options] Override http request option. * @throws {RequiredError} */ federateMetrics(id, options) { return localVarFp.federateMetrics(id, options).then((request) => request(axios, basePath)); }, /** * Returns the list of supported regions of the supported cloud provider * @param {string} id The ID of record * @param {string} [page] Page index * @param {string} [size] Number of items in each page * @param {*} [options] Override http request option. * @throws {RequiredError} */ getCloudProviderRegions(id, page, size, options) { return localVarFp.getCloudProviderRegions(id, page, size, options).then((request) => request(axios, basePath)); }, /** * Returns the list of supported cloud providers * @param {string} [page] Page index * @param {string} [size] Number of items in each page * @param {*} [options] Override http request option. * @throws {RequiredError} */ getCloudProviders(page, size, options) { return localVarFp.getCloudProviders(page, size, options).then((request) => request(axios, basePath)); }, /** * Returns the list of supported Kafka instance types and sizes filtered by cloud provider and region * @param {string} cloudProvider ID of the supported cloud provider * @param {string} cloudRegion Name of the supported cloud provider region * @param {*} [options] Override http request option. * @throws {RequiredError} */ getInstanceTypesByCloudProviderAndRegion(cloudProvider, cloudRegion, options) { return localVarFp.getInstanceTypesByCloudProviderAndRegion(cloudProvider, cloudRegion, options).then((request) => request(axios, basePath)); }, /** * Returns a Kafka request by ID * @param {string} id The ID of record * @param {*} [options] Override http request option. * @throws {RequiredError} */ getKafkaById(id, options) { return localVarFp.getKafkaById(id, options).then((request) => request(axios, basePath)); }, /** * Returns a list of Kafka requests * @param {string} [page] Page index * @param {string} [size] Number of items in each page * @param {string} [orderBy] Specifies the order by criteria. The syntax of this parameter is similar to the syntax of the &#x60;order by&#x60; clause of an SQL statement. Each query can be ordered by any of the following &#x60;kafkaRequests&#x60; fields: * bootstrap_server_host * admin_api_server_url * cloud_provider * cluster_id * created_at * href * id * instance_type * multi_az * name * organisation_id * owner * reauthentication_enabled * region * status * updated_at * version For example, to return all Kafka instances ordered by their name, use the following syntax: &#x60;&#x60;&#x60;sql name asc &#x60;&#x60;&#x60; To return all Kafka instances ordered by their name _and_ created date, use the following syntax: &#x60;&#x60;&#x60;sql name asc, created_at asc &#x60;&#x60;&#x60; If the parameter isn\&#39;t provided, or if the value is empty, then the results are ordered by name. * @param {string} [search] Search criteria. The syntax of this parameter is similar to the syntax of the &#x60;where&#x60; clause of an SQL statement. Allowed fields in the search are &#x60;cloud_provider&#x60;, &#x60;name&#x60;, &#x60;owner&#x60;, &#x60;region&#x60;, &#x60;status&#x60; and &#x60;cluster_id&#x60;. Allowed comparators are &#x60;&lt;&gt;&#x60;, &#x60;&#x3D;&#x60;, &#x60;IN&#x60;, &#x60;NOT IN&#x60;, &#x60;LIKE&#x60;, or &#x60;ILIKE&#x60;. Allowed joins are &#x60;AND&#x60; and &#x60;OR&#x60;. However, you can use a maximum of 10 joins in a search query. Examples: To return a Kafka instance with the name &#x60;my-kafka&#x60; and the region &#x60;aws&#x60;, use the following syntax: &#x60;&#x60;&#x60; name &#x3D; my-kafka and cloud_provider &#x3D; aws &#x60;&#x60;&#x60; To return a Kafka instance with a name that starts with &#x60;my&#x60;, use the following syntax: &#x60;&#x60;&#x60; name like my%25 &#x60;&#x60;&#x60; To return a Kafka instance with