utilityQuote method

Future<UtilityQuote?> utilityQuote({
  1. UtilityOrderRequest? utilityOrderRequest,
  2. Future<void>? abortTrigger,
})

Quote utility payments

Prices the order body with current prices, without placing an order. Takes the same body as order, with offer public IDs; a biller's own ID is not an offer (400 / 11004). Each item is priced on its own, in request order; the first failing item aborts the quote and is named at items[i], for example 409 / 11002 at items[i].inputs.maxPrice when the current price is above it. A quote reserves nothing, does not expire, submits no payment and does not check the customer's account with the biller.

Parameters:

Implementation

Future<UtilityQuote?> utilityQuote({ UtilityOrderRequest? utilityOrderRequest, Future<void>? abortTrigger, }) async {
  final response = await utilityQuoteWithHttpInfo(utilityOrderRequest: utilityOrderRequest, abortTrigger: abortTrigger,);
  if (response.statusCode >= HttpStatus.badRequest) {
    throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  }
  // When a remote server returns no body with a status of 204, we shall not decode it.
  // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  // FormatException when trying to decode an empty string.
  if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
    return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'UtilityQuote',) as UtilityQuote;

  }
  return null;
}