/** * (C) Copyright IBM Corp. 2014, 2023. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import { AxiosInstance } from 'axios'; /** * Retry configuration options. */ export interface RetryOptions { /** * Maximum retries to attempt. */ maxRetries?: number; /** * Ceiling for the retry delay (in seconds) - delay will not exceed this value. */ maxRetryInterval?: number; } export declare class RequestWrapper { private axiosInstance; private compressRequestData; private retryInterceptorId; private raxConfig; constructor(axiosOptions?: any); setCompressRequestData(setting: boolean): void; /** * Creates the request. * 1. Merge default options with user provided options * 2. Checks for missing parameters * 3. Encode path and query parameters * 4. Call the api * @returns ReadableStream|undefined * @throws Error */ sendRequest(parameters: any): Promise; /** * Format error returned by axios * @param axiosError - the object returned by axios via rejection * @returns the Error object */ formatError(axiosError: any): Error; getHttpClient(): AxiosInstance; private static getRaxConfig; enableRetries(retryOptions?: RetryOptions): void; disableRetries(): void; private gzipRequestBody; }