Class: MailSlurpClient::MissedEmailControllerApi

Inherits:
Object
  • Object
show all
Defined in:
lib/mailslurp_client/api/missed_email_controller_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ MissedEmailControllerApi

Returns a new instance of MissedEmailControllerApi.



19
20
21
# File 'lib/mailslurp_client/api/missed_email_controller_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/mailslurp_client/api/missed_email_controller_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#get_all_missed_emails(opts = {}) ⇒ PageMissedEmailProjection

Get all MissedEmails in paginated format

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Optional page index in list pagination (default to 0)

  • :size (Integer)

    Optional page size in list pagination (default to 20)

  • :sort (String)

    Optional createdAt sort direction ASC or DESC (default to 'ASC')

  • :search_filter (String)

    Optional search filter

  • :since (DateTime)

    Filter by created at after the given timestamp

  • :before (DateTime)

    Filter by created at before the given timestamp

  • :inbox_id (String)

    Optional inbox ID filter

Returns:



32
33
34
35
# File 'lib/mailslurp_client/api/missed_email_controller_api.rb', line 32

def get_all_missed_emails(opts = {})
  data, _status_code, _headers = get_all_missed_emails_with_http_info(opts)
  data
end

#get_all_missed_emails_with_http_info(opts = {}) ⇒ Array<(PageMissedEmailProjection, Integer, Hash)>

Get all MissedEmails in paginated format

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Optional page index in list pagination

  • :size (Integer)

    Optional page size in list pagination

  • :sort (String)

    Optional createdAt sort direction ASC or DESC

  • :search_filter (String)

    Optional search filter

  • :since (DateTime)

    Filter by created at after the given timestamp

  • :before (DateTime)

    Filter by created at before the given timestamp

  • :inbox_id (String)

    Optional inbox ID filter

Returns:

  • (Array<(PageMissedEmailProjection, Integer, Hash)>)

    PageMissedEmailProjection data, response status code and response headers



47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/mailslurp_client/api/missed_email_controller_api.rb', line 47

