Class: MailSlurpClient::EmailVerificationControllerApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ EmailVerificationControllerApi

Returns a new instance of EmailVerificationControllerApi.



19
20
21
# File 'lib/mailslurp_client/api/email_verification_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/email_verification_controller_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#delete_all_validation_requests(opts = {}) ⇒ nil

Delete all validation requests

Parameters:

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

    the optional parameters

Returns:

  • (nil)


25
26
27
28
# File 'lib/mailslurp_client/api/email_verification_controller_api.rb', line 25

def delete_all_validation_requests(opts = {})
  delete_all_validation_requests_with_http_info(opts)
  nil
end

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

Delete all validation requests

Parameters:

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



33
34
35
36
37
38
39
40
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
# File 'lib/mailslurp_client/api/email_verification_controller_api.rb', line 33

def delete_all_validation_requests_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EmailVerificationControllerApi.delete_all_validation_requests ...'
  end
  # resource path
  local_var_path = '/email-verification'

  # 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(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EmailVerificationControllerApi#delete_all_validation_requests\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_validation_request(id, opts = {}) ⇒ nil

Delete a validation record

Parameters:

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

    the optional parameters

Returns:

  • (nil)


78
79
80
81
# File 'lib/mailslurp_client/api/email_verification_controller_api.rb', line 78

def delete_validation_request(id, opts = {})
  delete_validation_request_with_http_info(id, opts)
  nil
end

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

Delete a validation record

Parameters:

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# File 'lib/mailslurp_client/api/email_verification_controller_api.rb', line 87

def delete_validation_request_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EmailVerificationControllerApi.delete_validation_request ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling EmailVerificationControllerApi.delete_validation_request"
  end
  # resource path
  local_var_path = '/email-verification/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # 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(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EmailVerificationControllerApi#delete_validation_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_validation_requests(opts = {}) ⇒ PageEmailValidationRequest

Validate a list of email addresses. Per unit billing. See your plan for pricing.

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 for paginated result list. (default to 20)

  • :sort (String)

    Optional createdAt sort direction ASC or DESC (default to '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

  • :is_valid (Boolean)

    Filter where email is valid is true or false

Returns:



142
143
144
145
# File 'lib/mailslurp_client/api/email_verification_controller_api.rb', line 142

def get_validation_requests(opts = {})
  data, _status_code, _headers = get_validation_requests_with_http_info(opts)
  data
end

#get_validation_requests_with_http_info(opts = {}) ⇒ Array<(PageEmailValidationRequest, Integer, Hash)>

Validate a list of email addresses. Per unit billing. See your plan for pricing.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Optional page index in list pagination

  • :size (Integer)

    Optional page size for paginated result list.

  • :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

  • :is_valid (Boolean)

    Filter where email is valid is true or false

Returns:

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

    PageEmailValidationRequest data, response status code and response headers



157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
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
# File 'lib/mailslurp_client/api/email_verification_controller_api.rb', line 157

def get_validation_requests_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EmailVerificationControllerApi.get_validation_requests ...'
  end
  if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] > 9223372036854775807
    fail ArgumentError, 'invalid value for "opts[:"page"]" when calling EmailVerificationControllerApi.get_validation_requests, must be smaller than or equal to 9223372036854775807.'
  end

  if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 0
    fail ArgumentError, 'invalid value for "opts[:"page"]" when calling EmailVerificationControllerApi.get_validation_requests, must be greater than or equal to 0.'
  end

  if @api_client.config.client_side_validation && !opts[:'size'].nil? && opts[:'size'] > 100
    fail ArgumentError, 'invalid value for "opts[:"size"]" when calling EmailVerificationControllerApi.get_validation_requests, must be smaller than or equal to 100.'
  end

  if @api_client.config.client_side_validation && !opts[:'size'].nil? && opts[:'size'] < 1
    fail ArgumentError, 'invalid value for "opts[:"size"]" when calling EmailVerificationControllerApi.get_validation_requests, must be greater than or equal to 1.'
  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 = '/email-verification/validation-requests'

  # 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[:'isValid'] = opts[:'is_valid'] if !opts[:'is_valid'].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] || 'PageEmailValidationRequest' 

  # 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: EmailVerificationControllerApi#get_validation_requests\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#validate_email_address_list(validate_email_address_list_options, opts = {}) ⇒ ValidateEmailAddressListResult

Validate a list of email addresses. Per unit billing. See your plan for pricing.

Parameters:

Returns:



231
232
233
234
# File 'lib/mailslurp_client/api/email_verification_controller_api.rb', line 231

def validate_email_address_list(validate_email_address_list_options, opts = {})
  data, _status_code, _headers = validate_email_address_list_with_http_info(validate_email_address_list_options, opts)
  data
end

#validate_email_address_list_with_http_info(validate_email_address_list_options, opts = {}) ⇒ Array<(ValidateEmailAddressListResult, Integer, Hash)>

Validate a list of email addresses. Per unit billing. See your plan for pricing.

Parameters:

Returns:



240
241
242
243
244
245
246
247
248
249
250
251
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
# File 'lib/mailslurp_client/api/email_verification_controller_api.rb', line 240

def validate_email_address_list_with_http_info(validate_email_address_list_options, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EmailVerificationControllerApi.validate_email_address_list ...'
  end
  # verify the required parameter 'validate_email_address_list_options' is set
  if @api_client.config.client_side_validation && validate_email_address_list_options.nil?
    fail ArgumentError, "Missing the required parameter 'validate_email_address_list_options' when calling EmailVerificationControllerApi.validate_email_address_list"
  end
  # resource path
  local_var_path = '/email-verification/email-address-list'

  # 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(['*/*'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

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

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

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

  # 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: EmailVerificationControllerApi#validate_email_address_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end