export default ApiClient;
/**
* @module ApiClient
*/
/**
* 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.
* @alias module:ApiClient
* @class
*/
declare class ApiClient {
/**
* Returns a boolean indicating if the parameter could be JSON.stringified
* @param str The actual parameter
* @returns {Boolean} Flag indicating if param can be JSON.stringified
*/
static canBeJsonified(str: any): boolean;
/**
* Parses an ISO-8601 string representation or epoch representation of a date value.
* @param {string} str The date value as a string.
* @returns {Date} The parsed date object.
*/
static parseDate(str: string): Date;
/**
* 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;
/**
* The base URL against which to resolve every API call's (relative) path.
* Overrides the default value set in spec file if present
* @param {string} basePath
*/
constructor(basePath?: string);
/**
* The base URL against which to resolve every API call's (relative) path.
* @type {string}
* @default https://api.voucherify.io
*/
basePath: 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 timeout for all API calls.
* @type {number}
* @default 60000
*/
timeout: 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;
/**
* If set to true, the client will save the cookies from each server
* response, and return them in the next request.
* @default false
*/
enableCookies: boolean;
agent: any;
requestAgent: any;
plugins: any;
/**
* Returns a string representation for an actual parameter.
* @param param The actual parameter.
* @returns {string} The string representation of param.
*/
paramToString(param: any): string;
/**
* Builds full URL by appending the given path to the base URL and replacing path parameter place-holders with parameter values.
* NOTE: query parameters are not handled here.
* @param {string} path The path to append to the base URL.
* @param {object} pathParams The parameter values to append.
* @param {string} apiBasePath Base path defined in the path, operation level to override the default one
* @returns {string} The encoded path with parameter values substituted.
*/
buildUrl(path: string, pathParams: object, apiBasePath: string): string;
/**
* Checks whether the given content type represents JSON.
* JSON content type examples:
*
* - application/json
* - application/json; charset=UTF8
* - APPLICATION/JSON
*
* @param {string} contentType The MIME content type to check.
* @returns {Boolean} true if contentType represents JSON, otherwise false.
*/
isJsonMime(contentType: string): boolean;
/**
* Chooses a content type from the given array, with JSON preferred; i.e. return JSON if included, otherwise return the first.
* @param {Array.} contentTypes
* @returns {string} The chosen content type, preferring JSON.
*/
jsonPreferredMime(contentTypes: Array): string;
/**
* Checks whether the given parameter value represents file-like content.
* @param param The parameter to check.
* @returns {Boolean} true if param represents a file.
*/
isFileParam(param: any): boolean;
/**
* Normalizes parameter values:
*
* - remove nils
* - keep files and arrays
* - format to string with `paramToString` for other cases
*
* @param {Object.} params The parameters as object properties.
* @returns {Object.} normalized parameters.
*/
normalizeParams(params: any): any;
/**
* Applies authentication headers to the request.
* @param {object} request The request object created by a superagent() call.
* @param {Array.} authNames An array of authentication method names.
*/
applyAuthToRequest(request: object, authNames: Array): void;
/**
* Deserializes an HTTP response body into a value of the specified type.
* @param {object} response A SuperAgent response object.
* @param {(String|Array.|Object.|Function)} returnType 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 A value of the specified type.
*/
deserialize(response: object, returnType: (string | Array | any | Function)): any;
/**
* Callback function to receive the result of the operation.
* @callback module:ApiClient~callApiCallback
* @param {Error|null} error Error object if failed, null otherwise.
* @param {*} [data] Deserialized data if successful.
* @param {Object} [response] Full response object if successful.
*/
/**
* 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|ObjectFunction)} returnType The required type to return; can be a string for simple types or the
* constructor for a complex type.
* @param {string} apiBasePath base path defined in the operation/path level to override the default one
* @param {module:ApiClient~callApiCallback} callback The callback function.
* @returns {Object} The SuperAgent request object.
*/
callApi(path: string, httpMethod: string, pathParams: any, queryParams: any, headerParams: any, formParams: any, bodyParam: object, authNames: Array, contentTypes: Array, accepts: Array, returnType: (string | any[] | ObjectFunction), apiBasePath: string, callback: any): any;
/**
* Gets an array of host settings
* @returns An array of host settings
*/
hostSettings(): {
url: string;
description: string;
variables: {
cluster: {
description: string;
default_value: string;
enum_values: string[];
};
};
}[];
getBasePathFromSettings(index: any, variables?: {}): string;
}
declare namespace ApiClient {
namespace CollectionFormatEnum {
let CSV: string;
let SSV: string;
let TSV: string;
let PIPES: string;
let MULTI: string;
}
/**
* *
*/
type CollectionFormatEnum = string;
let instance: any;
}