getEmailsWithHttpInfo method

Future<Response> getEmailsWithHttpInfo(
  1. String inboxId, {
  2. int? size,
  3. int? limit,
  4. String? sort,
  5. int? retryTimeout,
  6. int? delayTimeout,
  7. int? minCount,
  8. bool? unreadOnly,
  9. DateTime? before,
  10. DateTime? since,
})

Get emails in an Inbox. This method is not idempotent as it allows retries and waits if you want certain conditions to be met before returning. For simple listing and sorting of known emails use the email controller instead.

List emails that an inbox has received. Only emails that are sent to the inbox's email address will appear in the inbox. It may take several seconds for any email you send to an inbox's email address to appear in the inbox. To make this endpoint wait for a minimum number of emails use the minCount parameter. The server will retry the inbox database until the minCount is satisfied or the retryTimeout is reached

Note: This method returns the HTTP Response.

Parameters:

  • String inboxId (required): Id of inbox that emails belongs to

  • int size: Alias for limit. Assessed first before assessing any passed limit.

  • int limit: Limit the result set, ordered by received date time sort direction. Maximum 100. For more listing options see the email controller

  • String sort: Sort the results by received date and direction ASC or DESC

  • int retryTimeout: Maximum milliseconds to spend retrying inbox database until minCount emails are returned

  • int delayTimeout:

  • int minCount: Minimum acceptable email count. Will cause request to hang (and retry) until minCount is satisfied or retryTimeout is reached.

  • bool unreadOnly:

  • DateTime before: Exclude emails received after this ISO 8601 date time

  • DateTime since: Exclude emails received before this ISO 8601 date time

Implementation

Future<Response> getEmailsWithHttpInfo(String inboxId, { int? size, int? limit, String? sort, int? retryTimeout, int? delayTimeout, int? minCount, bool? unreadOnly, DateTime? before, DateTime? since, }) async {
  // ignore: prefer_const_declarations
  final path = r'/inboxes/{inboxId}/emails'
    .replaceAll('{inboxId}', inboxId);

  // ignore: prefer_final_locals
  Object? postBody;

  final queryParams = <QueryParam>[];
  final headerParams = <String, String>{};
  final formParams = <String, String>{};

  if (size != null) {
    queryParams.addAll(_queryParams('', 'size', size));
  }
  if (limit != null) {
    queryParams.addAll(_queryParams('', 'limit', limit));
  }
  if (sort != null) {
    queryParams.addAll(_queryParams('', 'sort', sort));
  }
  if (retryTimeout != null) {
    queryParams.addAll(_queryParams('', 'retryTimeout', retryTimeout));
  }
  if (delayTimeout != null) {
    queryParams.addAll(_queryParams('', 'delayTimeout', delayTimeout));
  }
  if (minCount != null) {
    queryParams.addAll(_queryParams('', 'minCount', minCount));
  }
  if (unreadOnly != null) {
    queryParams.addAll(_queryParams('', 'unreadOnly', unreadOnly));
  }
  if (before != null) {
    queryParams.addAll(_queryParams('', 'before', before));
  }
  if (since != null) {
    queryParams.addAll(_queryParams('', 'since', since));
  }

  const contentTypes = <String>[];


  return apiClient.invokeAPI(
    path,
    'GET',
    queryParams,
    postBody,
    headerParams,
    formParams,
    contentTypes.isEmpty ? null : contentTypes.first,
  );
}