waitForNthMissedEmail method
Wait for Nth missed email
Wait for 0 based index missed email
Parameters:
-
int index (required): Zero based index of the email to wait for. If 1 missed email already and you want to wait for the 2nd email pass index=1
-
String inboxId: Optional inbox ID filter
-
int timeout: Optional timeout milliseconds
-
DateTime since: Filter by created at after the given timestamp
-
DateTime before: Filter by created at before the given timestamp
Implementation
Future<MissedEmailDto?> waitForNthMissedEmail(int index, { String? inboxId, int? timeout, DateTime? since, DateTime? before, }) async {
final response = await waitForNthMissedEmailWithHttpInfo(index, inboxId: inboxId, timeout: timeout, 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), 'MissedEmailDto',) as MissedEmailDto;
}
return null;
}