def get_all_missed_emails_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MissedEmailControllerApi.get_all_missed_emails ...'
  end
  allowable_values = ["ASC", "DESC"]
  if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
    fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/missed-emails'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
  query_params[:'searchFilter'] = opts[:'search_filter'] if !opts[:'search_filter'].nil?
  query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil?
  query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
  query_params[:'inboxId'] = opts[:'inbox_id'] if !opts[:'inbox_id'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'PageMissedEmailProjection' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: MissedEmailControllerApi#get_all_missed_emails\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_all_unknown_missed_emails(opts = {}) ⇒ PageUnknownMissedEmailProjection

Get all unknown missed emails in paginated format Unknown missed emails are emails that were sent to MailSlurp but could not be assigned to an existing inbox.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Optional page index in list pagination (default to 0)

  • :size (Integer)

    Optional page size in list pagination (default to 20)

  • :sort (String)

    Optional createdAt sort direction ASC or DESC (default to 'ASC')

  • :search_filter (String)

    Optional search filter

  • :since (DateTime)

    Filter by created at after the given timestamp

  • :before (DateTime)

    Filter by created at before the given timestamp

  • :inbox_id (String)

    Optional inbox ID filter

Returns:



112
113
114
115
# File 'lib/mailslurp_client/api/missed_email_controller_api.rb', line 112

def get_all_unknown_missed_emails(opts = {})
  data, _status_code, _headers = get_all_unknown_missed_emails_with_http_info(opts)
  data
end

#get_all_unknown_missed_emails_with_http_info(opts = {}) ⇒ Array<(PageUnknownMissedEmailProjection, Integer, Hash)>

Get all unknown missed emails in paginated format Unknown missed emails are emails that were sent to MailSlurp but could not be assigned to an existing inbox.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Optional page index in list pagination

  • :size (Integer)

    Optional page size in list pagination

  • :sort (String)

    Optional createdAt sort direction ASC or DESC

  • :search_filter (String)

    Optional search filter

  • :since (DateTime)

    Filter by created at after the given timestamp

  • :before (DateTime)

    Filter by created at before the given timestamp

  • :inbox_id (String)

    Optional inbox ID filter

Returns:



128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
# File 'lib/mailslurp_client/api/missed_email_controller_api.rb', line 128

def get_all_unknown_missed_emails_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MissedEmailControllerApi.get_all_unknown_missed_emails ...'
  end
  allowable_values = ["ASC", "DESC"]
  if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
    fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/missed-emails/unknown'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
  query_params[:'searchFilter'] = opts[:'search_filter'] if !opts[:'search_filter'].nil?
  query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil?
  query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
  query_params[:'inboxId'] = opts[:'inbox_id'] if !opts[:'inbox_id'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'PageUnknownMissedEmailProjection' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: MissedEmailControllerApi#get_all_unknown_missed_emails\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_missed_email(missed_email_id, opts = {}) ⇒ MissedEmailDto

Get MissedEmail List emails that were missed due to plan limits.

Parameters:

  • missed_email_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



187
188
189
190
# File 'lib/mailslurp_client/api/missed_email_controller_api.rb', line 187

def get_missed_email(missed_email_id, opts = {})
  data, _status_code, _headers = get_missed_email_with_http_info(missed_email_id, opts)
  data
end

#get_missed_email_with_http_info(missed_email_id, opts = {}) ⇒ Array<(MissedEmailDto, Integer, Hash)>

Get MissedEmail List emails that were missed due to plan limits.

Parameters:

  • missed_email_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(MissedEmailDto, Integer, Hash)>)

    MissedEmailDto data, response status code and response headers



197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
# File 'lib/mailslurp_client/api/missed_email_controller_api.rb', line 197

def get_missed_email_with_http_info(missed_email_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MissedEmailControllerApi.get_missed_email ...'
  end
  # verify the required parameter 'missed_email_id' is set
  if @api_client.config.client_side_validation && missed_email_id.nil?
    fail ArgumentError, "Missing the required parameter 'missed_email_id' when calling MissedEmailControllerApi.get_missed_email"
  end
  # resource path
  local_var_path = '/missed-emails/{missedEmailId}'.sub('{' + 'missedEmailId' + '}', CGI.escape(missed_email_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'MissedEmailDto' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: MissedEmailControllerApi#get_missed_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#restore_missed_emails(opts = {}) ⇒ nil

Restore missed emails If emails were missed due to a plan limit they are saved as missed emails. If support team enables the canRestore flag these emails can be reload into your account using this method.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


248
249
250
251
# File 'lib/mailslurp_client/api/missed_email_controller_api.rb', line 248

def restore_missed_emails(opts = {})
  restore_missed_emails_with_http_info(opts)
  nil
end

#restore_missed_emails_with_http_info(opts = {}) ⇒ Array<(nil, Integer, Hash)>

Restore missed emails If emails were missed due to a plan limit they are saved as missed emails. If support team enables the canRestore flag these emails can be reload into your account using this method.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
# File 'lib/mailslurp_client/api/missed_email_controller_api.rb', line 257

def restore_missed_emails_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MissedEmailControllerApi.restore_missed_emails ...'
  end
  # resource path
  local_var_path = '/missed-emails/restore'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: MissedEmailControllerApi#restore_missed_emails\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#wait_for_nth_missed_email(index, opts = {}) ⇒ MissedEmailDto

Wait for Nth missed email Wait for 0 based index missed email

Parameters:

  • index (Integer)

    Zero based index of the email to wait for. If 1 missed email already and you want to wait for the 2nd email pass index&#x3D;1

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :inbox_id (String)

    Optional inbox ID filter

  • :timeout (Integer)

    Optional timeout milliseconds

  • :since (DateTime)

    Filter by created at after the given timestamp

  • :before (DateTime)

    Filter by created at before the given timestamp

Returns:



307
308
309
310
# File 'lib/mailslurp_client/api/missed_email_controller_api.rb', line 307

def wait_for_nth_missed_email(index, opts = {})
  data, _status_code, _headers = wait_for_nth_missed_email_with_http_info(index, opts)
  data
end

#wait_for_nth_missed_email_with_http_info(index, opts = {}) ⇒ Array<(MissedEmailDto, Integer, Hash)>

Wait for Nth missed email Wait for 0 based index missed email

Parameters:

  • index (Integer)

    Zero based index of the email to wait for. If 1 missed email already and you want to wait for the 2nd email pass index&#x3D;1

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :inbox_id (String)

    Optional inbox ID filter

  • :timeout (Integer)

    Optional timeout milliseconds

  • :since (DateTime)

    Filter by created at after the given timestamp

  • :before (DateTime)

    Filter by created at before the given timestamp

Returns:

  • (Array<(MissedEmailDto, Integer, Hash)>)

    MissedEmailDto data, response status code and response headers



321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
# File 'lib/mailslurp_client/api/missed_email_controller_api.rb', line 321

def wait_for_nth_missed_email_with_http_info(index, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MissedEmailControllerApi.wait_for_nth_missed_email ...'
  end
  # verify the required parameter 'index' is set
  if @api_client.config.client_side_validation && index.nil?
    fail ArgumentError, "Missing the required parameter 'index' when calling MissedEmailControllerApi.wait_for_nth_missed_email"
  end
  if @api_client.config.client_side_validation && index > 2147483647
    fail ArgumentError, 'invalid value for "index" when calling MissedEmailControllerApi.wait_for_nth_missed_email, must be smaller than or equal to 2147483647.'
  end

  if @api_client.config.client_side_validation && index < 0
    fail ArgumentError, 'invalid value for "index" when calling MissedEmailControllerApi.wait_for_nth_missed_email, must be greater than or equal to 0.'
  end

  # resource path
  local_var_path = '/missed-emails/waitForNthMissedEmail'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'index'] = index
  query_params[:'inboxId'] = opts[:'inbox_id'] if !opts[:'inbox_id'].nil?
  query_params[:'timeout'] = opts[:'timeout'] if !opts[:'timeout'].nil?
  query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil?
  query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'MissedEmailDto' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: MissedEmailControllerApi#wait_for_nth_missed_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end