MailSlurp\WaitForControllerApi
All URIs are relative to https://golang.api.mailslurp.com
Method | HTTP request | Description |
---|---|---|
WaitFor | Post /waitFor | Wait for an email to match the provided filter conditions such as subject contains keyword. |
WaitForEmailCount | Get /waitForEmailCount | Wait for and return count number of emails. Hold connection until inbox count matches expected or timeout occurs |
WaitForLatestEmail | Get /waitForLatestEmail | Fetch inbox's latest email or if empty wait for an email to arrive |
WaitForLatestSms | Post /waitForLatestSms | Wait for the latest SMS message to match the provided filter conditions such as body contains keyword. |
WaitForMatchingEmails | Post /waitForMatchingEmails | Wait or return list of emails that match simple matching patterns |
WaitForMatchingFirstEmail | Post /waitForMatchingFirstEmail | Wait for or return the first email that matches provided MatchOptions array |
WaitForNthEmail | Get /waitForNthEmail | Wait for or fetch the email with a given in the inbox specified. If doesn't exist waits for it to exist or timeout to occur. |
WaitForSms | Post /waitForSms | Wait for an SMS message to match the provided filter conditions such as body contains keyword. |
WaitFor
[]EmailPreview WaitFor(ctx, 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
Required Parameters
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
waitForConditions | WaitForConditions |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: /
[Back to top] [Back to API list] [Back to Model list] [Back to ]
WaitForEmailCount
[]EmailPreview WaitForEmailCount(ctx, inboxId, count, optional)
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.
Required Parameters
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
inboxId | string | Id of the inbox we are fetching emails from | |
count | int32 | Number of emails to wait for. Must be greater that 1 | |
optional | *WaitForEmailCountOpts | optional parameters | nil if no parameters |
Optional Parameters
Optional parameters are passed through a pointer to a WaitForEmailCountOpts struct
Name | Type | Description | Notes |
---|---|---|---|
timeout | optional.Int64| Max milliseconds to wait | unreadOnly | optional.Bool| Optional filter for unread only | [default to false] before | optional.Time| Filter for emails that were received before the given timestamp | since | optional.Time| Filter for emails that were received after the given timestamp | sort | optional.String| Sort direction | delay | optional.Int64| Max milliseconds delay between calls |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: /
[Back to top] [Back to API list] [Back to Model list] [Back to ]
WaitForLatestEmail
Email WaitForLatestEmail(ctx, optional)
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
.
Required Parameters
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
optional | *WaitForLatestEmailOpts | optional parameters | nil if no parameters |
Optional Parameters
Optional parameters are passed through a pointer to a WaitForLatestEmailOpts struct
Name | Type | Description | Notes |
---|---|---|---|
inboxId | optional.Interface of string | Id of the inbox we are fetching emails from | |
timeout | optional.Int64 | Max milliseconds to wait | |
unreadOnly | optional.Bool | Optional filter for unread only. | [default to false] |
before | optional.Time | Filter for emails that were before after the given timestamp | |
since | optional.Time | Filter for emails that were received after the given timestamp | |
sort | optional.String | Sort direction | |
delay | optional.Int64 | Max milliseconds delay between calls |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: /
[Back to top] [Back to API list] [Back to Model list] [Back to ]
WaitForLatestSms
SmsDto WaitForLatestSms(ctx, waitForSingleSmsOptions)
Wait for the latest SMS message to match the provided filter conditions such as body contains keyword.
Wait until a phone number meets given conditions or return immediately if already met
Required Parameters
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
waitForSingleSmsOptions | WaitForSingleSmsOptions |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: /
[Back to top] [Back to API list] [Back to Model list] [Back to ]
WaitForMatchingEmails
[]EmailPreview WaitForMatchingEmails(ctx, inboxId, count, matchOptions, optional)
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.
Required Parameters
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
inboxId | string | Id of the inbox we are fetching emails from | |
count | int32 | Number of emails to wait for. Must be greater or equal to 1 | |
matchOptions | MatchOptions | ||
optional | *WaitForMatchingEmailsOpts | optional parameters | nil if no parameters |
Optional Parameters
Optional parameters are passed through a pointer to a WaitForMatchingEmailsOpts struct
Name | Type | Description | Notes |
---|---|---|---|
before | optional.Time| Filter for emails that were received before the given timestamp | since | optional.Time| Filter for emails that were received after the given timestamp | sort | optional.String| Sort direction | delay | optional.Int64| Max milliseconds delay between calls | timeout | optional.Int64| Max milliseconds to wait | unreadOnly | optional.Bool| Optional filter for unread only | [default to false]
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: /
[Back to top] [Back to API list] [Back to Model list] [Back to ]
WaitForMatchingFirstEmail
Email WaitForMatchingFirstEmail(ctx, inboxId, matchOptions, optional)
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.
Required Parameters
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
inboxId | string | Id of the inbox we are matching an email for | |
matchOptions | MatchOptions | ||
optional | *WaitForMatchingFirstEmailOpts | optional parameters | nil if no parameters |
Optional Parameters
Optional parameters are passed through a pointer to a WaitForMatchingFirstEmailOpts struct
Name | Type | Description | Notes |
---|---|---|---|
timeout | optional.Int64| Max milliseconds to wait | unreadOnly | optional.Bool| Optional filter for unread only | [default to false] since | optional.Time| Filter for emails that were received after the given timestamp | before | optional.Time| Filter for emails that were received before the given timestamp | sort | optional.String| Sort direction | delay | optional.Int64| Max milliseconds delay between calls |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: /
[Back to top] [Back to API list] [Back to Model list] [Back to ]
WaitForNthEmail
Email WaitForNthEmail(ctx, optional)
Wait for or fetch the email with a given in the inbox specified. If 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.
Required Parameters
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
optional | *WaitForNthEmailOpts | optional parameters | nil if no parameters |
Optional Parameters
Optional parameters are passed through a pointer to a WaitForNthEmailOpts struct
Name | Type | Description | Notes |
---|---|---|---|
inboxId | optional.Interface of string | Id of the inbox you are fetching emails from | |
**** | optional.Int32 | Zero based of the email to wait for. If an inbox has 1 email already and you want to wait for the 2nd email pass =1 | [default to 0] |
timeout | optional.Int64 | Max milliseconds to wait for the nth email if not already present | |
unreadOnly | optional.Bool | Optional filter for unread only | [default to false] |
since | optional.Time | Filter for emails that were received after the given timestamp | |
before | optional.Time | Filter for emails that were received before the given timestamp | |
sort | optional.String | Sort direction | |
delay | optional.Int64 | Max milliseconds delay between calls |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: /
[Back to top] [Back to API list] [Back to Model list] [Back to ]
WaitForSms
[]SmsPreview WaitForSms(ctx, waitForSmsConditions)
Wait for an SMS message to match the provided filter conditions such as body contains keyword.
Generic waitFor method that will wait until a phone number meets given conditions or return immediately if already met
Required Parameters
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
waitForSmsConditions | WaitForSmsConditions |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: /
[Back to top] [Back to API list] [Back to Model list] [Back to ]