import { AuthTokens } from "./auth/tokens";
import { APIOptions } from "./apioptions";
import { DeleteOrderForAccountByOrderIdRequest, DeleteOrderForAccountByOrderIdResponse, GetOrderForAccountByOrderIdRequest, GetOrderForAccountByOrderIdResponse, GetOrdersForAccountRequest, GetOrdersForAccountResponse, GetOrdersForAllAccountsRequest, GetOrdersForAllAccountsResponse, PostOrderForAccountRequest, PostOrderForAccountResponse, PreviewOrderForAccountRequest, PreviewOrderForAccountResponse, ReplaceOrderForAccountByOrderIdRequest, ReplaceOrderForAccountByOrderIdResponse } from "./api-types/orders.types";
import { ErrorMessageAndErrors } from "./api-types/api.types";
/**
 * Retrieves orders for a specific Schwab account based on filtering criteria.
 * Corresponds to the 'Get Orders for Account' API endpoint.
 *
 * @async
 * @function getOrdersForAccount
 * @param {GetOrdersForAccountRequest} request - The request object containing filtering parameters.
 * @param {EncryptedAccountNumber} request.accountNumber - Encrypted account number (hashValue). Required.
 * @param {Date} request.fromEnteredTime - Start date/time for filtering orders. Required.
 * @param {Date} request.toEnteredTime - End date/time for filtering orders. Required.
 * @param {number} [request.maxResults] - Maximum number of orders to return. Optional.
 * @param {OrderStatusEnum} [request.status] - Filter orders by status. Optional.
 * @param {AuthTokens} token - Authentication tokens. Required.
 * @param {APIOptions} [apiOptions] - Optional API configuration (e.g., base URI).
 * @returns {Promise<GetOrdersForAccountResponse | ErrorMessageAndErrors>} A promise that resolves to an array of orders matching the criteria or an error object.
 * @throws {Error} Throws an error if required parameters are missing or if the fetch operation fails.
 */
export declare function getOrdersForAccount(request: GetOrdersForAccountRequest, token: AuthTokens, apiOptions?: APIOptions): Promise<GetOrdersForAccountResponse | ErrorMessageAndErrors>;
/**
 * Retrieves a specific order by its ID for a given Schwab account.
 * Corresponds to the 'Get Order' API endpoint.
 *
 * @async
 * @function getOrderForAccountByOrderId
 * @param {GetOrderForAccountByOrderIdRequest} request - The request object.
 * @param {EncryptedAccountNumber} request.accountNumber - Encrypted account number (hashValue). Required.
 * @param {number} request.orderId - The unique ID of the order to retrieve. Required.
 * @param {AuthTokens} token - Authentication tokens. Required.
 * @param {APIOptions} [apiOptions] - Optional API configuration.
 * @returns {Promise<GetOrderForAccountByOrderIdResponse | ErrorMessageAndErrors>} A promise that resolves to the requested order details or an error object.
 * @throws {Error} Throws an error if required parameters are missing or if the fetch operation fails.
 */
export declare function getOrderForAccountByOrderId(request: GetOrderForAccountByOrderIdRequest, token: AuthTokens, apiOptions?: APIOptions): Promise<GetOrderForAccountByOrderIdResponse | ErrorMessageAndErrors>;
/**
 * Places a new order for a specific Schwab account.
 * Corresponds to the 'Place Order' API endpoint.
 * Note: For multi-leg orders (options, etc.), ensure the `orderLegCollection` in `request.order` is correctly populated.
 *
 * @async
 * @function placeOrderForAccount
 * @param {PostOrderForAccountRequest} request - The request object.
 * @param {EncryptedAccountNumber} request.accountNumber - Encrypted account number (hashValue). Required.
 * @param {Order} request.order - The order object containing all details for the new order. Required.
 * @param {AuthTokens} token - Authentication tokens. Required.
 * @param {APIOptions} [apiOptions] - Optional API configuration.
 * @returns {Promise<PostOrderForAccountResponse | ErrorMessageAndErrors>} A promise that resolves to the details of the successfully placed order (including its new orderId) or an error object. The response often includes the location header pointing to the newly created order.
 * @throws {Error} Throws an error if required parameters are missing or if the fetch operation fails.
 */
