/** * Manages low level client-server communications, parameter marshalling, etc. There should not be any need for an * application to use this class directly - the *Api and model classes provide the public API for the service. The * contents of this file should be regarded as internal but are documented for completeness. * @module ApiClient * @version 4.3.1 */ export class ApiClient { /** * Get ETag from an object if exists. * The ETag is usually provided in the response of the GET API calls, * which can further be used in other HTTP operations. * * @param object Object from which ETag needs to be retrieved * @returns {(String|null)} returns ETag header in the object if it's an API response object, otherwise null */ static getEtag(object: any): (string | null); static getValueForCaseInsensitiveKeyMatch(object: any, key: any): any; static addEtagReferenceToHeader(bodyParam: any, headerParams: any): void; static parseDate(str: any): Date; static parseQueryParam(path: any, queryParams: any, param: any, defaultValue: any): any; /** * Converts a value to the specified type. * @param {(String|Object)} data The data to convert, as a string or object. * @param {(String|Array.|Object.|Function)} type The type to return. Pass a string for simple types * or the constructor function for a complex type. Pass an array containing the type name to return an array of that type. To * return an object, pass an object with one property whose name is the key type and whose value is the corresponding value type: * all properties on data will be converted to this type. * @returns An instance of the specified type or null or undefined if data is null or undefined. */ static convertToType(data: (string | any), type: (string | Array | any | Function)): any; /** * Constructs a new map or array model from REST data. * @param data {Object|Array} The REST data. * @param obj {Object|Array} The target object or array. */ static constructFromObject(data: any | any[], obj: any | any[], itemType: any): void; /** * URI scheme for connecting to the cluster (HTTP or HTTPS using SSL/TLS) * @type {String} * @default https */ scheme: string; /** * The port of the base URL. * @type {String} * @default 9440 */ port: string; /** * The authentication methods to be included for all API calls. * @type {Array.} */ authentications: Array; /** * The default HTTP headers to be included for all API calls. * @type {Array.} * @default {} */ defaultHeaders: Array; /** * The default HTTP read timeout in milliseconds for all API calls. * @type {Number} * @default 30000 */ readTimeout: number; /** * The default HTTP connection timeout in milliseconds for all API calls. * @type {Number} * @default 30000 */ connectTimeout: number; /** * If set to false an additional timestamp parameter is added to all API GET calls to * prevent browser caching * @type {Boolean} * @default true */ cache: boolean; /** * The maximum number of redirects to be followed for all API calls. * @type {Number} * @default 1 */ maxRedirects: number; /** * The maximum number of retry attempts to be made by the client * in case of server error. * @type {Number} * @default 5 */ maxRetryAttempts: number; /** * The delay period (in milliseconds) between two consecutive retry attempts * @type {Number} * @default 3000 */ retryInterval: number; /** * A boolean value that indicates whether cross-site Access-Control requests should be made using auth credentials. * @type {Boolean} * @default false */ withCredentials: boolean; agent: any; /** * Allow user to override superagent agent */ requestAgent: any; /** * Allow SDK to fetch version info and negotiate version */ allowVersionNegotiation: boolean; /** * Allow SDK to print debug logs */ debug: boolean; /** * Username for basic auth (backing store; use get/set username for public API) */ _username: any; /** * Password for basic auth (backing store; use get/set password for public API) */ _password: any; downloadDestination: string; /** * Configure log file to write activity logs * @param logfile The destination file (write stream / string) */ set loggerFile(arg: any); /** * Enable/Disable SSL Verification * @param verifySsl (boolean) */ set verifySsl(arg: boolean); get verifySsl(): boolean; /** * Set the hostname for base URL * @param {String} hostname the hostname */ set host(arg: string); /** * Get the hostname for base URL * @returns {String} the hostname */ get host(): string; /** * Set username for basic auth * @param {String} username the username */ set username(arg: string); /** * Get username for basic auth * @returns {String} the username */ get username(): string; /** * Set password for basic auth * @param {String} password the password */ set password(arg: string); /** * Get password for basic auth * @returns {String} the password */ get password(): string; /** * Adds key value pair to default headers map, (to be added to every API call request) * @param {String} key The key * @param {String} value The corresponding value */ addDefaultHeader(key: string, value: string): void; paramToString(param: any): any; buildUrl(path: any, pathParams: any): string; buildCollectionParam(param: any, collectionFormat: any): any; setApiKey(key: any): void; addEtagToReservedMap(response: any, data: any): any; /** * Get SDK's negotiated version. * @returns {String} negotiated version. */ getNegotiatedVersion(): string; /** * Call relevant options api and negotiate version * Negotiated version available via getNegotiatedVersion() * @param {ApiClient} selfInstance * @param {Array.} authNames An array of allowed authentication type names i.e. basicAuthScheme * @returns {Promise} a {@link https://www.promisejs.org/|Promise} */ negotiateVersion(selfInstance: ApiClient, authNames: Array): Promise; /** * Invokes the REST service using the supplied settings and parameters. * @param {String} path The base URL to invoke. * @param {String} httpMethod The HTTP method to use. * @param {Object.} pathParams A map of path parameters and their values. * @param {Object.} queryParams A map of query parameters and their values. * @param {Object.} headerParams A map of header parameters and their values. * @param {Object.} formParams A map of form parameters and their values. * @param {Object} bodyParam The value to pass as the request body. * @param {Array.} authNames An array of authentication type names. * @param {Array.} contentTypes An array of request MIME types. * @param {Array.} accepts An array of acceptable response MIME types. * @param {(String|Array|Object|Function)} returnType The required type to return; can be a string for simple types or the * constructor for a complex type. * @returns {Promise} A {@link https://www.promisejs.org/|Promise} object. */ callApi(path: string, httpMethod: string, pathParams: any, queryParams: any, headerParams: any, formParams: any, bodyParam: any, authNames: Array, contentTypes: Array, accepts: Array, returnType: (string | any[] | any | Function)): Promise; callApiInternal(path: any, httpMethod: any, pathParams: any, queryParams: any, headerParams: any, formParams: any, bodyParam: any, authNames: any, contentTypes: any, accepts: any, returnType: any): Promise; #private; } export namespace ApiClient { const instance: ApiClient; }