Class: MailSafePro::EmailValidationApi

Inherits:
Object
  • Object
show all
Defined in:
lib/mailsafepro/api/email_validation_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ EmailValidationApi

Returns a new instance of EmailValidationApi.



19
20
21
# File 'lib/mailsafepro/api/email_validation_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/mailsafepro/api/email_validation_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#batch_validate_emails_validate_batch_post(batch_validation_request, opts = {}) ⇒ BatchEmailResponse

Batch Email Validation Valida múltiples direcciones de email en una sola solicitud.

Parameters:

Options Hash (opts):

  • :x_api_key (String)
  • :authorization (String)

Returns:



29
30
31
32
# File 'lib/mailsafepro/api/email_validation_api.rb', line 29

def batch_validate_emails_validate_batch_post(batch_validation_request, opts = {})
  data, _status_code, _headers = batch_validate_emails_validate_batch_post_with_http_info(batch_validation_request, opts)
  data
end

#batch_validate_emails_validate_batch_post_with_http_info(batch_validation_request, opts = {}) ⇒ Array<(BatchEmailResponse, Integer, Hash)>

Batch Email Validation Valida múltiples direcciones de email en una sola solicitud.

Parameters:

Options Hash (opts):

  • :x_api_key (String)
  • :authorization (String)

Returns:

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

    BatchEmailResponse data, response status code and response headers



41
42
43
44
45
46
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
# File 'lib/mailsafepro/api/email_validation_api.rb', line 41

