-
public final class WaitForControllerApi extends ApiClient
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classWaitForControllerApi.Companion
-
Constructor Summary
Constructors Constructor Description WaitForControllerApi(String xApiKey, String basePath)
-
Method Summary
Modifier and Type Method Description final StringgetBaseUrl()final List<EmailPreview>waitFor(WaitForConditions waitForConditions)Wait for an email to match the provided filter conditions such as subject contains keyword. final RequestConfigwaitForRequestConfig(WaitForConditions waitForConditions)To obtain the request config of the operation waitFor final List<EmailPreview>waitForEmailCount(UUID inboxId, Integer count, Long timeout, Boolean unreadOnly, OffsetDateTime before, OffsetDateTime since, String sort, Long delay)Wait for and return count number of emails. final RequestConfigwaitForEmailCountRequestConfig(UUID inboxId, Integer count, Long timeout, Boolean unreadOnly, OffsetDateTime before, OffsetDateTime since, String sort, Long delay)To obtain the request config of the operation waitForEmailCount final EmailwaitForLatestEmail(UUID inboxId, Long timeout, Boolean unreadOnly, OffsetDateTime before, OffsetDateTime since, String sort, Long delay)Fetch inbox's latest email or if empty wait for an email to arrive Will return either the last received email or wait for an email to arrive and return that. final RequestConfigwaitForLatestEmailRequestConfig(UUID inboxId, Long timeout, Boolean unreadOnly, OffsetDateTime before, OffsetDateTime since, String sort, Long delay)To obtain the request config of the operation waitForLatestEmail final List<EmailPreview>waitForMatchingEmails(UUID inboxId, Integer count, MatchOptions matchOptions, OffsetDateTime before, OffsetDateTime since, String sort, Long delay, Long timeout, Boolean unreadOnly)Wait or return list of emails that match simple matching patterns Perform a search of emails in an inbox with the given patterns. final RequestConfigwaitForMatchingEmailsRequestConfig(UUID inboxId, Integer count, MatchOptions matchOptions, OffsetDateTime before, OffsetDateTime since, String sort, Long delay, Long timeout, Boolean unreadOnly)To obtain the request config of the operation waitForMatchingEmails final EmailwaitForMatchingFirstEmail(UUID inboxId, MatchOptions matchOptions, Long timeout, Boolean unreadOnly, OffsetDateTime since, OffsetDateTime before, String sort, Long delay)Wait for or return the first email that matches provided MatchOptions array Perform a search of emails in an inbox with the given patterns. final RequestConfigwaitForMatchingFirstEmailRequestConfig(UUID inboxId, MatchOptions matchOptions, Long timeout, Boolean unreadOnly, OffsetDateTime since, OffsetDateTime before, String sort, Long delay)To obtain the request config of the operation waitForMatchingFirstEmail final EmailwaitForNthEmail(UUID inboxId, Integer index, Long timeout, Boolean unreadOnly, OffsetDateTime since, OffsetDateTime before, String sort, Long delay)Wait for or fetch the email with a given index in the inbox specified. final RequestConfigwaitForNthEmailRequestConfig(UUID inboxId, Integer index, Long timeout, Boolean unreadOnly, OffsetDateTime since, OffsetDateTime before, String sort, Long delay)To obtain the request config of the operation waitForNthEmail -
-
Method Detail
-
getBaseUrl
final String getBaseUrl()
-
waitFor
final List<EmailPreview> waitFor(WaitForConditions waitForConditions)
Wait for an email to match the provided filter conditions such as subject contains keyword. Generic waitFor method that will wait until an inbox meets given conditions or return immediately if already met
-
waitForRequestConfig
final RequestConfig waitForRequestConfig(WaitForConditions waitForConditions)
To obtain the request config of the operation waitFor
-
waitForEmailCount
final List<EmailPreview> waitForEmailCount(UUID inboxId, Integer count, Long timeout, Boolean unreadOnly, OffsetDateTime before, OffsetDateTime since, String sort, Long 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.
- Parameters:
inboxId- Id of the inbox we are fetching emails fromcount- Number of emails to wait for.timeout- Max milliseconds to wait (optional)unreadOnly- Optional filter for unread only (optional, default to false)before- Filter for emails that were received before the given timestamp (optional)since- Filter for emails that were received after the given timestamp (optional)sort- Sort direction (optional)delay- Max milliseconds delay between calls (optional)
-
waitForEmailCountRequestConfig
final RequestConfig waitForEmailCountRequestConfig(UUID inboxId, Integer count, Long timeout, Boolean unreadOnly, OffsetDateTime before, OffsetDateTime since, String sort, Long delay)
To obtain the request config of the operation waitForEmailCount
- Parameters:
inboxId- Id of the inbox we are fetching emails fromcount- Number of emails to wait for.timeout- Max milliseconds to wait (optional)unreadOnly- Optional filter for unread only (optional, default to false)before- Filter for emails that were received before the given timestamp (optional)since- Filter for emails that were received after the given timestamp (optional)sort- Sort direction (optional)delay- Max milliseconds delay between calls (optional)
-
waitForLatestEmail
final Email waitForLatestEmail(UUID inboxId, Long timeout, Boolean unreadOnly, OffsetDateTime before, OffsetDateTime since, String sort, Long delay)
Fetch inbox's latest email or if empty wait for an email to arrive Will return either the last received email or wait for an email to arrive and return that. If you need to wait for an email for a non-empty inbox set `unreadOnly=true` or see the other receive methods such as `waitForNthEmail` or `waitForEmailCount`.
- Parameters:
inboxId- Id of the inbox we are fetching emails from (optional)timeout- Max milliseconds to wait (optional)unreadOnly- Optional filter for unread only.before- Filter for emails that were before after the given timestamp (optional)since- Filter for emails that were received after the given timestamp (optional)sort- Sort direction (optional)delay- Max milliseconds delay between calls (optional)
-
waitForLatestEmailRequestConfig
final RequestConfig waitForLatestEmailRequestConfig(UUID inboxId, Long timeout, Boolean unreadOnly, OffsetDateTime before, OffsetDateTime since, String sort, Long delay)
To obtain the request config of the operation waitForLatestEmail
- Parameters:
inboxId- Id of the inbox we are fetching emails from (optional)timeout- Max milliseconds to wait (optional)unreadOnly- Optional filter for unread only.before- Filter for emails that were before after the given timestamp (optional)since- Filter for emails that were received after the given timestamp (optional)sort- Sort direction (optional)delay- Max milliseconds delay between calls (optional)
-
waitForMatchingEmails
final List<EmailPreview> waitForMatchingEmails(UUID inboxId, Integer count, MatchOptions matchOptions, OffsetDateTime before, OffsetDateTime since, String sort, Long delay, Long timeout, Boolean unreadOnly)
Wait or return list of emails that match simple matching patterns Perform a search of emails in an inbox with the given patterns. If results match expected count then return or else retry the search until results are found or timeout is reached. Match options allow simple CONTAINS or EQUALS filtering on SUBJECT, TO, BCC, CC, and FROM. See the `MatchOptions` object for options. An example payload is `{ matches: {field: 'SUBJECT',should:'CONTAIN',value:'needle'} }`. You can use an array of matches and they will be applied sequentially to filter out emails. If you want to perform matches and extractions of content using Regex patterns see the EmailController `getEmailContentMatch` method.
- Parameters:
inboxId- Id of the inbox we are fetching emails fromcount- Number of emails to wait for.before- Filter for emails that were received before the given timestamp (optional)since- Filter for emails that were received after the given timestamp (optional)sort- Sort direction (optional)delay- Max milliseconds delay between calls (optional)timeout- Max milliseconds to wait (optional)unreadOnly- Optional filter for unread only (optional, default to false)
-
waitForMatchingEmailsRequestConfig
final RequestConfig waitForMatchingEmailsRequestConfig(UUID inboxId, Integer count, MatchOptions matchOptions, OffsetDateTime before, OffsetDateTime since, String sort, Long delay, Long timeout, Boolean unreadOnly)
To obtain the request config of the operation waitForMatchingEmails
- Parameters:
inboxId- Id of the inbox we are fetching emails fromcount- Number of emails to wait for.before- Filter for emails that were received before the given timestamp (optional)since- Filter for emails that were received after the given timestamp (optional)sort- Sort direction (optional)delay- Max milliseconds delay between calls (optional)timeout- Max milliseconds to wait (optional)unreadOnly- Optional filter for unread only (optional, default to false)
-
waitForMatchingFirstEmail
final Email waitForMatchingFirstEmail(UUID inboxId, MatchOptions matchOptions, Long timeout, Boolean unreadOnly, OffsetDateTime since, OffsetDateTime before, String sort, Long delay)
Wait for or return the first email that matches provided MatchOptions array Perform a search of emails in an inbox with the given patterns. If a result if found then return or else retry the search until a result is found or timeout is reached. Match options allow simple CONTAINS or EQUALS filtering on SUBJECT, TO, BCC, CC, and FROM. See the `MatchOptions` object for options. An example payload is `{ matches: {field: 'SUBJECT',should:'CONTAIN',value:'needle'} }`. You can use an array of matches and they will be applied sequentially to filter out emails. If you want to perform matches and extractions of content using Regex patterns see the EmailController `getEmailContentMatch` method.
- Parameters:
inboxId- Id of the inbox we are matching an email fortimeout- Max milliseconds to wait (optional)unreadOnly- Optional filter for unread only (optional, default to false)since- Filter for emails that were received after the given timestamp (optional)before- Filter for emails that were received before the given timestamp (optional)sort- Sort direction (optional)delay- Max milliseconds delay between calls (optional)
-
waitForMatchingFirstEmailRequestConfig
final RequestConfig waitForMatchingFirstEmailRequestConfig(UUID inboxId, MatchOptions matchOptions, Long timeout, Boolean unreadOnly, OffsetDateTime since, OffsetDateTime before, String sort, Long delay)
To obtain the request config of the operation waitForMatchingFirstEmail
- Parameters:
inboxId- Id of the inbox we are matching an email fortimeout- Max milliseconds to wait (optional)unreadOnly- Optional filter for unread only (optional, default to false)since- Filter for emails that were received after the given timestamp (optional)before- Filter for emails that were received before the given timestamp (optional)sort- Sort direction (optional)delay- Max milliseconds delay between calls (optional)
-
waitForNthEmail
final Email waitForNthEmail(UUID inboxId, Integer index, Long timeout, Boolean unreadOnly, OffsetDateTime since, OffsetDateTime before, String sort, Long delay)
Wait for or fetch the email with a given index in the inbox specified. If index doesn't exist waits for it to exist or timeout to occur. If nth email is already present in inbox then return it. If not hold the connection open until timeout expires or the nth email is received and returned.
- Parameters:
inboxId- Id of the inbox you are fetching emails from (optional)index- Zero based index of the email to wait for.timeout- Max milliseconds to wait for the nth email if not already present (optional)unreadOnly- Optional filter for unread only (optional, default to false)since- Filter for emails that were received after the given timestamp (optional)before- Filter for emails that were received before the given timestamp (optional)sort- Sort direction (optional)delay- Max milliseconds delay between calls (optional)
-
waitForNthEmailRequestConfig
final RequestConfig waitForNthEmailRequestConfig(UUID inboxId, Integer index, Long timeout, Boolean unreadOnly, OffsetDateTime since, OffsetDateTime before, String sort, Long delay)
To obtain the request config of the operation waitForNthEmail
- Parameters:
inboxId- Id of the inbox you are fetching emails from (optional)index- Zero based index of the email to wait for.timeout- Max milliseconds to wait for the nth email if not already present (optional)unreadOnly- Optional filter for unread only (optional, default to false)since- Filter for emails that were received after the given timestamp (optional)before- Filter for emails that were received before the given timestamp (optional)sort- Sort direction (optional)delay- Max milliseconds delay between calls (optional)
-
-
-
-