waitForEmailCountWithHttpInfo method

Future<Response> waitForEmailCountWithHttpInfo(
  1. String inboxId,
  2. int count, {
  3. int? timeout,
  4. bool? unreadOnly,
  5. DateTime? before,
  6. DateTime? since,
  7. String? sort,
  8. int? delay,
})

Wait for and return count number of emails. Hold connection until inbox count matches expected or timeout occurs

If inbox contains count or more emails at time of request then return count worth of emails. If not wait until the count is reached and return those or return an error if timeout is exceeded.

Note: This method returns the HTTP Response.

Parameters:

  • String inboxId (required): Id of the inbox we are fetching emails from

  • int count (required): Number of emails to wait for. Must be greater that 1

  • int timeout: Max milliseconds to wait

  • bool unreadOnly: Optional filter for unread only

  • DateTime before: Filter for emails that were received before the given timestamp

  • DateTime since: Filter for emails that were received after the given timestamp

  • String sort: Sort direction

  • int delay: Max milliseconds delay between calls

Implementation

Future<Response> waitForEmailCountWithHttpInfo(String inboxId, int count, { int? timeout, bool? unreadOnly, DateTime? before, DateTime? since, String? sort, int? delay, }) async {
  // ignore: prefer_const_declarations
  final path = r'/waitForEmailCount';

  // ignore: prefer_final_locals
  Object? postBody;

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

    queryParams.addAll(_queryParams('', 'inboxId', inboxId));
    queryParams.addAll(_queryParams('', 'count', count));
  if (timeout != null) {
    queryParams.addAll(_queryParams('', 'timeout', timeout));
  }
  if (unreadOnly != null) {
    queryParams.addAll(_queryParams('', 'unreadOnly', unreadOnly));
  }
  if (before != null) {
    queryParams.addAll(_queryParams('', 'before', before));
  }
  if (since != null) {
    queryParams.addAll(_queryParams('', 'since', since));
  }
  if (sort != null) {
    queryParams.addAll(_queryParams('', 'sort', sort));
  }
  if (delay != null) {
    queryParams.addAll(_queryParams('', 'delay', delay));
  }

  const contentTypes = <String>[];


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