mailslurp_client 4.3.3 → 5.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -8,9 +8,11 @@ Name | Type | Description | Notes
8
8
  **bcc** | **Array<String>** | | [optional]
9
9
  **body** | **String** | | [optional]
10
10
  **cc** | **Array<String>** | | [optional]
11
+ **charset** | **String** | | [optional]
11
12
  **created_at** | **DateTime** | |
12
13
  **from** | **String** | | [optional]
13
14
  **headers** | **Hash<String, String>** | | [optional]
15
+ **html** | **BOOLEAN** | | [optional]
14
16
  **id** | **String** | |
15
17
  **inbox_id** | **String** | |
16
18
  **raw_url** | **String** | | [optional]
@@ -3,7 +3,11 @@
3
3
  ## Properties
4
4
  Name | Type | Description | Notes
5
5
  ------------ | ------------- | ------------- | -------------
6
+ **bcc** | **Array<String>** | | [optional]
7
+ **cc** | **Array<String>** | | [optional]
6
8
  **created** | **DateTime** | |
7
9
  **id** | **String** | |
10
+ **subject** | **String** | | [optional]
11
+ **to** | **Array<String>** | |
8
12
 
9
13
 
@@ -9,10 +9,11 @@ Method | HTTP request | Description
9
9
  [**bulk_send_emails**](ExtraOperationsApi.md#bulk_send_emails) | **POST** /bulk/send | Bulk Send Emails
10
10
  [**create_inbox**](ExtraOperationsApi.md#create_inbox) | **POST** /inboxes | Create an Inbox (email address)
11
11
  [**create_webhook**](ExtraOperationsApi.md#create_webhook) | **POST** /inboxes/{inboxId}/webhooks | Attach a WebHook URL to an inbox
12
- [**delete_email**](ExtraOperationsApi.md#delete_email) | **DELETE** /emails/{emailId} | Delete Email
12
+ [**delete_email1**](ExtraOperationsApi.md#delete_email1) | **DELETE** /emails/{emailId} | Delete Email
13
13
  [**delete_inbox**](ExtraOperationsApi.md#delete_inbox) | **DELETE** /inboxes/{inboxId} | Delete Inbox / Email Address
14
14
  [**delete_webhook**](ExtraOperationsApi.md#delete_webhook) | **DELETE** /inboxes/{inboxId}/webhooks/{webhookId} | Delete and disable a WebHook for an Inbox
15
15
  [**download_attachment**](ExtraOperationsApi.md#download_attachment) | **GET** /emails/{emailId}/attachments/{attachmentId} | Get email attachment
16
+ [**forward_email**](ExtraOperationsApi.md#forward_email) | **POST** /emails/{emailId}/forward | Forward Email
16
17
  [**get_email**](ExtraOperationsApi.md#get_email) | **GET** /emails/{emailId} | Get Email Content
17
18
  [**get_emails**](ExtraOperationsApi.md#get_emails) | **GET** /inboxes/{inboxId}/emails | List Emails in an Inbox / EmailAddress
18
19
  [**get_inbox**](ExtraOperationsApi.md#get_inbox) | **GET** /inboxes/{inboxId} | Get Inbox / EmailAddress
@@ -20,6 +21,8 @@ Method | HTTP request | Description
20
21
  [**get_raw_email_contents**](ExtraOperationsApi.md#get_raw_email_contents) | **GET** /emails/{emailId}/raw | Get Raw Email Content
21
22
  [**get_webhooks**](ExtraOperationsApi.md#get_webhooks) | **GET** /inboxes/{inboxId}/webhooks | Get all WebHooks for an Inbox
22
23
  [**send_email**](ExtraOperationsApi.md#send_email) | **POST** /inboxes/{inboxId} | Send Email
24
+ [**upload_attachment**](ExtraOperationsApi.md#upload_attachment) | **POST** /attachments | Upload an attachment for sending
25
+ [**upload_multipart_form**](ExtraOperationsApi.md#upload_multipart_form) | **POST** /attachments/multipart | Upload an attachment for sending using Multipart Form
23
26
 
24
27
 
25
28
  # **bulk_create_inboxes**
@@ -245,7 +248,7 @@ end
245
248
 
246
249
  api_instance = MailSlurpClient::ExtraOperationsApi.new
247
250
  inbox_id = 'inbox_id_example' # String | inboxId
248
- create_webhook_options = MailSlurpClient::CreateWebhookOptions.new # CreateWebhookOptions | options
251
+ create_webhook_options = MailSlurpClient::CreateWebhookOptions.new # CreateWebhookOptions | webhookOptions
249
252
 
250
253
  begin
251
254
  #Attach a WebHook URL to an inbox
@@ -261,7 +264,7 @@ end
261
264
  Name | Type | Description | Notes
262
265
  ------------- | ------------- | ------------- | -------------
263
266
  **inbox_id** | [**String**](.md)| inboxId |
264
- **create_webhook_options** | [**CreateWebhookOptions**](CreateWebhookOptions.md)| options |
267
+ **create_webhook_options** | [**CreateWebhookOptions**](CreateWebhookOptions.md)| webhookOptions |
265
268
 
266
269
  ### Return type
267
270
 
@@ -278,8 +281,8 @@ Name | Type | Description | Notes
278
281
 
279
282
 
280
283
 
281
- # **delete_email**
282
- > delete_email(email_id)
284
+ # **delete_email1**
285
+ > delete_email1(email_id)
283
286
 
284
287
  Delete Email
285
288
 
@@ -302,9 +305,9 @@ email_id = 'email_id_example' # String | emailId
302
305
 
303
306
  begin
304
307
  #Delete Email
305
- api_instance.delete_email(email_id)
308
+ api_instance.delete_email1(email_id)
306
309
  rescue MailSlurpClient::ApiError => e
307
- puts "Exception when calling ExtraOperationsApi->delete_email: #{e}"
310
+ puts "Exception when calling ExtraOperationsApi->delete_email1: #{e}"
308
311
  end
309
312
  ```
310
313
 
@@ -484,6 +487,59 @@ nil (empty response body)
484
487
 
485
488
 
486
489
 
490
+ # **forward_email**
491
+ > forward_email(email_id, forward_email_options)
492
+
493
+ Forward Email
494
+
495
+ Forward email content to given recipients
496
+
497
+ ### Example
498
+ ```ruby
499
+ # load the gem
500
+ require 'mailslurp_client'
501
+ # setup authorization
502
+ MailSlurpClient.configure do |config|
503
+ # Configure API key authorization: API_KEY
504
+ config.api_key['x-api-key'] = 'YOUR API KEY'
505
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
506
+ #config.api_key_prefix['x-api-key'] = 'Bearer'
507
+ end
508
+
509
+ api_instance = MailSlurpClient::ExtraOperationsApi.new
510
+ email_id = 'email_id_example' # String | emailId
511
+ forward_email_options = MailSlurpClient::ForwardEmailOptions.new # ForwardEmailOptions | forwardEmailOptions
512
+
513
+ begin
514
+ #Forward Email
515
+ api_instance.forward_email(email_id, forward_email_options)
516
+ rescue MailSlurpClient::ApiError => e
517
+ puts "Exception when calling ExtraOperationsApi->forward_email: #{e}"
518
+ end
519
+ ```
520
+
521
+ ### Parameters
522
+
523
+ Name | Type | Description | Notes
524
+ ------------- | ------------- | ------------- | -------------
525
+ **email_id** | [**String**](.md)| emailId |
526
+ **forward_email_options** | [**ForwardEmailOptions**](ForwardEmailOptions.md)| forwardEmailOptions |
527
+
528
+ ### Return type
529
+
530
+ nil (empty response body)
531
+
532
+ ### Authorization
533
+
534
+ [API_KEY](../README.md#API_KEY)
535
+
536
+ ### HTTP request headers
537
+
538
+ - **Content-Type**: application/json
539
+ - **Accept**: Not defined
540
+
541
+
542
+
487
543
  # **get_email**
488
544
  > Email get_email(email_id)
489
545
 
@@ -853,3 +909,113 @@ nil (empty response body)
853
909
 
854
910
 
855
911
 
912
+ # **upload_attachment**
913
+ > Array<String> upload_attachment(upload_attachment_options)
914
+
915
+ Upload an attachment for sending
916
+
917
+ When sending emails with attachments first upload each attachment with this endpoint. Record the returned attachment IDs. Then use these attachment IDs in the SendEmailOptions when sending an email. This means that attachments can easily be reused.
918
+
919
+ ### Example
920
+ ```ruby
921
+ # load the gem
922
+ require 'mailslurp_client'
923
+ # setup authorization
924
+ MailSlurpClient.configure do |config|
925
+ # Configure API key authorization: API_KEY
926
+ config.api_key['x-api-key'] = 'YOUR API KEY'
927
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
928
+ #config.api_key_prefix['x-api-key'] = 'Bearer'
929
+ end
930
+
931
+ api_instance = MailSlurpClient::ExtraOperationsApi.new
932
+ upload_attachment_options = MailSlurpClient::UploadAttachmentOptions.new # UploadAttachmentOptions | uploadOptions
933
+
934
+ begin
935
+ #Upload an attachment for sending
936
+ result = api_instance.upload_attachment(upload_attachment_options)
937
+ p result
938
+ rescue MailSlurpClient::ApiError => e
939
+ puts "Exception when calling ExtraOperationsApi->upload_attachment: #{e}"
940
+ end
941
+ ```
942
+
943
+ ### Parameters
944
+
945
+ Name | Type | Description | Notes
946
+ ------------- | ------------- | ------------- | -------------
947
+ **upload_attachment_options** | [**UploadAttachmentOptions**](UploadAttachmentOptions.md)| uploadOptions |
948
+
949
+ ### Return type
950
+
951
+ **Array<String>**
952
+
953
+ ### Authorization
954
+
955
+ [API_KEY](../README.md#API_KEY)
956
+
957
+ ### HTTP request headers
958
+
959
+ - **Content-Type**: application/json
960
+ - **Accept**: application/json
961
+
962
+
963
+
964
+ # **upload_multipart_form**
965
+ > Array<String> upload_multipart_form(file, opts)
966
+
967
+ Upload an attachment for sending using Multipart Form
968
+
969
+ When sending emails with attachments first upload each attachment with this endpoint. Record the returned attachment IDs. Then use these attachment IDs in the SendEmailOptions when sending an email. This means that attachments can easily be reused.
970
+
971
+ ### Example
972
+ ```ruby
973
+ # load the gem
974
+ require 'mailslurp_client'
975
+ # setup authorization
976
+ MailSlurpClient.configure do |config|
977
+ # Configure API key authorization: API_KEY
978
+ config.api_key['x-api-key'] = 'YOUR API KEY'
979
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
980
+ #config.api_key_prefix['x-api-key'] = 'Bearer'
981
+ end
982
+
983
+ api_instance = MailSlurpClient::ExtraOperationsApi.new
984
+ file = File.new('/path/to/file') # File | file
985
+ opts = {
986
+ content_type: 'content_type_example', # String | contentType
987
+ filename: 'filename_example' # String | filename
988
+ }
989
+
990
+ begin
991
+ #Upload an attachment for sending using Multipart Form
992
+ result = api_instance.upload_multipart_form(file, opts)
993
+ p result
994
+ rescue MailSlurpClient::ApiError => e
995
+ puts "Exception when calling ExtraOperationsApi->upload_multipart_form: #{e}"
996
+ end
997
+ ```
998
+
999
+ ### Parameters
1000
+
1001
+ Name | Type | Description | Notes
1002
+ ------------- | ------------- | ------------- | -------------
1003
+ **file** | **File**| file |
1004
+ **content_type** | **String**| contentType | [optional]
1005
+ **filename** | **String**| filename | [optional]
1006
+
1007
+ ### Return type
1008
+
1009
+ **Array<String>**
1010
+
1011
+ ### Authorization
1012
+
1013
+ [API_KEY](../README.md#API_KEY)
1014
+
1015
+ ### HTTP request headers
1016
+
1017
+ - **Content-Type**: multipart/form-data
1018
+ - **Accept**: application/json
1019
+
1020
+
1021
+
@@ -0,0 +1,11 @@
1
+ # MailSlurpClient::ForwardEmailOptions
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **to** | **Array<String>** | |
7
+ **subject** | **String** | | [optional]
8
+ **cc** | **Array<String>** | | [optional]
9
+ **bcc** | **Array<String>** | | [optional]
10
+
11
+
@@ -0,0 +1,10 @@
1
+ # MailSlurpClient::MatchOption
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **field** | **String** | The email property to match on. One of SUBJECT, TO, BCC, CC or FROM | [optional]
7
+ **should** | **String** | What criteria to apply. CONTAIN or EQUAL. Note CONTAIN is recommended due to some SMTP servers adding new lines | [optional]
8
+ **value** | **String** | The value to compare to the field using EQUAL or CONTAIN | [optional]
9
+
10
+
@@ -0,0 +1,8 @@
1
+ # MailSlurpClient::MatchOptions
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **matches** | [**Array<MatchOption>**](MatchOption.md) | 1 or more match options. Options are additive so if one does not match the email is excluded from results | [optional]
7
+
8
+
@@ -3,14 +3,16 @@
3
3
  ## Properties
4
4
  Name | Type | Description | Notes
5
5
  ------------ | ------------- | ------------- | -------------
6
+ **attachments** | **Array<String>** | Optional list of attachment IDs to send with this email. You must first upload each attachment separately in order to obtain attachment IDs | [optional]
6
7
  **bcc** | **Array<String>** | Optional list of bcc destination email addresses | [optional]
7
- **body** | **String** | Contents of email | [optional]
8
+ **body** | **String** | Contents of email. If HTML set isHTML to true. You can use moustache templates here if you provide a templateVariables option | [optional]
8
9
  **cc** | **Array<String>** | Optional list of cc destination email addresses | [optional]
9
10
  **charset** | **String** | Optional charset | [optional]
10
11
  **from** | **String** | Optional from address. If not set source inbox address will be used | [optional]
11
12
  **html** | **BOOLEAN** | | [optional]
12
13
  **reply_to** | **String** | Optional replyTo header | [optional]
13
14
  **subject** | **String** | Optional email subject line | [optional]
15
+ **template_variables** | [**Object**](.md) | Optional map of template variables. Will replace moustache syntax variables in subject or body with the associated values | [optional]
14
16
  **to** | **Array<String>** | List of destination email addresses. Even single recipients must be in array form. |
15
17
 
16
18
 
@@ -0,0 +1,10 @@
1
+ # MailSlurpClient::UploadAttachmentOptions
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **base64_contents** | **String** | Base64 encoded string of file contents | [optional]
7
+ **content_type** | **String** | Optional contentType for file. For instance application/pdf | [optional]
8
+ **filename** | **String** | Optional filename to save upload with | [optional]
9
+
10
+
@@ -23,8 +23,12 @@ require 'mailslurp_client/models/create_webhook_options'
23
23
  require 'mailslurp_client/models/email'
24
24
  require 'mailslurp_client/models/email_analysis'
25
25
  require 'mailslurp_client/models/email_preview'
26
+ require 'mailslurp_client/models/forward_email_options'
26
27
  require 'mailslurp_client/models/inbox'
28
+ require 'mailslurp_client/models/match_option'
29
+ require 'mailslurp_client/models/match_options'
27
30
  require 'mailslurp_client/models/send_email_options'
31
+ require 'mailslurp_client/models/upload_attachment_options'
28
32
  require 'mailslurp_client/models/webhook'
29
33
 
30
34
  # APIs
@@ -66,6 +66,159 @@ module MailSlurpClient
66
66
  return data, status_code, headers
67
67
  end
68
68
 
69
+ # Delete an email
70
+ # Deletes an email
71
+ # @param email_id emailId
72
+ # @param [Hash] opts the optional parameters
73
+ # @return [nil]
74
+ def delete_email(email_id, opts = {})
75
+ delete_email_with_http_info(email_id, opts)
76
+ nil
77
+ end
78
+
79
+ # Delete an email
80
+ # Deletes an email
81
+ # @param email_id emailId
82
+ # @param [Hash] opts the optional parameters
83
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
84
+ def delete_email_with_http_info(email_id, opts = {})
85
+ if @api_client.config.debugging
86
+ @api_client.config.logger.debug 'Calling API: CommonOperationsApi.delete_email ...'
87
+ end
88
+ # verify the required parameter 'email_id' is set
89
+ if @api_client.config.client_side_validation && email_id.nil?
90
+ fail ArgumentError, "Missing the required parameter 'email_id' when calling CommonOperationsApi.delete_email"
91
+ end
92
+ # resource path
93
+ local_var_path = '/deleteEmail'
94
+
95
+ # query parameters
96
+ query_params = {}
97
+ query_params[:'emailId'] = email_id
98
+
99
+ # header parameters
100
+ header_params = {}
101
+
102
+ # form parameters
103
+ form_params = {}
104
+
105
+ # http body (model)
106
+ post_body = nil
107
+ auth_names = ['API_KEY']
108
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
109
+ :header_params => header_params,
110
+ :query_params => query_params,
111
+ :form_params => form_params,
112
+ :body => post_body,
113
+ :auth_names => auth_names)
114
+ if @api_client.config.debugging
115
+ @api_client.config.logger.debug "API called: CommonOperationsApi#delete_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
116
+ end
117
+ return data, status_code, headers
118
+ end
119
+
120
+ # Delete email address and its emails
121
+ # Deletes an inbox
122
+ # @param inbox_id inboxId
123
+ # @param [Hash] opts the optional parameters
124
+ # @return [nil]
125
+ def delete_email_address(inbox_id, opts = {})
126
+ delete_email_address_with_http_info(inbox_id, opts)
127
+ nil
128
+ end
129
+
130
+ # Delete email address and its emails
131
+ # Deletes an inbox
132
+ # @param inbox_id inboxId
133
+ # @param [Hash] opts the optional parameters
134
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
135
+ def delete_email_address_with_http_info(inbox_id, opts = {})
136
+ if @api_client.config.debugging
137
+ @api_client.config.logger.debug 'Calling API: CommonOperationsApi.delete_email_address ...'
138
+ end
139
+ # verify the required parameter 'inbox_id' is set
140
+ if @api_client.config.client_side_validation && inbox_id.nil?
141
+ fail ArgumentError, "Missing the required parameter 'inbox_id' when calling CommonOperationsApi.delete_email_address"
142
+ end
143
+ # resource path
144
+ local_var_path = '/deleteEmailAddress'
145
+
146
+ # query parameters
147
+ query_params = {}
148
+ query_params[:'inboxId'] = inbox_id
149
+
150
+ # header parameters
151
+ header_params = {}
152
+
153
+ # form parameters
154
+ form_params = {}
155
+
156
+ # http body (model)
157
+ post_body = nil
158
+ auth_names = ['API_KEY']
159
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
160
+ :header_params => header_params,
161
+ :query_params => query_params,
162
+ :form_params => form_params,
163
+ :body => post_body,
164
+ :auth_names => auth_names)
165
+ if @api_client.config.debugging
166
+ @api_client.config.logger.debug "API called: CommonOperationsApi#delete_email_address\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
167
+ end
168
+ return data, status_code, headers
169
+ end
170
+
171
+ # Delete all emails in an inbox
172
+ # Deletes all emails
173
+ # @param inbox_id inboxId
174
+ # @param [Hash] opts the optional parameters
175
+ # @return [nil]
176
+ def empty_inbox(inbox_id, opts = {})
177
+ empty_inbox_with_http_info(inbox_id, opts)
178
+ nil
179
+ end
180
+
181
+ # Delete all emails in an inbox
182
+ # Deletes all emails
183
+ # @param inbox_id inboxId
184
+ # @param [Hash] opts the optional parameters
185
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
186
+ def empty_inbox_with_http_info(inbox_id, opts = {})
187
+ if @api_client.config.debugging
188
+ @api_client.config.logger.debug 'Calling API: CommonOperationsApi.empty_inbox ...'
189
+ end
190
+ # verify the required parameter 'inbox_id' is set
191
+ if @api_client.config.client_side_validation && inbox_id.nil?
192
+ fail ArgumentError, "Missing the required parameter 'inbox_id' when calling CommonOperationsApi.empty_inbox"
193
+ end
194
+ # resource path
195
+ local_var_path = '/emptyInbox'
196
+
197
+ # query parameters
198
+ query_params = {}
199
+ query_params[:'inboxId'] = inbox_id
200
+
201
+ # header parameters
202
+ header_params = {}
203
+
204
+ # form parameters
205
+ form_params = {}
206
+
207
+ # http body (model)
208
+ post_body = nil
209
+ auth_names = ['API_KEY']
210
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
211
+ :header_params => header_params,
212
+ :query_params => query_params,
213
+ :form_params => form_params,
214
+ :body => post_body,
215
+ :auth_names => auth_names)
216
+ if @api_client.config.debugging
217
+ @api_client.config.logger.debug "API called: CommonOperationsApi#empty_inbox\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
218
+ end
219
+ return data, status_code, headers
220
+ end
221
+
69
222
  # Send an email from a random email address
70
223
  # To specify an email address first create an inbox and use that with the other send email methods
71
224
  # @param send_email_options sendEmailOptions
@@ -118,11 +271,67 @@ module MailSlurpClient
118
271
  return data, status_code, headers
119
272
  end
120
273
 
274
+ # Wait for and return count number of emails
275
+ # Will only wait if count is greater that the found emails in given inbox.If you need to wait for an email for a non-empty inbox see the other receive methods.
276
+ # @param [Hash] opts the optional parameters
277
+ # @option opts [Integer] :count Number of emails to wait for. Must be greater that 1
278
+ # @option opts [String] :inbox_id Id of the inbox we are fetching emails from
279
+ # @option opts [Integer] :timeout Max milliseconds to wait
280
+ # @return [Array<EmailPreview>]
281
+ def wait_for_email_count(opts = {})
282
+ data, _status_code, _headers = wait_for_email_count_with_http_info(opts)
283
+ data
284
+ end
285
+
286
+ # Wait for and return count number of emails
287
+ # Will only wait if count is greater that the found emails in given inbox.If you need to wait for an email for a non-empty inbox see the other receive methods.
288
+ # @param [Hash] opts the optional parameters
289
+ # @option opts [Integer] :count Number of emails to wait for. Must be greater that 1
290
+ # @option opts [String] :inbox_id Id of the inbox we are fetching emails from
291
+ # @option opts [Integer] :timeout Max milliseconds to wait
292
+ # @return [Array<(Array<EmailPreview>, Fixnum, Hash)>] Array<EmailPreview> data, response status code and response headers
293
+ def wait_for_email_count_with_http_info(opts = {})
294
+ if @api_client.config.debugging
295
+ @api_client.config.logger.debug 'Calling API: CommonOperationsApi.wait_for_email_count ...'
296
+ end
297
+ # resource path
298
+ local_var_path = '/waitForEmailCount'
299
+
300
+ # query parameters
301
+ query_params = {}
302
+ query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
303
+ query_params[:'inboxId'] = opts[:'inbox_id'] if !opts[:'inbox_id'].nil?
304
+ query_params[:'timeout'] = opts[:'timeout'] if !opts[:'timeout'].nil?
305
+
306
+ # header parameters
307
+ header_params = {}
308
+ # HTTP header 'Accept' (if needed)
309
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
310
+
311
+ # form parameters
312
+ form_params = {}
313
+
314
+ # http body (model)
315
+ post_body = nil
316
+ auth_names = ['API_KEY']
317
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
318
+ :header_params => header_params,
319
+ :query_params => query_params,
320
+ :form_params => form_params,
321
+ :body => post_body,
322
+ :auth_names => auth_names,
323
+ :return_type => 'Array<EmailPreview>')
324
+ if @api_client.config.debugging
325
+ @api_client.config.logger.debug "API called: CommonOperationsApi#wait_for_email_count\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
326
+ end
327
+ return data, status_code, headers
328
+ end
329
+
121
330
  # Fetch inbox's latest email or if empty wait for email to arrive
122
331
  # 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 see the other receive methods.
123
332
  # @param [Hash] opts the optional parameters
124
- # @option opts [String] :inbox_email_address Email address of the inbox we are fetching emails from
125
333
  # @option opts [String] :inbox_id Id of the inbox we are fetching emails from
334
+ # @option opts [Integer] :timeout Max milliseconds to wait
126
335
  # @return [Email]
127
336
  def wait_for_latest_email(opts = {})
128
337
  data, _status_code, _headers = wait_for_latest_email_with_http_info(opts)
@@ -132,20 +341,20 @@ module MailSlurpClient
132
341
  # Fetch inbox&#39;s latest email or if empty wait for email to arrive
133
342
  # 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 see the other receive methods.
134
343
  # @param [Hash] opts the optional parameters
135
- # @option opts [String] :inbox_email_address Email address of the inbox we are fetching emails from
136
344
  # @option opts [String] :inbox_id Id of the inbox we are fetching emails from
345
+ # @option opts [Integer] :timeout Max milliseconds to wait
137
346
  # @return [Array<(Email, Fixnum, Hash)>] Email data, response status code and response headers
138
347
  def wait_for_latest_email_with_http_info(opts = {})
139
348
  if @api_client.config.debugging
140
349
  @api_client.config.logger.debug 'Calling API: CommonOperationsApi.wait_for_latest_email ...'
141
350
  end
142
351
  # resource path
143
- local_var_path = '/fetchLatestEmail'
352
+ local_var_path = '/waitForLatestEmail'
144
353
 
145
354
  # query parameters
146
355
  query_params = {}
147
- query_params[:'inboxEmailAddress'] = opts[:'inbox_email_address'] if !opts[:'inbox_email_address'].nil?
148
356
  query_params[:'inboxId'] = opts[:'inbox_id'] if !opts[:'inbox_id'].nil?
357
+ query_params[:'timeout'] = opts[:'timeout'] if !opts[:'timeout'].nil?
149
358
 
150
359
  # header parameters
151
360
  header_params = {}
@@ -171,5 +380,123 @@ module MailSlurpClient
171
380
  return data, status_code, headers
172
381
  end
173
382
 
383
+ # Wait or return list of emails that match simple matching patterns
384
+ # Results must also meet provided count. Match options allow simple CONTAINS or EQUALS filtering on SUBJECT, TO, BCC, CC, and FROM.
385
+ # @param match_options matchOptions
386
+ # @param [Hash] opts the optional parameters
387
+ # @option opts [Integer] :count Number of emails to wait for. Must be greater that 1
388
+ # @option opts [String] :inbox_id Id of the inbox we are fetching emails from
389
+ # @option opts [Integer] :timeout Max milliseconds to wait
390
+ # @return [Array<EmailPreview>]
391
+ def wait_for_matching_email(match_options, opts = {})
392
+ data, _status_code, _headers = wait_for_matching_email_with_http_info(match_options, opts)
393
+ data
394
+ end
395
+
396
+ # Wait or return list of emails that match simple matching patterns
397
+ # Results must also meet provided count. Match options allow simple CONTAINS or EQUALS filtering on SUBJECT, TO, BCC, CC, and FROM.
398
+ # @param match_options matchOptions
399
+ # @param [Hash] opts the optional parameters
400
+ # @option opts [Integer] :count Number of emails to wait for. Must be greater that 1
401
+ # @option opts [String] :inbox_id Id of the inbox we are fetching emails from
402
+ # @option opts [Integer] :timeout Max milliseconds to wait
403
+ # @return [Array<(Array<EmailPreview>, Fixnum, Hash)>] Array<EmailPreview> data, response status code and response headers
404
+ def wait_for_matching_email_with_http_info(match_options, opts = {})
405
+ if @api_client.config.debugging
406
+ @api_client.config.logger.debug 'Calling API: CommonOperationsApi.wait_for_matching_email ...'
407
+ end
408
+ # verify the required parameter 'match_options' is set
409
+ if @api_client.config.client_side_validation && match_options.nil?
410
+ fail ArgumentError, "Missing the required parameter 'match_options' when calling CommonOperationsApi.wait_for_matching_email"
411
+ end
412
+ # resource path
413
+ local_var_path = '/waitForMatchingEmails'
414
+
415
+ # query parameters
416
+ query_params = {}
417
+ query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
418
+ query_params[:'inboxId'] = opts[:'inbox_id'] if !opts[:'inbox_id'].nil?
419
+ query_params[:'timeout'] = opts[:'timeout'] if !opts[:'timeout'].nil?
420
+
421
+ # header parameters
422
+ header_params = {}
423
+ # HTTP header 'Accept' (if needed)
424
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
425
+ # HTTP header 'Content-Type'
426
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
427
+
428
+ # form parameters
429
+ form_params = {}
430
+
431
+ # http body (model)
432
+ post_body = @api_client.object_to_http_body(match_options)
433
+ auth_names = ['API_KEY']
434
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
435
+ :header_params => header_params,
436
+ :query_params => query_params,
437
+ :form_params => form_params,
438
+ :body => post_body,
439
+ :auth_names => auth_names,
440
+ :return_type => 'Array<EmailPreview>')
441
+ if @api_client.config.debugging
442
+ @api_client.config.logger.debug "API called: CommonOperationsApi#wait_for_matching_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
443
+ end
444
+ return data, status_code, headers
445
+ end
446
+
447
+ # Wait for or fetch the email with a given index in the inbox specified
448
+ # @param [Hash] opts the optional parameters
449
+ # @option opts [String] :inbox_id Id of the inbox we are fetching emails from
450
+ # @option opts [Integer] :index Zero based index of the email to wait for
451
+ # @option opts [Integer] :timeout Max milliseconds to wait
452
+ # @return [Email]
453
+ def wait_for_nth_email(opts = {})
454
+ data, _status_code, _headers = wait_for_nth_email_with_http_info(opts)
455
+ data
456
+ end
457
+
458
+ # Wait for or fetch the email with a given index in the inbox specified
459
+ # @param [Hash] opts the optional parameters
460
+ # @option opts [String] :inbox_id Id of the inbox we are fetching emails from
461
+ # @option opts [Integer] :index Zero based index of the email to wait for
462
+ # @option opts [Integer] :timeout Max milliseconds to wait
463
+ # @return [Array<(Email, Fixnum, Hash)>] Email data, response status code and response headers
464
+ def wait_for_nth_email_with_http_info(opts = {})
465
+ if @api_client.config.debugging
466
+ @api_client.config.logger.debug 'Calling API: CommonOperationsApi.wait_for_nth_email ...'
467
+ end
468
+ # resource path
469
+ local_var_path = '/waitForNthEmail'
470
+
471
+ # query parameters
472
+ query_params = {}
473
+ query_params[:'inboxId'] = opts[:'inbox_id'] if !opts[:'inbox_id'].nil?
474
+ query_params[:'index'] = opts[:'index'] if !opts[:'index'].nil?
475
+ query_params[:'timeout'] = opts[:'timeout'] if !opts[:'timeout'].nil?
476
+
477
+ # header parameters
478
+ header_params = {}
479
+ # HTTP header 'Accept' (if needed)
480
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
481
+
482
+ # form parameters
483
+ form_params = {}
484
+
485
+ # http body (model)
486
+ post_body = nil
487
+ auth_names = ['API_KEY']
488
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
489
+ :header_params => header_params,
490
+ :query_params => query_params,
491
+ :form_params => form_params,
492
+ :body => post_body,
493
+ :auth_names => auth_names,
494
+ :return_type => 'Email')
495
+ if @api_client.config.debugging
496
+ @api_client.config.logger.debug "API called: CommonOperationsApi#wait_for_nth_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
497
+ end
498
+ return data, status_code, headers
499
+ end
500
+
174
501
  end
175
502
  end