def batch_validate_emails_validate_batch_post_with_http_info(batch_validation_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EmailValidationApi.batch_validate_emails_validate_batch_post ...'
  end
  # verify the required parameter 'batch_validation_request' is set
  if @api_client.config.client_side_validation && batch_validation_request.nil?
    fail ArgumentError, "Missing the required parameter 'batch_validation_request' when calling EmailValidationApi.batch_validate_emails_validate_batch_post"
  end
  # resource path
  local_var_path = '/validate/batch'

  # 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(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end
  header_params[:'X-API-Key'] = opts[:'x_api_key'] if !opts[:'x_api_key'].nil?
  header_params[:'authorization'] = opts[:'authorization'] if !opts[:'authorization'].nil?

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

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(batch_validation_request)

  # return_type
  return_type = opts[:debug_return_type] || 'BatchEmailResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"EmailValidationApi.batch_validate_emails_validate_batch_post",
    :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: EmailValidationApi#batch_validate_emails_validate_batch_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#batch_validate_upload_validate_batch_upload_post(file, opts = {}) ⇒ Object

Batch Email Validation via File Upload

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :x_api_key (String)
  • :authorization (String)
  • :column (String)
  • :include_raw_dns (Boolean) — default: default to false
  • :check_smtp (Boolean) — default: default to false

Returns:

  • (Object)


105
106
107
108
# File 'lib/mailsafepro/api/email_validation_api.rb', line 105

def batch_validate_upload_validate_batch_upload_post(file, opts = {})
  data, _status_code, _headers = batch_validate_upload_validate_batch_upload_post_with_http_info(file, opts)
  data
end

#batch_validate_upload_validate_batch_upload_post_with_http_info(file, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Batch Email Validation via File Upload

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :x_api_key (String)
  • :authorization (String)
  • :column (String)
  • :include_raw_dns (Boolean) — default: default to false
  • :check_smtp (Boolean) — default: default to false

Returns:

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

    Object data, response status code and response headers



119
120
121
122
123
124
125
126
127
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
# File 'lib/mailsafepro/api/email_validation_api.rb', line 119

def batch_validate_upload_validate_batch_upload_post_with_http_info(file, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EmailValidationApi.batch_validate_upload_validate_batch_upload_post ...'
  end
  # verify the required parameter 'file' is set
  if @api_client.config.client_side_validation && file.nil?
    fail ArgumentError, "Missing the required parameter 'file' when calling EmailValidationApi.batch_validate_upload_validate_batch_upload_post"
  end
  # resource path
  local_var_path = '/validate/batch/upload'

  # 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(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['multipart/form-data'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end
  header_params[:'X-API-Key'] = opts[:'x_api_key'] if !opts[:'x_api_key'].nil?
  header_params[:'authorization'] = opts[:'authorization'] if !opts[:'authorization'].nil?

  # form parameters
  form_params = opts[:form_params] || {}
  form_params['file'] = file
  form_params['column'] = opts[:'column'] if !opts[:'column'].nil?
  form_params['include_raw_dns'] = opts[:'include_raw_dns'] if !opts[:'include_raw_dns'].nil?
  form_params['check_smtp'] = opts[:'check_smtp'] if !opts[:'check_smtp'].nil?

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

  # return_type
  return_type = opts[:debug_return_type] || 'Object'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"EmailValidationApi.batch_validate_upload_validate_batch_upload_post",
    :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: EmailValidationApi#batch_validate_upload_validate_batch_upload_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_cache_stats_validate_stats_cache_get(opts = {}) ⇒ Object

Get Cache Stats Obtiene estadísticas de cache del sistema.

Parameters:

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

    the optional parameters

Returns:

  • (Object)


182
183
184
185
# File 'lib/mailsafepro/api/email_validation_api.rb', line 182

def get_cache_stats_validate_stats_cache_get(opts = {})
  data, _status_code, _headers = get_cache_stats_validate_stats_cache_get_with_http_info(opts)
  data
end

#get_cache_stats_validate_stats_cache_get_with_http_info(opts = {}) ⇒ Array<(Object, Integer, Hash)>

Get Cache Stats Obtiene estadísticas de cache del sistema.

Parameters:

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

    the optional parameters

Returns:

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

    Object data, response status code and response headers



191
192
193
194
195
196
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
# File 'lib/mailsafepro/api/email_validation_api.rb', line 191

def get_cache_stats_validate_stats_cache_get_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EmailValidationApi.get_cache_stats_validate_stats_cache_get ...'
  end
  # resource path
  local_var_path = '/validate/stats/cache'

  # 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(['application/json']) unless header_params['Accept']

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

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

  # return_type
  return_type = opts[:debug_return_type] || 'Object'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"EmailValidationApi.get_cache_stats_validate_stats_cache_get",
    :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: EmailValidationApi#get_cache_stats_validate_stats_cache_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_usage_stats_validate_stats_usage_get(opts = {}) ⇒ Object

Get Usage Stats Obtiene estadísticas de uso del cliente actual.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :x_api_key (String)
  • :authorization (String)

Returns:

  • (Object)


241
242
243
244
# File 'lib/mailsafepro/api/email_validation_api.rb', line 241

def get_usage_stats_validate_stats_usage_get(opts = {})
  data, _status_code, _headers = get_usage_stats_validate_stats_usage_get_with_http_info(opts)
  data
end

#get_usage_stats_validate_stats_usage_get_with_http_info(opts = {}) ⇒ Array<(Object, Integer, Hash)>

Get Usage Stats Obtiene estadísticas de uso del cliente actual.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :x_api_key (String)
  • :authorization (String)

Returns:

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

    Object data, response status code and response headers



252
253
254
255
256
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/mailsafepro/api/email_validation_api.rb', line 252

def get_usage_stats_validate_stats_usage_get_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EmailValidationApi.get_usage_stats_validate_stats_usage_get ...'
  end
  # resource path
  local_var_path = '/validate/stats/usage'

  # 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(['application/json']) unless header_params['Accept']
  header_params[:'X-API-Key'] = opts[:'x_api_key'] if !opts[:'x_api_key'].nil?
  header_params[:'authorization'] = opts[:'authorization'] if !opts[:'authorization'].nil?

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

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

  # return_type
  return_type = opts[:debug_return_type] || 'Object'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"EmailValidationApi.get_usage_stats_validate_stats_usage_get",
    :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: EmailValidationApi#get_usage_stats_validate_stats_usage_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#health_check_validate_health_get(opts = {}) ⇒ Object

Health Check Health check completo del servicio de validación.

Parameters:

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

    the optional parameters

Returns:

  • (Object)


302
303
304
305
# File 'lib/mailsafepro/api/email_validation_api.rb', line 302

def health_check_validate_health_get(opts = {})
  data, _status_code, _headers = health_check_validate_health_get_with_http_info(opts)
  data
end

#health_check_validate_health_get_with_http_info(opts = {}) ⇒ Array<(Object, Integer, Hash)>

Health Check Health check completo del servicio de validación.

Parameters:

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

    the optional parameters

Returns:

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

    Object data, response status code and response headers



311
312
313
314
315
316
317
318
319
320
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
# File 'lib/mailsafepro/api/email_validation_api.rb', line 311

def health_check_validate_health_get_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EmailValidationApi.health_check_validate_health_get ...'
  end
  # resource path
  local_var_path = '/validate/health'

  # 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(['application/json']) unless header_params['Accept']

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

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

  # return_type
  return_type = opts[:debug_return_type] || 'Object'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"EmailValidationApi.health_check_validate_health_get",
    :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: EmailValidationApi#health_check_validate_health_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#health_check_validate_health_head(opts = {}) ⇒ Object

Health Check Health check completo del servicio de validación.

Parameters:

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

    the optional parameters

Returns:

  • (Object)


359
360
361
362
# File 'lib/mailsafepro/api/email_validation_api.rb', line 359

def health_check_validate_health_head(opts = {})
  data, _status_code, _headers = health_check_validate_health_head_with_http_info(opts)
  data
end

#health_check_validate_health_head_with_http_info(opts = {}) ⇒ Array<(Object, Integer, Hash)>

Health Check Health check completo del servicio de validación.

Parameters:

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

    the optional parameters

Returns:

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

    Object data, response status code and response headers



368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
# File 'lib/mailsafepro/api/email_validation_api.rb', line 368

def health_check_validate_health_head_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EmailValidationApi.health_check_validate_health_head ...'
  end
  # resource path
  local_var_path = '/validate/health'

  # 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(['application/json']) unless header_params['Accept']

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

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

  # return_type
  return_type = opts[:debug_return_type] || 'Object'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"EmailValidationApi.health_check_validate_health_head",
    :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(:HEAD, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EmailValidationApi#health_check_validate_health_head\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#validate_email_endpoint_validate_email_post(email_validation_request, opts = {}) ⇒ Object

Validate Email Endpoint ✅ Endpoint de validación de email con timeout y fallback robusto. Cambios principales: - Timeout explícito por plan (FREE: 15s, PREMIUM: 45s, ENTERPRISE: 60s) - Fallback BASIC seguro si se vence - SIEMPRE retorna JSONResponse válida - client_plan en TODAS las respuestas - spam_trap_check ejecutado ANTES del timeout para estar disponible en fallback - Manejo de errores con ResponseBuilder - ✅ NUEVO: Soporte para TLD .test en testing_mode

Parameters:

Options Hash (opts):

  • :x_api_key (String)
  • :authorization (String)

Returns:

  • (Object)


419
420
421
422
# File 'lib/mailsafepro/api/email_validation_api.rb', line 419

def validate_email_endpoint_validate_email_post(email_validation_request, opts = {})
  data, _status_code, _headers = validate_email_endpoint_validate_email_post_with_http_info(email_validation_request, opts)
  data
end

#validate_email_endpoint_validate_email_post_with_http_info(email_validation_request, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Validate Email Endpoint ✅ Endpoint de validación de email con timeout y fallback robusto. Cambios principales: - Timeout explícito por plan (FREE: 15s, PREMIUM: 45s, ENTERPRISE: 60s) - Fallback BASIC seguro si se vence - SIEMPRE retorna JSONResponse válida - client_plan en TODAS las respuestas - spam_trap_check ejecutado ANTES del timeout para estar disponible en fallback - Manejo de errores con ResponseBuilder - ✅ NUEVO: Soporte para TLD .test en testing_mode

Parameters:

Options Hash (opts):

  • :x_api_key (String)
  • :authorization (String)

Returns:

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

    Object data, response status code and response headers



431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
# File 'lib/mailsafepro/api/email_validation_api.rb', line 431

def validate_email_endpoint_validate_email_post_with_http_info(email_validation_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EmailValidationApi.validate_email_endpoint_validate_email_post ...'
  end
  # verify the required parameter 'email_validation_request' is set
  if @api_client.config.client_side_validation && email_validation_request.nil?
    fail ArgumentError, "Missing the required parameter 'email_validation_request' when calling EmailValidationApi.validate_email_endpoint_validate_email_post"
  end
  # resource path
  local_var_path = '/validate/email'

  # 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(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end
  header_params[:'X-API-Key'] = opts[:'x_api_key'] if !opts[:'x_api_key'].nil?
  header_params[:'authorization'] = opts[:'authorization'] if !opts[:'authorization'].nil?

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

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(email_validation_request)

  # return_type
  return_type = opts[:debug_return_type] || 'Object'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"EmailValidationApi.validate_email_endpoint_validate_email_post",
    :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: EmailValidationApi#validate_email_endpoint_validate_email_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end