export declare function placeOrderForAccount(request: PostOrderForAccountRequest, token: AuthTokens, apiOptions?: APIOptions): Promise<PostOrderForAccountResponse | ErrorMessageAndErrors>;
/**
 * Deletes (cancels) a specific order by its ID for a given Schwab account.
 * Corresponds to the 'Cancel Order' API endpoint.
 * Note: Only orders in a cancelable state (e.g., WORKING, QUEUED) can be canceled.
 *
 * @async
 * @function deleteOrderForAccountByOrderId
 * @param {DeleteOrderForAccountByOrderIdRequest} request - The request object.
 * @param {EncryptedAccountNumber} request.accountNumber - Encrypted account number (hashValue). Required.
 * @param {number} request.orderId - The unique ID of the order to cancel. Required.
 * @param {AuthTokens} token - Authentication tokens. Required.
 * @param {APIOptions} [apiOptions] - Optional API configuration.
 * @returns {Promise<DeleteOrderForAccountByOrderIdResponse | ErrorMessageAndErrors>} A promise that resolves to an empty object on successful cancellation or an error object if cancellation fails (e.g., order already filled, not found, or not cancelable).
 * @throws {Error} Throws an error if required parameters are missing or if the fetch operation fails.
 */
export declare function deleteOrderForAccountByOrderId(request: DeleteOrderForAccountByOrderIdRequest, token: AuthTokens, apiOptions?: APIOptions): Promise<DeleteOrderForAccountByOrderIdResponse | ErrorMessageAndErrors>;
/**
 * Replaces (modifies) an existing order with a new set of order details for a given Schwab account.
 * Corresponds to the 'Replace Order' API endpoint.
 * Note: Only orders in an editable state can be replaced. The entire `order` object must be provided with the desired modifications.
 *
 * @async
 * @function replaceOrderForAccountByOrderId
 * @param {ReplaceOrderForAccountByOrderIdRequest} request - The request object.
 * @param {EncryptedAccountNumber} request.accountNumber - Encrypted account number (hashValue). Required.
 * @param {number} request.orderId - The unique ID of the order to replace. Required.
 * @param {Order} request.order - The new order object containing the updated details. Required.
 * @param {AuthTokens} token - Authentication tokens. Required.
 * @param {APIOptions} [apiOptions] - Optional API configuration.
 * @returns {Promise<ReplaceOrderForAccountByOrderIdResponse | ErrorMessageAndErrors>} A promise that resolves to an empty object on successful replacement or an error object if replacement fails. Some APIs might return the details of the new order upon success.
 * @throws {Error} Throws an error if required parameters are missing or if the fetch operation fails.
 */
export declare function replaceOrderForAccountByOrderId(request: ReplaceOrderForAccountByOrderIdRequest, token: AuthTokens, apiOptions?: APIOptions): Promise<ReplaceOrderForAccountByOrderIdResponse | ErrorMessageAndErrors>;
/**
 * Retrieves orders across all accounts linked to the authenticated user, based on filtering criteria.
 * Corresponds to the 'Get Orders' API endpoint (without account ID).
 *
 * @async
 * @function getOrdersForAllAccounts
 * @param {GetOrdersForAllAccountsRequest} request - The request object containing filtering parameters.
 * @param {Date} request.fromEnteredTime - Start date/time for filtering orders. Required.
 * @param {Date} request.toEnteredTime - End date/time for filtering orders. Required.
 * @param {number} [request.maxResults] - Maximum number of orders to return. Optional.
 * @param {OrderStatusEnum} [request.status] - Filter orders by status. Optional.
 * @param {AuthTokens} token - Authentication tokens. Required.
 * @param {APIOptions} [apiOptions] - Optional API configuration.
 * @returns {Promise<GetOrdersForAllAccountsResponse | ErrorMessageAndErrors>} A promise that resolves to an array of orders from all linked accounts matching the criteria or an error object.
 * @throws {Error} Throws an error if required parameters are missing or if the fetch operation fails.
 */
export declare function getOrdersForAllAccounts(request: GetOrdersForAllAccountsRequest, token: AuthTokens, apiOptions?: APIOptions): Promise<GetOrdersForAllAccountsResponse | ErrorMessageAndErrors>;
/**
 * Previews an order for a specific Schwab account without actually placing it.
 * Useful for validating the order and getting estimated commission/fees.
 * Corresponds to the 'Preview Order' API endpoint.
 *
 * @async
 * @function placePreviewOrderForAccount
 * @param {PreviewOrderForAccountRequest} request - The request object, mirroring the structure for placing an order.
 * @param {EncryptedAccountNumber} request.accountNumber - Encrypted account number (hashValue). Required.
 * @param {Order} request.order - The order object containing details for the order to be previewed. Required.
 * @param {AuthTokens} token - Authentication tokens. Required.
 * @param {APIOptions} [apiOptions] - Optional API configuration.
 * @returns {Promise<PreviewOrderForAccountResponse | ErrorMessageAndErrors>} A promise that resolves to the preview details (which might include validation results, estimated commissions, and the order structure) or an error object if the preview fails validation.
 * @throws {Error} Throws an error if required parameters are missing or if the fetch operation fails.
 */
export declare function placePreviewOrderForAccount(request: PreviewOrderForAccountRequest, token: AuthTokens, apiOptions?: APIOptions): Promise<PreviewOrderForAccountResponse | ErrorMessageAndErrors>;
//# sourceMappingURL=orders.api.d.ts.map