mailslurp_client 15.11.0 → 15.12.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. checksums.yaml +4 -4
  2. data/lib/mailslurp_client/api/api_user_controller_api.rb +74 -0
  3. data/lib/mailslurp_client/api/attachment_controller_api.rb +4 -4
  4. data/lib/mailslurp_client/api/email_controller_api.rb +68 -3
  5. data/lib/mailslurp_client/api/inbox_controller_api.rb +63 -0
  6. data/lib/mailslurp_client/api/missed_email_controller_api.rb +56 -0
  7. data/lib/mailslurp_client/api/phone_controller_api.rb +487 -0
  8. data/lib/mailslurp_client/api/sent_emails_controller_api.rb +73 -0
  9. data/lib/mailslurp_client/api/sms_controller_api.rb +286 -0
  10. data/lib/mailslurp_client/api/template_controller_api.rb +124 -0
  11. data/lib/mailslurp_client/api/wait_for_controller_api.rb +64 -0
  12. data/lib/mailslurp_client/api/webhook_controller_api.rb +2 -2
  13. data/lib/mailslurp_client/models/abstract_webhook_payload.rb +2 -2
  14. data/lib/mailslurp_client/models/alias_projection.rb +27 -27
  15. data/lib/mailslurp_client/models/attachment_projection.rb +14 -14
  16. data/lib/mailslurp_client/models/bounce_projection.rb +31 -4
  17. data/lib/mailslurp_client/models/{bounce_recipient.rb → bounce_recipient_projection.rb} +35 -36
  18. data/lib/mailslurp_client/models/bounced_email_dto.rb +19 -1
  19. data/lib/mailslurp_client/models/bounced_recipient_dto.rb +37 -1
  20. data/lib/mailslurp_client/models/contact_projection.rb +18 -18
  21. data/lib/mailslurp_client/models/create_emergency_address_options.rb +324 -0
  22. data/lib/mailslurp_client/models/create_webhook_options.rb +2 -2
  23. data/lib/mailslurp_client/models/email_html_dto.rb +215 -0
  24. data/lib/mailslurp_client/models/email_projection.rb +19 -19
  25. data/lib/mailslurp_client/models/emergency_address.rb +408 -0
  26. data/lib/mailslurp_client/models/emergency_address_dto.rb +273 -0
  27. data/lib/mailslurp_client/models/empty_response_dto.rb +206 -0
  28. data/lib/mailslurp_client/models/inbox_by_name_result.rb +221 -0
  29. data/lib/mailslurp_client/models/inbox_dto.rb +11 -1
  30. data/lib/mailslurp_client/models/page_alias.rb +22 -22
  31. data/lib/mailslurp_client/models/page_attachment_entity.rb +22 -22
  32. data/lib/mailslurp_client/models/page_bounced_email.rb +22 -22
  33. data/lib/mailslurp_client/models/page_bounced_recipients.rb +23 -23
  34. data/lib/mailslurp_client/models/page_contact_projection.rb +22 -22
  35. data/lib/mailslurp_client/models/page_email_preview.rb +22 -22
  36. data/lib/mailslurp_client/models/page_email_projection.rb +22 -22
  37. data/lib/mailslurp_client/models/page_email_validation_request.rb +22 -22
  38. data/lib/mailslurp_client/models/page_expired_inbox_record_projection.rb +22 -22
  39. data/lib/mailslurp_client/models/page_group_projection.rb +22 -22
  40. data/lib/mailslurp_client/models/page_inbox_forwarder_dto.rb +22 -22
  41. data/lib/mailslurp_client/models/page_inbox_projection.rb +22 -22
  42. data/lib/mailslurp_client/models/page_inbox_ruleset_dto.rb +22 -22
  43. data/lib/mailslurp_client/models/page_missed_email_projection.rb +22 -22
  44. data/lib/mailslurp_client/models/page_organization_inbox_projection.rb +22 -22
  45. data/lib/mailslurp_client/models/page_phone_number_projection.rb +308 -0
  46. data/lib/mailslurp_client/models/page_sent_email_projection.rb +16 -16
  47. data/lib/mailslurp_client/models/page_sent_email_with_queue_projection.rb +344 -0
  48. data/lib/mailslurp_client/models/page_sms_projection.rb +308 -0
  49. data/lib/mailslurp_client/models/page_template_projection.rb +22 -22
  50. data/lib/mailslurp_client/models/page_thread_projection.rb +22 -22
  51. data/lib/mailslurp_client/models/page_tracking_pixel_projection.rb +22 -22
  52. data/lib/mailslurp_client/models/page_unknown_missed_email_projection.rb +22 -22
  53. data/lib/mailslurp_client/models/page_webhook_projection.rb +22 -22
  54. data/lib/mailslurp_client/models/page_webhook_result.rb +22 -22
  55. data/lib/mailslurp_client/models/phone_number_dto.rb +347 -0
  56. data/lib/mailslurp_client/models/phone_number_projection.rb +302 -0
  57. data/lib/mailslurp_client/models/phone_plan_dto.rb +287 -0
  58. data/lib/mailslurp_client/models/send_with_queue_result.rb +318 -0
  59. data/lib/mailslurp_client/models/sent_email_projection.rb +24 -24
  60. data/lib/mailslurp_client/models/sms_match_option.rb +289 -0
  61. data/lib/mailslurp_client/models/sms_message.rb +318 -0
  62. data/lib/mailslurp_client/models/sms_preview.rb +267 -0
  63. data/lib/mailslurp_client/models/sms_projection.rb +282 -0
  64. data/lib/mailslurp_client/models/template_preview.rb +211 -0
  65. data/lib/mailslurp_client/models/template_projection.rb +18 -18
  66. data/lib/mailslurp_client/models/thread_projection.rb +36 -36
  67. data/lib/mailslurp_client/models/tracking_pixel_projection.rb +19 -19
  68. data/lib/mailslurp_client/models/user_info_dto.rb +334 -0
  69. data/lib/mailslurp_client/models/wait_for_sms_conditions.rb +371 -0
  70. data/lib/mailslurp_client/models/webhook_bounce_payload.rb +2 -2
  71. data/lib/mailslurp_client/models/webhook_bounce_recipient_payload.rb +2 -2
  72. data/lib/mailslurp_client/models/webhook_dto.rb +2 -2
  73. data/lib/mailslurp_client/models/webhook_email_opened_payload.rb +2 -2
  74. data/lib/mailslurp_client/models/webhook_email_read_payload.rb +2 -2
  75. data/lib/mailslurp_client/models/webhook_new_attachment_payload.rb +2 -2
  76. data/lib/mailslurp_client/models/webhook_new_contact_payload.rb +2 -2
  77. data/lib/mailslurp_client/models/webhook_new_email_payload.rb +2 -2
  78. data/lib/mailslurp_client/models/webhook_projection.rb +2 -2
  79. data/lib/mailslurp_client/models/webhook_result_dto.rb +2 -2
  80. data/lib/mailslurp_client/version.rb +1 -1
  81. data/lib/mailslurp_client.rb +24 -1
  82. metadata +26 -3
