UNPKG

redis-cloud-api-sdk

Version:
77 lines (76 loc) 2.11 kB
import { AxiosInstance, AxiosResponse } from 'axios'; import { CloudAPISDKParameters } from '../api'; export declare class Client { /** * The protocol of the API. Default: 'https' */ protocol: string; /** * The domain of the API. Default: 'api.redislabs.com' */ domain: string; /** * The version of the API. Default: 'v1' */ version: string; /** * If to report debug logs when performing requests. Default: false */ debug: boolean; /** * The Axios HTTP Client. */ httpClient: AxiosInstance; /** * The access key for authentication. */ accessKey: string; /** * The secret key for authentication. */ secretKey: string; /** * Initializing the API base of the SDK * @param parameters The parameters of the SDK */ constructor(parameters: CloudAPISDKParameters); /** * Performing a "GET" request * @param url The URL of the request * @returns An Axios Response */ get(url: string): Promise<AxiosResponse<any, any>>; /** * Performing a "POST" request * @param url The URL of the request * @param body The body of the request * @returns An Axios Response */ post(url: string, body?: any): Promise<AxiosResponse<any, any>>; /** * Performing a "PUT" request * @param url The URL of the request * @param body The body of the request * @returns An Axios Response */ put(url: string, body?: any): Promise<AxiosResponse<any, any>>; /** * Performing a "DELETE" request * @param url The URL of the request * @returns An Axios Response */ delete(url: string): Promise<AxiosResponse<any, any>>; /** * Log messages depending on log levels * @param level The log level * @param message The message */ log(level: 'debug', message: string): void; /** * Freezing the code for a number of seconds * @param seconds seconds to freeze the code */ sleep(seconds: number): Promise<{ [key: string]: any; }>; }