import { HttpHeaders, HttpMethod } from '@refinitiv-data/common';
import { Session } from '../../session';
/**
 * An EndpointRequest is an ease of use wrapper around the Data (request/response) delivery mechanism of the platform.
 */
export interface EndpointRequestDefinition {
    readonly url?: string;
    readonly method?: HttpMethod;
    readonly query?: {};
    readonly body?: {};
    readonly path?: {};
    readonly headers?: HttpHeaders;
    readonly handleAutoRedirect?: boolean;
    /**
     * Sends the request with parameters to the endpoint.
     *
     * @param session - The Session defines the platform where you want to retrieve your data. See [[Session]].
     * @returns a Promise that will be resolved with the endpoint response or rejected in case of an error
     * @throws [[HttpErrorResponse]]
     */
    getData<T>(session?: Session): Promise<EndpointResponse<T>>;
}
/**
 * Defines EndpointRequest Definition specification.
 */
export interface EndpointRequestDefinitionParams {
    /**
     * The Url presents the address of the endpoint.
     */
    url: string;
    /**
     * Defines the method of the request. Valid methods are: GET, POST, PUT and DELETE.
     * @default HttpMethod.GET
     */
    method?: HttpMethod;
    /**
     * Defines the query parameters used to apply to the request.
     */
    queryParameters?: {};
    /**
     * Defines the body used to apply to the request.
     */
    bodyParameters?: {};
    /**
     * Defines the headers used to apply to the request.
     */
    headerParameters?: HttpHeaders;
    /**
     * Defines the path variables used to apply to the request.
     */
    pathParameters?: {};
    /**
     * Notify the HTTP client to handle all HTTP Redirects automatically or not.
     * @default true
     */
    handleAutoRedirect?: boolean;
}
export interface EndpointResponse<T = any> {
    /**
     * Defines data returned by the endpoint.
     */
    data: T;
    /**
     * Defines HTTP status code from the endpoint response.
     */
    httpStatus: number;
    /**
     * Defines the headers that the endpoint responded with.
     */
    httpHeaders: HttpHeaders;
}
