waitForDeliveryStatuses method

Future<DeliveryStatusDto?> waitForDeliveryStatuses({
  1. String? sentId,
  2. String? inboxId,
  3. int? timeout,
  4. int? index,
  5. DateTime? since,
  6. DateTime? before,
})

Wait for delivery statuses

Parameters:

  • String sentId: Optional sent email ID filter

  • String inboxId: Optional inbox ID filter

  • int timeout: Optional timeout milliseconds

  • int index: Zero based index of the delivery status to wait for. If 1 delivery status already and you want to wait for the 2nd pass index=1

  • DateTime since: Filter by created at after the given timestamp

  • DateTime before: Filter by created at before the given timestamp

Implementation

Future<DeliveryStatusDto?> waitForDeliveryStatuses({ String? sentId, String? inboxId, int? timeout, int? index, DateTime? since, DateTime? before, }) async {
  final response = await waitForDeliveryStatusesWithHttpInfo( sentId: sentId, inboxId: inboxId, timeout: timeout, index: index, since: since, before: before, );
  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), 'DeliveryStatusDto',) as DeliveryStatusDto;

  }
  return null;
}