getInboxes method

Future<List<InboxDto>?> getInboxes({
  1. int? size,
  2. String? sort,
  3. DateTime? since,
  4. bool? excludeCatchAllInboxes,
  5. DateTime? before,
})

List Inboxes and email addresses

List the inboxes you have created. Note use of the more advanced getAllInboxes is recommended and allows paginated access using a limit and sort parameter.

Parameters:

  • int size: Optional result size limit. Note an automatic limit of 100 results is applied. See the paginated getAllEmails for larger queries.

  • String sort: Optional createdAt sort direction ASC or DESC

  • DateTime since: Optional filter by created after given date time

  • bool excludeCatchAllInboxes: Optional exclude catch all inboxes

  • DateTime before: Optional filter by created before given date time

Implementation

Future<List<InboxDto>?> getInboxes({ int? size, String? sort, DateTime? since, bool? excludeCatchAllInboxes, DateTime? before, }) async {
  final response = await getInboxesWithHttpInfo( size: size, sort: sort, since: since, excludeCatchAllInboxes: excludeCatchAllInboxes, 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) {
    final responseBody = await _decodeBodyBytes(response);
    return (await apiClient.deserializeAsync(responseBody, 'List<InboxDto>') as List)
      .cast<InboxDto>()
      .toList();

  }
  return null;
}