flushExpired method

Future<FlushExpiredInboxesResult?> flushExpired({
  1. DateTime? before,
})

Remove expired inboxes

Remove any expired inboxes for your account (instead of waiting for scheduled removal on server)

Parameters:

  • DateTime before: Optional expired at before flag to flush expired inboxes that have expired before the given time

Implementation

Future<FlushExpiredInboxesResult?> flushExpired({ DateTime? before, }) async {
  final response = await flushExpiredWithHttpInfo( 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), 'FlushExpiredInboxesResult',) as FlushExpiredInboxesResult;

  }
  return null;
}