UNPKG

923 BTypeScriptView Raw
1import { services } from 'ask-sdk-model';
2import ApiClientResponse = services.ApiClientResponse;
3import ApiClientRequest = services.ApiClientRequest;
4import ApiClient = services.ApiClient;
5/**
6 * Default implementation of {@link services.ApiClient} which uses the native HTTP/HTTPS library of Node.JS.
7 */
8export declare class DefaultApiClient implements ApiClient {
9 /**
10 * Dispatches a request to an API endpoint described in the request.
11 * An ApiClient is expected to resolve the Promise in the case an API returns a non-200 HTTP
12 * status code. The responsibility of translating a particular response code to an error lies with the
13 * caller to invoke.
14 * @param {services.ApiClientRequest} request request to dispatch to the ApiClient
15 * @returns {Promise<services.ApiClientResponse>} response from the ApiClient
16 */
17 invoke(request: ApiClientRequest): Promise<ApiClientResponse>;
18}