@@ -0,0 +1,286 @@
1
+ =begin
2
+ #MailSlurp API
3
+
4
+ #MailSlurp is an API for sending and receiving emails from dynamically allocated email addresses. It's designed for developers and QA teams to test applications, process inbound emails, send templated notifications, attachments, and more. ## Resources - [Homepage](https://www.mailslurp.com) - Get an [API KEY](https://app.mailslurp.com/sign-up/) - Generated [SDK Clients](https://docs.mailslurp.com/) - [Examples](https://github.com/mailslurp/examples) repository
5
+
6
+ The version of the OpenAPI document: 6.5.2
7
+ Contact: contact@mailslurp.dev
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.3.1
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module MailSlurpClient
16
+ class SmsControllerApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Delete SMS message.
23
+ # Delete an SMS message
24
+ # @param sms_id [String]
25
+ # @param [Hash] opts the optional parameters
26
+ # @return [nil]
27
+ def delete_sms_message(sms_id, opts = {})
28
+ delete_sms_message_with_http_info(sms_id, opts)
29
+ nil
30
+ end
31
+
32
+ # Delete SMS message.
33
+ # Delete an SMS message
34
+ # @param sms_id [String]
35
+ # @param [Hash] opts the optional parameters
36
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
37
+ def delete_sms_message_with_http_info(sms_id, opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: SmsControllerApi.delete_sms_message ...'
40
+ end
41
+ # verify the required parameter 'sms_id' is set
42
+ if @api_client.config.client_side_validation && sms_id.nil?
43
+ fail ArgumentError, "Missing the required parameter 'sms_id' when calling SmsControllerApi.delete_sms_message"
44
+ end
45
+ # resource path
46
+ local_var_path = '/sms/{smsId}'.sub('{' + 'smsId' + '}', CGI.escape(sms_id.to_s))
47
+
48
+ # query parameters
49
+ query_params = opts[:query_params] || {}
50
+
51
+ # header parameters
52
+ header_params = opts[:header_params] || {}
53
+
54
+ # form parameters
55
+ form_params = opts[:form_params] || {}
56
+
57
+ # http body (model)
58
+ post_body = opts[:body]
59
+
60
+ # return_type
61
+ return_type = opts[:return_type]
62
+
63
+ # auth_names
64
+ auth_names = opts[:auth_names] || ['API_KEY']
65
+
66
+ new_options = opts.merge(
67
+ :header_params => header_params,
68
+ :query_params => query_params,
69
+ :form_params => form_params,
70
+ :body => post_body,
71
+ :auth_names => auth_names,
72
+ :return_type => return_type
73
+ )
74
+
75
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
76
+ if @api_client.config.debugging
77
+ @api_client.config.logger.debug "API called: SmsControllerApi#delete_sms_message\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
78
+ end
79
+ return data, status_code, headers
80
+ end
81
+
82
+ # Delete all SMS messages
83
+ # Delete all SMS messages or all messages for a given phone number
84
+ # @param [Hash] opts the optional parameters
85
+ # @option opts [String] :phone_number_id
86
+ # @return [nil]
87
+ def delete_sms_messages(opts = {})
88
+ delete_sms_messages_with_http_info(opts)
89
+ nil
90
+ end
91
+
92
+ # Delete all SMS messages
93
+ # Delete all SMS messages or all messages for a given phone number
94
+ # @param [Hash] opts the optional parameters
95
+ # @option opts [String] :phone_number_id
96
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
97
+ def delete_sms_messages_with_http_info(opts = {})
98
+ if @api_client.config.debugging
99
+ @api_client.config.logger.debug 'Calling API: SmsControllerApi.delete_sms_messages ...'
100
+ end
101
+ # resource path
102
+ local_var_path = '/sms'
103
+
104
+ # query parameters
105
+ query_params = opts[:query_params] || {}
106
+ query_params[:'phoneNumberId'] = opts[:'phone_number_id'] if !opts[:'phone_number_id'].nil?
107
+
108
+ # header parameters
109
+ header_params = opts[:header_params] || {}
110
+
111
+ # form parameters
112
+ form_params = opts[:form_params] || {}
113
+
114
+ # http body (model)
115
+ post_body = opts[:body]
116
+
117
+ # return_type
118
+ return_type = opts[:return_type]
119
+
120
+ # auth_names
121
+ auth_names = opts[:auth_names] || ['API_KEY']
122
+
123
+ new_options = opts.merge(
124
+ :header_params => header_params,
125
+ :query_params => query_params,
126
+ :form_params => form_params,
127
+ :body => post_body,
128
+ :auth_names => auth_names,
129
+ :return_type => return_type
130
+ )
131
+
132
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
133
+ if @api_client.config.debugging
134
+ @api_client.config.logger.debug "API called: SmsControllerApi#delete_sms_messages\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
135
+ end
136
+ return data, status_code, headers
137
+ end
138
+
139
+ # Get SMS content including body. Expects SMS to exist by ID. For SMS that may not have arrived yet use the WaitForController.
140
+ # Returns a SMS summary object with content.
141
+ # @param sms_id [String]
142
+ # @param [Hash] opts the optional parameters
143
+ # @return [SmsMessage]
144
+ def get_sms_message(sms_id, opts = {})
145
+ data, _status_code, _headers = get_sms_message_with_http_info(sms_id, opts)
146
+ data
147
+ end
148
+
149
+ # Get SMS content including body. Expects SMS to exist by ID. For SMS that may not have arrived yet use the WaitForController.
150
+ # Returns a SMS summary object with content.
151
+ # @param sms_id [String]
152
+ # @param [Hash] opts the optional parameters
153
+ # @return [Array<(SmsMessage, Integer, Hash)>] SmsMessage data, response status code and response headers
154
+ def get_sms_message_with_http_info(sms_id, opts = {})
155
+ if @api_client.config.debugging
156
+ @api_client.config.logger.debug 'Calling API: SmsControllerApi.get_sms_message ...'
157
+ end
158
+ # verify the required parameter 'sms_id' is set
159
+ if @api_client.config.client_side_validation && sms_id.nil?
160
+ fail ArgumentError, "Missing the required parameter 'sms_id' when calling SmsControllerApi.get_sms_message"
161
+ end
162
+ # resource path
163
+ local_var_path = '/sms/{smsId}'.sub('{' + 'smsId' + '}', CGI.escape(sms_id.to_s))
164
+
165
+ # query parameters
166
+ query_params = opts[:query_params] || {}
167
+
168
+ # header parameters
169
+ header_params = opts[:header_params] || {}
170
+ # HTTP header 'Accept' (if needed)
171
+ header_params['Accept'] = @api_client.select_header_accept(['*/*'])
172
+
173
+ # form parameters
174
+ form_params = opts[:form_params] || {}
175
+
176
+ # http body (model)
177
+ post_body = opts[:body]
178
+
179
+ # return_type
180
+ return_type = opts[:return_type] || 'SmsMessage'
181
+
182
+ # auth_names
183
+ auth_names = opts[:auth_names] || ['API_KEY']
184
+
185
+ new_options = opts.merge(
186
+ :header_params => header_params,
187
+ :query_params => query_params,
188
+ :form_params => form_params,
189
+ :body => post_body,
190
+ :auth_names => auth_names,
191
+ :return_type => return_type
192
+ )
193
+
194
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
195
+ if @api_client.config.debugging
196
+ @api_client.config.logger.debug "API called: SmsControllerApi#get_sms_message\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
197
+ end
198
+ return data, status_code, headers
199
+ end
200
+
201
+ # Get all SMS messages in all phone numbers in paginated form. .
202
+ # By default returns all SMS messages across all phone numbers sorted by ascending created at date. Responses are paginated. You can restrict results to a list of phone number IDs. You can also filter out read messages
203
+ # @param [Hash] opts the optional parameters
204
+ # @option opts [String] :phone_number Optional receiving phone number to filter SMS messages for
205
+ # @option opts [Integer] :page Optional page index in SMS list pagination (default to 0)
206
+ # @option opts [Integer] :size Optional page size in SMS list pagination. Maximum size is 100. Use page index and sort to page through larger results (default to 20)
207
+ # @option opts [String] :sort Optional createdAt sort direction ASC or DESC (default to 'ASC')
208
+ # @option opts [Boolean] :unread_only Optional filter for unread SMS only. All SMS are considered unread until they are viewed in the dashboard or requested directly (default to false)
209
+ # @option opts [DateTime] :since Optional filter SMSs received after given date time
210
+ # @option opts [DateTime] :before Optional filter SMSs received before given date time
211
+ # @return [PageSmsProjection]
212
+ def get_sms_messages_paginated(opts = {})
213
+ data, _status_code, _headers = get_sms_messages_paginated_with_http_info(opts)
214
+ data
215
+ end
216
+
217
+ # Get all SMS messages in all phone numbers in paginated form. .
218
+ # By default returns all SMS messages across all phone numbers sorted by ascending created at date. Responses are paginated. You can restrict results to a list of phone number IDs. You can also filter out read messages
219
+ # @param [Hash] opts the optional parameters
220
+ # @option opts [String] :phone_number Optional receiving phone number to filter SMS messages for
221
+ # @option opts [Integer] :page Optional page index in SMS list pagination
222
+ # @option opts [Integer] :size Optional page size in SMS list pagination. Maximum size is 100. Use page index and sort to page through larger results
223
+ # @option opts [String] :sort Optional createdAt sort direction ASC or DESC
224
+ # @option opts [Boolean] :unread_only Optional filter for unread SMS only. All SMS are considered unread until they are viewed in the dashboard or requested directly
225
+ # @option opts [DateTime] :since Optional filter SMSs received after given date time
226
+ # @option opts [DateTime] :before Optional filter SMSs received before given date time
227
+ # @return [Array<(PageSmsProjection, Integer, Hash)>] PageSmsProjection data, response status code and response headers
228
+ def get_sms_messages_paginated_with_http_info(opts = {})
229
+ if @api_client.config.debugging
230
+ @api_client.config.logger.debug 'Calling API: SmsControllerApi.get_sms_messages_paginated ...'
231
+ end
232
+ if @api_client.config.client_side_validation && !opts[:'size'].nil? && opts[:'size'] > 100
233
+ fail ArgumentError, 'invalid value for "opts[:"size"]" when calling SmsControllerApi.get_sms_messages_paginated, must be smaller than or equal to 100.'
234
+ end
235
+
236
+ allowable_values = ["ASC", "DESC"]
237
+ if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
238
+ fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
239
+ end
240
+ # resource path
241
+ local_var_path = '/sms'
242
+
243
+ # query parameters
244
+ query_params = opts[:query_params] || {}
245
+ query_params[:'phoneNumber'] = opts[:'phone_number'] if !opts[:'phone_number'].nil?
246
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
247
+ query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
248
+ query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
249
+ query_params[:'unreadOnly'] = opts[:'unread_only'] if !opts[:'unread_only'].nil?
250
+ query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil?
251
+ query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
252
+
253
+ # header parameters
254
+ header_params = opts[:header_params] || {}
255
+ # HTTP header 'Accept' (if needed)
256
+ header_params['Accept'] = @api_client.select_header_accept(['*/*'])
257
+
258
+ # form parameters
259
+ form_params = opts[:form_params] || {}
260
+
261
+ # http body (model)
262
+ post_body = opts[:body]
263
+
264
+ # return_type
265
+ return_type = opts[:return_type] || 'PageSmsProjection'
266
+
267
+ # auth_names
268
+ auth_names = opts[:auth_names] || ['API_KEY']
269
+
270
+ new_options = opts.merge(
271
+ :header_params => header_params,
272
+ :query_params => query_params,
273
+ :form_params => form_params,
274
+ :body => post_body,
275
+ :auth_names => auth_names,
276
+ :return_type => return_type
277
+ )
278
+
279
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
280
+ if @api_client.config.debugging
281
+ @api_client.config.logger.debug "API called: SmsControllerApi#get_sms_messages_paginated\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
282
+ end
283
+ return data, status_code, headers
284
+ end
285
+ end
286
+ end
@@ -280,6 +280,130 @@ module MailSlurpClient
280
280
  return data, status_code, headers
281
281
  end
282
282
 
283
+ # Get template preview HTML
284
+ # Get email template preview with passed template variables in HTML format for browsers. Pass template variables as query params.
285
+ # @param template_id [String] Template ID
286
+ # @param [Hash] opts the optional parameters
287
+ # @return [String]
288
+ def get_template_preview_html(template_id, opts = {})
289
+ data, _status_code, _headers = get_template_preview_html_with_http_info(template_id, opts)
290
+ data
291
+ end
292
+
293
+ # Get template preview HTML
294
+ # Get email template preview with passed template variables in HTML format for browsers. Pass template variables as query params.
295
+ # @param template_id [String] Template ID
296
+ # @param [Hash] opts the optional parameters
297
+ # @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
298
+ def get_template_preview_html_with_http_info(template_id, opts = {})
299
+ if @api_client.config.debugging
300
+ @api_client.config.logger.debug 'Calling API: TemplateControllerApi.get_template_preview_html ...'
301
+ end
302
+ # verify the required parameter 'template_id' is set
303
+ if @api_client.config.client_side_validation && template_id.nil?
304
+ fail ArgumentError, "Missing the required parameter 'template_id' when calling TemplateControllerApi.get_template_preview_html"
305
+ end
306
+ # resource path
307
+ local_var_path = '/templates/{templateId}/preview/html'.sub('{' + 'templateId' + '}', CGI.escape(template_id.to_s))
308
+
309
+ # query parameters
310
+ query_params = opts[:query_params] || {}
311
+
312
+ # header parameters
313
+ header_params = opts[:header_params] || {}
314
+ # HTTP header 'Accept' (if needed)
315
+ header_params['Accept'] = @api_client.select_header_accept(['text/html;charset=utf-8', 'text/html'])
316
+
317
+ # form parameters
318
+ form_params = opts[:form_params] || {}
319
+
320
+ # http body (model)
321
+ post_body = opts[:body]
322
+
323
+ # return_type
324
+ return_type = opts[:return_type] || 'String'
325
+
326
+ # auth_names
327
+ auth_names = opts[:auth_names] || ['API_KEY']
328
+
329
+ new_options = opts.merge(
330
+ :header_params => header_params,
331
+ :query_params => query_params,
332
+ :form_params => form_params,
333
+ :body => post_body,
334
+ :auth_names => auth_names,
335
+ :return_type => return_type
336
+ )
337
+
338
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
339
+ if @api_client.config.debugging
340
+ @api_client.config.logger.debug "API called: TemplateControllerApi#get_template_preview_html\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
341
+ end
342
+ return data, status_code, headers
343
+ end
344
+
345
+ # Get template preview Json
346
+ # Get email template preview with passed template variables in JSON format. Pass template variables as query params.
347
+ # @param template_id [String] Template ID
348
+ # @param [Hash] opts the optional parameters
349
+ # @return [TemplatePreview]
350
+ def get_template_preview_json(template_id, opts = {})
351
+ data, _status_code, _headers = get_template_preview_json_with_http_info(template_id, opts)
352
+ data
353
+ end
354
+
355
+ # Get template preview Json
356
+ # Get email template preview with passed template variables in JSON format. Pass template variables as query params.
357
+ # @param template_id [String] Template ID
358
+ # @param [Hash] opts the optional parameters
359
+ # @return [Array<(TemplatePreview, Integer, Hash)>] TemplatePreview data, response status code and response headers
360
+ def get_template_preview_json_with_http_info(template_id, opts = {})
361
+ if @api_client.config.debugging
362
+ @api_client.config.logger.debug 'Calling API: TemplateControllerApi.get_template_preview_json ...'
363
+ end
364
+ # verify the required parameter 'template_id' is set
365
+ if @api_client.config.client_side_validation && template_id.nil?
366
+ fail ArgumentError, "Missing the required parameter 'template_id' when calling TemplateControllerApi.get_template_preview_json"
367
+ end
368
+ # resource path
369
+ local_var_path = '/templates/{templateId}/preview/json'.sub('{' + 'templateId' + '}', CGI.escape(template_id.to_s))
370
+
371
+ # query parameters
372
+ query_params = opts[:query_params] || {}
373
+
374
+ # header parameters
375
+ header_params = opts[:header_params] || {}
376
+ # HTTP header 'Accept' (if needed)
377
+ header_params['Accept'] = @api_client.select_header_accept(['*/*'])
378
+
379
+ # form parameters
380
+ form_params = opts[:form_params] || {}
381
+
382
+ # http body (model)
383
+ post_body = opts[:body]
384
+
385
+ # return_type
386
+ return_type = opts[:return_type] || 'TemplatePreview'
387
+
388
+ # auth_names
389
+ auth_names = opts[:auth_names] || ['API_KEY']
390
+
391
+ new_options = opts.merge(
392
+ :header_params => header_params,
393
+ :query_params => query_params,
394
+ :form_params => form_params,
395
+ :body => post_body,
396
+ :auth_names => auth_names,
397
+ :return_type => return_type
398
+ )
399
+
400
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
401
+ if @api_client.config.debugging
402
+ @api_client.config.logger.debug "API called: TemplateControllerApi#get_template_preview_json\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
403
+ end
404
+ return data, status_code, headers
405
+ end
406
+
283
407
  # List templates
284
408
  # Get all templates
285
409
  # @param [Hash] opts the optional parameters
@@ -548,5 +548,69 @@ module MailSlurpClient
548
548
  end
549
549
  return data, status_code, headers
550
550
  end
551
+
552
+ # Wait for an SMS message to match the provided filter conditions such as body contains keyword.
553
+ # Generic waitFor method that will wait until a phone number meets given conditions or return immediately if already met
554
+ # @param wait_for_sms_conditions [WaitForSmsConditions]
555
+ # @param [Hash] opts the optional parameters
556
+ # @return [Array<SmsPreview>]
557
+ def wait_for_sms(wait_for_sms_conditions, opts = {})
558
+ data, _status_code, _headers = wait_for_sms_with_http_info(wait_for_sms_conditions, opts)
559
+ data
560
+ end
561
+
562
+ # Wait for an SMS message to match the provided filter conditions such as body contains keyword.
563
+ # Generic waitFor method that will wait until a phone number meets given conditions or return immediately if already met
564
+ # @param wait_for_sms_conditions [WaitForSmsConditions]
565
+ # @param [Hash] opts the optional parameters
566
+ # @return [Array<(Array<SmsPreview>, Integer, Hash)>] Array<SmsPreview> data, response status code and response headers
567
+ def wait_for_sms_with_http_info(wait_for_sms_conditions, opts = {})
568
+ if @api_client.config.debugging
569
+ @api_client.config.logger.debug 'Calling API: WaitForControllerApi.wait_for_sms ...'
570
+ end
571
+ # verify the required parameter 'wait_for_sms_conditions' is set
572
+ if @api_client.config.client_side_validation && wait_for_sms_conditions.nil?
573
+ fail ArgumentError, "Missing the required parameter 'wait_for_sms_conditions' when calling WaitForControllerApi.wait_for_sms"
574
+ end
575
+ # resource path
576
+ local_var_path = '/waitForSms'
577
+
578
+ # query parameters
579
+ query_params = opts[:query_params] || {}
580
+
581
+ # header parameters
582
+ header_params = opts[:header_params] || {}
583
+ # HTTP header 'Accept' (if needed)
584
+ header_params['Accept'] = @api_client.select_header_accept(['*/*'])
585
+ # HTTP header 'Content-Type'
586
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
587
+
588
+ # form parameters
589
+ form_params = opts[:form_params] || {}
590
+
591
+ # http body (model)
592
+ post_body = opts[:body] || @api_client.object_to_http_body(wait_for_sms_conditions)
593
+
594
+ # return_type
595
+ return_type = opts[:return_type] || 'Array<SmsPreview>'
596
+
597
+ # auth_names
598
+ auth_names = opts[:auth_names] || ['API_KEY']
599
+
600
+ new_options = opts.merge(
601
+ :header_params => header_params,
602
+ :query_params => query_params,
603
+ :form_params => form_params,
604
+ :body => post_body,
605
+ :auth_names => auth_names,
606
+ :return_type => return_type
607
+ )
608
+
609
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
610
+ if @api_client.config.debugging
611
+ @api_client.config.logger.debug "API called: WaitForControllerApi#wait_for_sms\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
612
+ end
613
+ return data, status_code, headers
614
+ end
551
615
  end
552
616
  end
@@ -604,7 +604,7 @@ module MailSlurpClient
604
604
  fail ArgumentError, "Missing the required parameter 'event' when calling WebhookControllerApi.get_json_schema_for_webhook_event"
605
605
  end
606
606
  # verify enum value
607
- allowable_values = ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED", "EMAIL_READ", "BOUNCE", "BOUNCE_RECIPIENT"]
607
+ allowable_values = ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED", "EMAIL_READ", "BOUNCE", "BOUNCE_RECIPIENT", "NEW_SMS"]
608
608
  if @api_client.config.client_side_validation && !allowable_values.include?(event)
609
609
  fail ArgumentError, "invalid value for \"event\", must be one of #{allowable_values}"
610
610
  end
@@ -725,7 +725,7 @@ module MailSlurpClient
725
725
  if @api_client.config.debugging
726
726
  @api_client.config.logger.debug 'Calling API: WebhookControllerApi.get_test_webhook_payload ...'
727
727
  end
728
- allowable_values = ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED", "EMAIL_READ", "BOUNCE", "BOUNCE_RECIPIENT"]
728
+ allowable_values = ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED", "EMAIL_READ", "BOUNCE", "BOUNCE_RECIPIENT", "NEW_SMS"]
729
729
  if @api_client.config.client_side_validation && opts[:'event_name'] && !allowable_values.include?(opts[:'event_name'])
730
730
  fail ArgumentError, "invalid value for \"event_name\", must be one of #{allowable_values}"
731
731
  end
@@ -126,7 +126,7 @@ module MailSlurpClient
126
126
  # @return true if the model is valid
127
127
  def valid?
128
128
  return false if @event_name.nil?
129
- event_name_validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED", "EMAIL_READ", "BOUNCE", "BOUNCE_RECIPIENT"])
129
+ event_name_validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED", "EMAIL_READ", "BOUNCE", "BOUNCE_RECIPIENT", "NEW_SMS"])
130
130
  return false unless event_name_validator.valid?(@event_name)
131
131
  return false if @message_id.nil?
132
132
  return false if @webhook_id.nil?
@@ -136,7 +136,7 @@ module MailSlurpClient
136
136
  # Custom attribute writer method checking allowed values (enum).
137
137
  # @param [Object] event_name Object to be assigned
138
138
  def event_name=(event_name)
139
- validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED", "EMAIL_READ", "BOUNCE", "BOUNCE_RECIPIENT"])
139
+ validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED", "EMAIL_READ", "BOUNCE", "BOUNCE_RECIPIENT", "NEW_SMS"])
140
140
  unless validator.valid?(event_name)
141
141
  fail ArgumentError, "invalid value for \"event_name\", must be one of #{validator.allowable_values}."
142
142
  end
@@ -19,29 +19,29 @@ module MailSlurpClient
19
19
 
20
20
  attr_accessor :id
21
21
 
22
- attr_accessor :inbox_id
23
-
24
22
  attr_accessor :user_id
25
23
 
26
24
  attr_accessor :email_address
27
25
 
28
- attr_accessor :created_at
26
+ attr_accessor :inbox_id
29
27
 
30
- attr_accessor :use_threads
28
+ attr_accessor :created_at
31
29
 
32
30
  attr_accessor :updated_at
33
31
 
32
+ attr_accessor :use_threads
33
+
34
34
  # Attribute mapping from ruby-style variable name to JSON key.
35
35
  def self.attribute_map
36
36
  {
37
37
  :'name' => :'name',
38
38
  :'id' => :'id',
39
- :'inbox_id' => :'inboxId',
40
39
  :'user_id' => :'userId',
41
40
  :'email_address' => :'emailAddress',
41
+ :'inbox_id' => :'inboxId',
42
42
  :'created_at' => :'createdAt',
43
- :'use_threads' => :'useThreads',
44
- :'updated_at' => :'updatedAt'
43
+ :'updated_at' => :'updatedAt',
44
+ :'use_threads' => :'useThreads'
45
45
  }
46
46
  end
47
47
 
@@ -50,12 +50,12 @@ module MailSlurpClient
50
50
  {
51
51
  :'name' => :'String',
52
52
  :'id' => :'String',
53
- :'inbox_id' => :'String',
54
53
  :'user_id' => :'String',
55
54
  :'email_address' => :'String',
55
+ :'inbox_id' => :'String',
56
56
  :'created_at' => :'DateTime',
57
- :'use_threads' => :'Boolean',
58
- :'updated_at' => :'DateTime'
57
+ :'updated_at' => :'DateTime',
58
+ :'use_threads' => :'Boolean'
59
59
  }
60
60
  end
61
61
 
@@ -88,10 +88,6 @@ module MailSlurpClient
88
88
  self.id = attributes[:'id']
89
89
  end
90
90
 
91
- if attributes.key?(:'inbox_id')
92
- self.inbox_id = attributes[:'inbox_id']
93
- end
94
-
95
91
  if attributes.key?(:'user_id')
96
92
  self.user_id = attributes[:'user_id']
97
93
  end
@@ -100,17 +96,21 @@ module MailSlurpClient
100
96
  self.email_address = attributes[:'email_address']
101
97
  end
102
98
 
103
- if attributes.key?(:'created_at')
104
- self.created_at = attributes[:'created_at']
99
+ if attributes.key?(:'inbox_id')
100
+ self.inbox_id = attributes[:'inbox_id']
105
101
  end
106
102
 
107
- if attributes.key?(:'use_threads')
108
- self.use_threads = attributes[:'use_threads']
103
+ if attributes.key?(:'created_at')
104
+ self.created_at = attributes[:'created_at']
109
105
  end
110
106
 
111
107
  if attributes.key?(:'updated_at')
112
108
  self.updated_at = attributes[:'updated_at']
113
109
  end
110
+
111
+ if attributes.key?(:'use_threads')
112
+ self.use_threads = attributes[:'use_threads']
113
+ end
114
114
  end
115
115
 
116
116
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -121,10 +121,6 @@ module MailSlurpClient
121
121
  invalid_properties.push('invalid value for "id", id cannot be nil.')
122
122
  end
123
123
 
124
- if @inbox_id.nil?
125
- invalid_properties.push('invalid value for "inbox_id", inbox_id cannot be nil.')
126
- end
127
-
128
124
  if @user_id.nil?
129
125
  invalid_properties.push('invalid value for "user_id", user_id cannot be nil.')
130
126
  end
@@ -133,6 +129,10 @@ module MailSlurpClient
133
129
  invalid_properties.push('invalid value for "email_address", email_address cannot be nil.')
134
130
  end
135
131
 
132
+ if @inbox_id.nil?
133
+ invalid_properties.push('invalid value for "inbox_id", inbox_id cannot be nil.')
134
+ end
135
+
136
136
  if @created_at.nil?
137
137
  invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
138
138
  end
@@ -148,9 +148,9 @@ module MailSlurpClient
148
148
  # @return true if the model is valid
149
149
  def valid?
150
150
  return false if @id.nil?
151
- return false if @inbox_id.nil?
152
151
  return false if @user_id.nil?
153
152
  return false if @email_address.nil?
153
+ return false if @inbox_id.nil?
154
154
  return false if @created_at.nil?
155
155
  return false if @updated_at.nil?
156
156
  true
@@ -163,12 +163,12 @@ module MailSlurpClient
163
163
  self.class == o.class &&
164
164
  name == o.name &&
165
165
  id == o.id &&
166
- inbox_id == o.inbox_id &&
167
166
  user_id == o.user_id &&
168
167
  email_address == o.email_address &&
168
+ inbox_id == o.inbox_id &&
169
169
  created_at == o.created_at &&
170
- use_threads == o.use_threads &&
171
- updated_at == o.updated_at
170
+ updated_at == o.updated_at &&
171
+ use_threads == o.use_threads
172
172
  end
173
173
 
174
174
  # @see the `==` method
@@ -180,7 +180,7 @@ module MailSlurpClient
180
180
  # Calculates hash code according to all attributes.
181
181
  # @return [Integer] Hash code
182
182
  def hash
183
- [name, id, inbox_id, user_id, email_address, created_at, use_threads, updated_at].hash
183
+ [name, id, user_id, email_address, inbox_id, created_at, updated_at, use_threads].hash
184
184
  end
185
185
 
186
186
  # Builds the object from hash