mailslurp_client 8.2.16 → 8.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +31 -2
- data/lib/mailslurp_client.rb +10 -2
- data/lib/mailslurp_client/api/alias_controller_api.rb +34 -96
- data/lib/mailslurp_client/api/domain_controller_api.rb +7 -5
- data/lib/mailslurp_client/api/email_controller_api.rb +72 -2
- data/lib/mailslurp_client/api/form_controller_api.rb +4 -7
- data/lib/mailslurp_client/api/inbox_controller_api.rb +87 -10
- data/lib/mailslurp_client/api/mail_server_controller_api.rb +123 -0
- data/lib/mailslurp_client/models/alias_dto.rb +276 -0
- data/lib/mailslurp_client/models/alias_projection.rb +276 -0
- data/lib/mailslurp_client/models/{create_owned_alias_options.rb → create_alias_options.rb} +13 -13
- data/lib/mailslurp_client/models/create_inbox_dto.rb +259 -0
- data/lib/mailslurp_client/models/dns_lookup_options.rb +252 -0
- data/lib/mailslurp_client/models/dns_lookup_result.rb +288 -0
- data/lib/mailslurp_client/models/dns_lookup_results.rb +214 -0
- data/lib/mailslurp_client/models/domain_dto.rb +16 -16
- data/lib/mailslurp_client/models/email.rb +11 -1
- data/lib/mailslurp_client/models/html_validation_result.rb +3 -15
- data/lib/mailslurp_client/models/inbox.rb +5 -5
- data/lib/mailslurp_client/models/ip_address_result.rb +226 -0
- data/lib/mailslurp_client/models/model_alias.rb +36 -22
- data/lib/mailslurp_client/models/page_alias.rb +1 -1
- data/lib/mailslurp_client/models/reply_to_email_options.rb +313 -0
- data/lib/mailslurp_client/models/{create_anonymous_alias_options.rb → update_alias_options.rb} +12 -12
- data/lib/mailslurp_client/models/update_inbox_options.rb +2 -2
- data/lib/mailslurp_client/version.rb +1 -1
- metadata +12 -4
@@ -20,15 +20,14 @@ module MailSlurpClient
|
|
20
20
|
@api_client = api_client
|
21
21
|
end
|
22
22
|
# Submit a form to be parsed and sent as an email to an address determined by the form fields
|
23
|
-
# This endpoint allows you to submit HTML forms and receive the field values and files via email. #### Parameters The endpoint looks for special meta parameters in the form fields OR in the URL request parameters. The meta parameters can be used to specify the behaviour of the email. You must provide at-least a `_to` email address
|
23
|
+
# This endpoint allows you to submit HTML forms and receive the field values and files via email. #### Parameters The endpoint looks for special meta parameters in the form fields OR in the URL request parameters. The meta parameters can be used to specify the behaviour of the email. You must provide at-least a `_to` email address to tell the endpoint where the form should be emailed. These can be submitted as hidden HTML input fields with the corresponding `name` attributes or as URL query parameters such as `?_to=test@example.com` The endpoint takes all other form fields that are named and includes them in the message body of the email. Files are sent as attachments. #### Submitting This endpoint accepts form submission via POST method. It accepts `application/x-www-form-urlencoded`, and `multipart/form-data` content-types. #### HTML Example ```html <form action=\"https://api.mailslurp.com/forms\" method=\"post\" > <input name=\"_to\" type=\"hidden\" value=\"test@example.com\"/> <textarea name=\"feedback\"></textarea> <button type=\"submit\">Submit</button> </form> ``` #### URL Example ```html <form action=\"https://api.mailslurp.com/forms?_to=test@example.com\" method=\"post\" > <textarea name=\"feedback\"></textarea> <button type=\"submit\">Submit</button> </form> ``` The email address is specified by a `_to` field OR is extracted from an email alias specified by a `_toAlias` field (see the alias controller for more information). Endpoint accepts . You can specify a content type in HTML forms using the `enctype` attribute, for instance: `<form enctype=\"multipart/form-data\">`.
|
24
24
|
# @param [Hash] opts the optional parameters
|
25
25
|
# @option opts [String] :_email_address Email address of the submitting user. Include this if you wish to record the submitters email address and reply to it later.
|
26
26
|
# @option opts [String] :_redirect_to Optional URL to redirect form submitter to after submission. If not present user will see a success message.
|
27
27
|
# @option opts [String] :_spam_check Optional but recommended field that catches spammers out. Include as a hidden form field but LEAVE EMPTY. Spam-bots will usually fill every field. If the _spamCheck field is filled the form submission will be ignored.
|
28
28
|
# @option opts [String] :_subject Optional subject of the email that will be sent.
|
29
29
|
# @option opts [String] :_success_message Optional success message to display if no _redirectTo present.
|
30
|
-
# @option opts [String] :_to The email address that submitted form should be sent to.
|
31
|
-
# @option opts [String] :_to_alias ID of an email alias to that form should be sent to. Aliases must be created before submission and can be used to hide an email address and reduce spam.
|
30
|
+
# @option opts [String] :_to The email address that submitted form should be sent to.
|
32
31
|
# @option opts [String] :other_parameters All other parameters or fields will be accepted and attached to the sent email. This includes files and any HTML form field with a name. These fields will become the body of the email that is sent.
|
33
32
|
# @return [String]
|
34
33
|
def submit_form(opts = {})
|
@@ -37,15 +36,14 @@ module MailSlurpClient
|
|
37
36
|
end
|
38
37
|
|
39
38
|
# Submit a form to be parsed and sent as an email to an address determined by the form fields
|
40
|
-
# This endpoint allows you to submit HTML forms and receive the field values and files via email. #### Parameters The endpoint looks for special meta parameters in the form fields OR in the URL request parameters. The meta parameters can be used to specify the behaviour of the email. You must provide at-least a `_to` email address
|
39
|
+
# This endpoint allows you to submit HTML forms and receive the field values and files via email. #### Parameters The endpoint looks for special meta parameters in the form fields OR in the URL request parameters. The meta parameters can be used to specify the behaviour of the email. You must provide at-least a `_to` email address to tell the endpoint where the form should be emailed. These can be submitted as hidden HTML input fields with the corresponding `name` attributes or as URL query parameters such as `?_to=test@example.com` The endpoint takes all other form fields that are named and includes them in the message body of the email. Files are sent as attachments. #### Submitting This endpoint accepts form submission via POST method. It accepts `application/x-www-form-urlencoded`, and `multipart/form-data` content-types. #### HTML Example ```html <form action=\"https://api.mailslurp.com/forms\" method=\"post\" > <input name=\"_to\" type=\"hidden\" value=\"test@example.com\"/> <textarea name=\"feedback\"></textarea> <button type=\"submit\">Submit</button> </form> ``` #### URL Example ```html <form action=\"https://api.mailslurp.com/forms?_to=test@example.com\" method=\"post\" > <textarea name=\"feedback\"></textarea> <button type=\"submit\">Submit</button> </form> ``` The email address is specified by a `_to` field OR is extracted from an email alias specified by a `_toAlias` field (see the alias controller for more information). Endpoint accepts . You can specify a content type in HTML forms using the `enctype` attribute, for instance: `<form enctype=\"multipart/form-data\">`.
|
41
40
|
# @param [Hash] opts the optional parameters
|
42
41
|
# @option opts [String] :_email_address Email address of the submitting user. Include this if you wish to record the submitters email address and reply to it later.
|
43
42
|
# @option opts [String] :_redirect_to Optional URL to redirect form submitter to after submission. If not present user will see a success message.
|
44
43
|
# @option opts [String] :_spam_check Optional but recommended field that catches spammers out. Include as a hidden form field but LEAVE EMPTY. Spam-bots will usually fill every field. If the _spamCheck field is filled the form submission will be ignored.
|
45
44
|
# @option opts [String] :_subject Optional subject of the email that will be sent.
|
46
45
|
# @option opts [String] :_success_message Optional success message to display if no _redirectTo present.
|
47
|
-
# @option opts [String] :_to The email address that submitted form should be sent to.
|
48
|
-
# @option opts [String] :_to_alias ID of an email alias to that form should be sent to. Aliases must be created before submission and can be used to hide an email address and reduce spam.
|
46
|
+
# @option opts [String] :_to The email address that submitted form should be sent to.
|
49
47
|
# @option opts [String] :other_parameters All other parameters or fields will be accepted and attached to the sent email. This includes files and any HTML form field with a name. These fields will become the body of the email that is sent.
|
50
48
|
# @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
|
51
49
|
def submit_form_with_http_info(opts = {})
|
@@ -73,7 +71,6 @@ module MailSlurpClient
|
|
73
71
|
form_params['_subject'] = opts[:'_subject'] if !opts[:'_subject'].nil?
|
74
72
|
form_params['_successMessage'] = opts[:'_success_message'] if !opts[:'_success_message'].nil?
|
75
73
|
form_params['_to'] = opts[:'_to'] if !opts[:'_to'].nil?
|
76
|
-
form_params['_toAlias'] = opts[:'_to_alias'] if !opts[:'_to_alias'].nil?
|
77
74
|
form_params['otherParameters'] = opts[:'other_parameters'] if !opts[:'other_parameters'].nil?
|
78
75
|
|
79
76
|
# http body (model)
|
@@ -93,6 +93,70 @@ module MailSlurpClient
|
|
93
93
|
return data, status_code, headers
|
94
94
|
end
|
95
95
|
|
96
|
+
# Create an inbox with additional options
|
97
|
+
# Additional endpoint that allows inbox creation with request body options. Can be more flexible that other methods for some clients.
|
98
|
+
# @param create_inbox_dto [CreateInboxDto] createInboxDto
|
99
|
+
# @param [Hash] opts the optional parameters
|
100
|
+
# @return [Inbox]
|
101
|
+
def create_inbox_with_options(create_inbox_dto, opts = {})
|
102
|
+
data, _status_code, _headers = create_inbox_with_options_with_http_info(create_inbox_dto, opts)
|
103
|
+
data
|
104
|
+
end
|
105
|
+
|
106
|
+
# Create an inbox with additional options
|
107
|
+
# Additional endpoint that allows inbox creation with request body options. Can be more flexible that other methods for some clients.
|
108
|
+
# @param create_inbox_dto [CreateInboxDto] createInboxDto
|
109
|
+
# @param [Hash] opts the optional parameters
|
110
|
+
# @return [Array<(Inbox, Integer, Hash)>] Inbox data, response status code and response headers
|
111
|
+
def create_inbox_with_options_with_http_info(create_inbox_dto, opts = {})
|
112
|
+
if @api_client.config.debugging
|
113
|
+
@api_client.config.logger.debug 'Calling API: InboxControllerApi.create_inbox_with_options ...'
|
114
|
+
end
|
115
|
+
# verify the required parameter 'create_inbox_dto' is set
|
116
|
+
if @api_client.config.client_side_validation && create_inbox_dto.nil?
|
117
|
+
fail ArgumentError, "Missing the required parameter 'create_inbox_dto' when calling InboxControllerApi.create_inbox_with_options"
|
118
|
+
end
|
119
|
+
# resource path
|
120
|
+
local_var_path = '/inboxes/withOptions'
|
121
|
+
|
122
|
+
# query parameters
|
123
|
+
query_params = opts[:query_params] || {}
|
124
|
+
|
125
|
+
# header parameters
|
126
|
+
header_params = opts[:header_params] || {}
|
127
|
+
# HTTP header 'Accept' (if needed)
|
128
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
129
|
+
# HTTP header 'Content-Type'
|
130
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
131
|
+
|
132
|
+
# form parameters
|
133
|
+
form_params = opts[:form_params] || {}
|
134
|
+
|
135
|
+
# http body (model)
|
136
|
+
post_body = opts[:body] || @api_client.object_to_http_body(create_inbox_dto)
|
137
|
+
|
138
|
+
# return_type
|
139
|
+
return_type = opts[:return_type] || 'Inbox'
|
140
|
+
|
141
|
+
# auth_names
|
142
|
+
auth_names = opts[:auth_names] || ['API_KEY']
|
143
|
+
|
144
|
+
new_options = opts.merge(
|
145
|
+
:header_params => header_params,
|
146
|
+
:query_params => query_params,
|
147
|
+
:form_params => form_params,
|
148
|
+
:body => post_body,
|
149
|
+
:auth_names => auth_names,
|
150
|
+
:return_type => return_type
|
151
|
+
)
|
152
|
+
|
153
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
154
|
+
if @api_client.config.debugging
|
155
|
+
@api_client.config.logger.debug "API called: InboxControllerApi#create_inbox_with_options\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
156
|
+
end
|
157
|
+
return data, status_code, headers
|
158
|
+
end
|
159
|
+
|
96
160
|
# Delete all inboxes
|
97
161
|
# Permanently delete all inboxes and associated email addresses. This will also delete all emails within the inboxes. Be careful as inboxes cannot be recovered once deleted. Note: deleting inboxes will not impact your usage limits. Monthly inbox creation limits are based on how many inboxes were created in the last 30 days, not how many inboxes you currently have.
|
98
162
|
# @param [Hash] opts the optional parameters
|
@@ -207,8 +271,8 @@ module MailSlurpClient
|
|
207
271
|
return data, status_code, headers
|
208
272
|
end
|
209
273
|
|
210
|
-
# List Inboxes Paginated
|
211
|
-
# List inboxes in paginated form.
|
274
|
+
# List All Inboxes Paginated
|
275
|
+
# List inboxes in paginated form. The results are available on the `content` property of the returned object. This method allows for page index (zero based), page size (how many results to return(, and a sort direction (based on createdAt time). You Can also filter by whether an inbox is favorited or use email address pattern. This method is the recommended way to query inboxes. The alternative `getInboxes` method returns a full list of inboxes but is limited to 100 results.
|
212
276
|
# @param [Hash] opts the optional parameters
|
213
277
|
# @option opts [Boolean] :favourite Optionally filter results for favourites only (default to false)
|
214
278
|
# @option opts [Integer] :page Optional page index in inbox list pagination (default to 0)
|
@@ -222,8 +286,8 @@ module MailSlurpClient
|
|
222
286
|
data
|
223
287
|
end
|
224
288
|
|
225
|
-
# List Inboxes Paginated
|
226
|
-
# List inboxes in paginated form.
|
289
|
+
# List All Inboxes Paginated
|
290
|
+
# List inboxes in paginated form. The results are available on the `content` property of the returned object. This method allows for page index (zero based), page size (how many results to return(, and a sort direction (based on createdAt time). You Can also filter by whether an inbox is favorited or use email address pattern. This method is the recommended way to query inboxes. The alternative `getInboxes` method returns a full list of inboxes but is limited to 100 results.
|
227
291
|
# @param [Hash] opts the optional parameters
|
228
292
|
# @option opts [Boolean] :favourite Optionally filter results for favourites only
|
229
293
|
# @option opts [Integer] :page Optional page index in inbox list pagination
|
@@ -285,14 +349,15 @@ module MailSlurpClient
|
|
285
349
|
return data, status_code, headers
|
286
350
|
end
|
287
351
|
|
288
|
-
# Get emails in an Inbox
|
352
|
+
# Get emails in an Inbox. This method is not idempotent as it allows retries and waits if you want certain conditions to be met before returning. For simple listing and sorting of known emails use the email controller instead.
|
289
353
|
# List emails that an inbox has received. Only emails that are sent to the inbox's email address will appear in the inbox. It may take several seconds for any email you send to an inbox's email address to appear in the inbox. To make this endpoint wait for a minimum number of emails use the `minCount` parameter. The server will retry the inbox database until the `minCount` is satisfied or the `retryTimeout` is reached
|
290
354
|
# @param inbox_id [String] Id of inbox that emails belongs to
|
291
355
|
# @param [Hash] opts the optional parameters
|
292
|
-
# @option opts [Integer] :limit Limit the result set, ordered by received date time sort direction
|
356
|
+
# @option opts [Integer] :limit Limit the result set, ordered by received date time sort direction. Maximum 100. For more listing options see the email controller
|
293
357
|
# @option opts [Integer] :min_count Minimum acceptable email count. Will cause request to hang (and retry) until minCount is satisfied or retryTimeout is reached.
|
294
358
|
# @option opts [Integer] :retry_timeout Maximum milliseconds to spend retrying inbox database until minCount emails are returned
|
295
359
|
# @option opts [DateTime] :since Exclude emails received before this ISO 8601 date time
|
360
|
+
# @option opts [Integer] :size Alias for limit. Assessed first before assessing any passed limit.
|
296
361
|
# @option opts [String] :sort Sort the results by received date and direction ASC or DESC
|
297
362
|
# @return [Array<EmailPreview>]
|
298
363
|
def get_emails(inbox_id, opts = {})
|
@@ -300,14 +365,15 @@ module MailSlurpClient
|
|
300
365
|
data
|
301
366
|
end
|
302
367
|
|
303
|
-
# Get emails in an Inbox
|
368
|
+
# Get emails in an Inbox. This method is not idempotent as it allows retries and waits if you want certain conditions to be met before returning. For simple listing and sorting of known emails use the email controller instead.
|
304
369
|
# List emails that an inbox has received. Only emails that are sent to the inbox's email address will appear in the inbox. It may take several seconds for any email you send to an inbox's email address to appear in the inbox. To make this endpoint wait for a minimum number of emails use the `minCount` parameter. The server will retry the inbox database until the `minCount` is satisfied or the `retryTimeout` is reached
|
305
370
|
# @param inbox_id [String] Id of inbox that emails belongs to
|
306
371
|
# @param [Hash] opts the optional parameters
|
307
|
-
# @option opts [Integer] :limit Limit the result set, ordered by received date time sort direction
|
372
|
+
# @option opts [Integer] :limit Limit the result set, ordered by received date time sort direction. Maximum 100. For more listing options see the email controller
|
308
373
|
# @option opts [Integer] :min_count Minimum acceptable email count. Will cause request to hang (and retry) until minCount is satisfied or retryTimeout is reached.
|
309
374
|
# @option opts [Integer] :retry_timeout Maximum milliseconds to spend retrying inbox database until minCount emails are returned
|
310
375
|
# @option opts [DateTime] :since Exclude emails received before this ISO 8601 date time
|
376
|
+
# @option opts [Integer] :size Alias for limit. Assessed first before assessing any passed limit.
|
311
377
|
# @option opts [String] :sort Sort the results by received date and direction ASC or DESC
|
312
378
|
# @return [Array<(Array<EmailPreview>, Integer, Hash)>] Array<EmailPreview> data, response status code and response headers
|
313
379
|
def get_emails_with_http_info(inbox_id, opts = {})
|
@@ -331,6 +397,7 @@ module MailSlurpClient
|
|
331
397
|
query_params[:'minCount'] = opts[:'min_count'] if !opts[:'min_count'].nil?
|
332
398
|
query_params[:'retryTimeout'] = opts[:'retry_timeout'] if !opts[:'retry_timeout'].nil?
|
333
399
|
query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil?
|
400
|
+
query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
|
334
401
|
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
|
335
402
|
|
336
403
|
# header parameters
|
@@ -635,8 +702,10 @@ module MailSlurpClient
|
|
635
702
|
end
|
636
703
|
|
637
704
|
# List Inboxes / Email Addresses
|
638
|
-
# List the inboxes you have created
|
705
|
+
# List the inboxes you have created. Note use of the more advanced `getAllEmails` is recommended. You can provide a limit and sort parameter.
|
639
706
|
# @param [Hash] opts the optional parameters
|
707
|
+
# @option opts [Integer] :size Optional result size limit. Note an automatic limit of 100 results is applied. See the paginated `getAllEmails` for larger queries. (default to 100)
|
708
|
+
# @option opts [String] :sort Optional createdAt sort direction ASC or DESC (default to 'ASC')
|
640
709
|
# @return [Array<Inbox>]
|
641
710
|
def get_inboxes(opts = {})
|
642
711
|
data, _status_code, _headers = get_inboxes_with_http_info(opts)
|
@@ -644,18 +713,26 @@ module MailSlurpClient
|
|
644
713
|
end
|
645
714
|
|
646
715
|
# List Inboxes / Email Addresses
|
647
|
-
# List the inboxes you have created
|
716
|
+
# List the inboxes you have created. Note use of the more advanced `getAllEmails` is recommended. You can provide a limit and sort parameter.
|
648
717
|
# @param [Hash] opts the optional parameters
|
718
|
+
# @option opts [Integer] :size Optional result size limit. Note an automatic limit of 100 results is applied. See the paginated `getAllEmails` for larger queries.
|
719
|
+
# @option opts [String] :sort Optional createdAt sort direction ASC or DESC
|
649
720
|
# @return [Array<(Array<Inbox>, Integer, Hash)>] Array<Inbox> data, response status code and response headers
|
650
721
|
def get_inboxes_with_http_info(opts = {})
|
651
722
|
if @api_client.config.debugging
|
652
723
|
@api_client.config.logger.debug 'Calling API: InboxControllerApi.get_inboxes ...'
|
653
724
|
end
|
725
|
+
allowable_values = ["ASC", "DESC"]
|
726
|
+
if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
|
727
|
+
fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
|
728
|
+
end
|
654
729
|
# resource path
|
655
730
|
local_var_path = '/inboxes'
|
656
731
|
|
657
732
|
# query parameters
|
658
733
|
query_params = opts[:query_params] || {}
|
734
|
+
query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
|
735
|
+
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
|
659
736
|
|
660
737
|
# header parameters
|
661
738
|
header_params = opts[:header_params] || {}
|
@@ -81,6 +81,129 @@ module MailSlurpClient
|
|
81
81
|
return data, status_code, headers
|
82
82
|
end
|
83
83
|
|
84
|
+
# Lookup DNS records for a domain
|
85
|
+
# @param dns_lookup_options [DNSLookupOptions] dnsLookupOptions
|
86
|
+
# @param [Hash] opts the optional parameters
|
87
|
+
# @return [DNSLookupResults]
|
88
|
+
def get_dns_lookup(dns_lookup_options, opts = {})
|
89
|
+
data, _status_code, _headers = get_dns_lookup_with_http_info(dns_lookup_options, opts)
|
90
|
+
data
|
91
|
+
end
|
92
|
+
|
93
|
+
# Lookup DNS records for a domain
|
94
|
+
# @param dns_lookup_options [DNSLookupOptions] dnsLookupOptions
|
95
|
+
# @param [Hash] opts the optional parameters
|
96
|
+
# @return [Array<(DNSLookupResults, Integer, Hash)>] DNSLookupResults data, response status code and response headers
|
97
|
+
def get_dns_lookup_with_http_info(dns_lookup_options, opts = {})
|
98
|
+
if @api_client.config.debugging
|
99
|
+
@api_client.config.logger.debug 'Calling API: MailServerControllerApi.get_dns_lookup ...'
|
100
|
+
end
|
101
|
+
# verify the required parameter 'dns_lookup_options' is set
|
102
|
+
if @api_client.config.client_side_validation && dns_lookup_options.nil?
|
103
|
+
fail ArgumentError, "Missing the required parameter 'dns_lookup_options' when calling MailServerControllerApi.get_dns_lookup"
|
104
|
+
end
|
105
|
+
# resource path
|
106
|
+
local_var_path = '/mail-server/describe/dns-lookup'
|
107
|
+
|
108
|
+
# query parameters
|
109
|
+
query_params = opts[:query_params] || {}
|
110
|
+
|
111
|
+
# header parameters
|
112
|
+
header_params = opts[:header_params] || {}
|
113
|
+
# HTTP header 'Accept' (if needed)
|
114
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
115
|
+
# HTTP header 'Content-Type'
|
116
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
117
|
+
|
118
|
+
# form parameters
|
119
|
+
form_params = opts[:form_params] || {}
|
120
|
+
|
121
|
+
# http body (model)
|
122
|
+
post_body = opts[:body] || @api_client.object_to_http_body(dns_lookup_options)
|
123
|
+
|
124
|
+
# return_type
|
125
|
+
return_type = opts[:return_type] || 'DNSLookupResults'
|
126
|
+
|
127
|
+
# auth_names
|
128
|
+
auth_names = opts[:auth_names] || ['API_KEY']
|
129
|
+
|
130
|
+
new_options = opts.merge(
|
131
|
+
:header_params => header_params,
|
132
|
+
:query_params => query_params,
|
133
|
+
:form_params => form_params,
|
134
|
+
:body => post_body,
|
135
|
+
:auth_names => auth_names,
|
136
|
+
:return_type => return_type
|
137
|
+
)
|
138
|
+
|
139
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
140
|
+
if @api_client.config.debugging
|
141
|
+
@api_client.config.logger.debug "API called: MailServerControllerApi#get_dns_lookup\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
142
|
+
end
|
143
|
+
return data, status_code, headers
|
144
|
+
end
|
145
|
+
|
146
|
+
# Get IP address for a domain
|
147
|
+
# @param name [String] name
|
148
|
+
# @param [Hash] opts the optional parameters
|
149
|
+
# @return [IPAddressResult]
|
150
|
+
def get_ip_address(name, opts = {})
|
151
|
+
data, _status_code, _headers = get_ip_address_with_http_info(name, opts)
|
152
|
+
data
|
153
|
+
end
|
154
|
+
|
155
|
+
# Get IP address for a domain
|
156
|
+
# @param name [String] name
|
157
|
+
# @param [Hash] opts the optional parameters
|
158
|
+
# @return [Array<(IPAddressResult, Integer, Hash)>] IPAddressResult data, response status code and response headers
|
159
|
+
def get_ip_address_with_http_info(name, opts = {})
|
160
|
+
if @api_client.config.debugging
|
161
|
+
@api_client.config.logger.debug 'Calling API: MailServerControllerApi.get_ip_address ...'
|
162
|
+
end
|
163
|
+
# verify the required parameter 'name' is set
|
164
|
+
if @api_client.config.client_side_validation && name.nil?
|
165
|
+
fail ArgumentError, "Missing the required parameter 'name' when calling MailServerControllerApi.get_ip_address"
|
166
|
+
end
|
167
|
+
# resource path
|
168
|
+
local_var_path = '/mail-server/describe/ip-address'
|
169
|
+
|
170
|
+
# query parameters
|
171
|
+
query_params = opts[:query_params] || {}
|
172
|
+
query_params[:'name'] = name
|
173
|
+
|
174
|
+
# header parameters
|
175
|
+
header_params = opts[:header_params] || {}
|
176
|
+
# HTTP header 'Accept' (if needed)
|
177
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
178
|
+
|
179
|
+
# form parameters
|
180
|
+
form_params = opts[:form_params] || {}
|
181
|
+
|
182
|
+
# http body (model)
|
183
|
+
post_body = opts[:body]
|
184
|
+
|
185
|
+
# return_type
|
186
|
+
return_type = opts[:return_type] || 'IPAddressResult'
|
187
|
+
|
188
|
+
# auth_names
|
189
|
+
auth_names = opts[:auth_names] || ['API_KEY']
|
190
|
+
|
191
|
+
new_options = opts.merge(
|
192
|
+
:header_params => header_params,
|
193
|
+
:query_params => query_params,
|
194
|
+
:form_params => form_params,
|
195
|
+
:body => post_body,
|
196
|
+
:auth_names => auth_names,
|
197
|
+
:return_type => return_type
|
198
|
+
)
|
199
|
+
|
200
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
201
|
+
if @api_client.config.debugging
|
202
|
+
@api_client.config.logger.debug "API called: MailServerControllerApi#get_ip_address\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
203
|
+
end
|
204
|
+
return data, status_code, headers
|
205
|
+
end
|
206
|
+
|
84
207
|
# Verify the existence of an email address at a given mail server.
|
85
208
|
# @param verify_options [VerifyEmailAddressOptions] verifyOptions
|
86
209
|
# @param [Hash] opts the optional parameters
|
@@ -0,0 +1,276 @@
|
|
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://www.mailslurp.com/docs/) - [Examples](https://github.com/mailslurp/examples) repository
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 6.5.2
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.3.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module MailSlurpClient
|
16
|
+
# Email alias representation
|
17
|
+
class AliasDto
|
18
|
+
attr_accessor :id
|
19
|
+
|
20
|
+
attr_accessor :inbox_id
|
21
|
+
|
22
|
+
attr_accessor :name
|
23
|
+
|
24
|
+
attr_accessor :pending_email_address
|
25
|
+
|
26
|
+
attr_accessor :use_threads
|
27
|
+
|
28
|
+
attr_accessor :user_id
|
29
|
+
|
30
|
+
attr_accessor :verified_email_address
|
31
|
+
|
32
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
33
|
+
def self.attribute_map
|
34
|
+
{
|
35
|
+
:'id' => :'id',
|
36
|
+
:'inbox_id' => :'inboxId',
|
37
|
+
:'name' => :'name',
|
38
|
+
:'pending_email_address' => :'pendingEmailAddress',
|
39
|
+
:'use_threads' => :'useThreads',
|
40
|
+
:'user_id' => :'userId',
|
41
|
+
:'verified_email_address' => :'verifiedEmailAddress'
|
42
|
+
}
|
43
|
+
end
|
44
|
+
|
45
|
+
# Attribute type mapping.
|
46
|
+
def self.openapi_types
|
47
|
+
{
|
48
|
+
:'id' => :'String',
|
49
|
+
:'inbox_id' => :'String',
|
50
|
+
:'name' => :'String',
|
51
|
+
:'pending_email_address' => :'String',
|
52
|
+
:'use_threads' => :'Boolean',
|
53
|
+
:'user_id' => :'String',
|
54
|
+
:'verified_email_address' => :'String'
|
55
|
+
}
|
56
|
+
end
|
57
|
+
|
58
|
+
# List of attributes with nullable: true
|
59
|
+
def self.openapi_nullable
|
60
|
+
Set.new([
|
61
|
+
])
|
62
|
+
end
|
63
|
+
|
64
|
+
# Initializes the object
|
65
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
66
|
+
def initialize(attributes = {})
|
67
|
+
if (!attributes.is_a?(Hash))
|
68
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::AliasDto` initialize method"
|
69
|
+
end
|
70
|
+
|
71
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
72
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
73
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
74
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::AliasDto`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
75
|
+
end
|
76
|
+
h[k.to_sym] = v
|
77
|
+
}
|
78
|
+
|
79
|
+
if attributes.key?(:'id')
|
80
|
+
self.id = attributes[:'id']
|
81
|
+
end
|
82
|
+
|
83
|
+
if attributes.key?(:'inbox_id')
|
84
|
+
self.inbox_id = attributes[:'inbox_id']
|
85
|
+
end
|
86
|
+
|
87
|
+
if attributes.key?(:'name')
|
88
|
+
self.name = attributes[:'name']
|
89
|
+
end
|
90
|
+
|
91
|
+
if attributes.key?(:'pending_email_address')
|
92
|
+
self.pending_email_address = attributes[:'pending_email_address']
|
93
|
+
end
|
94
|
+
|
95
|
+
if attributes.key?(:'use_threads')
|
96
|
+
self.use_threads = attributes[:'use_threads']
|
97
|
+
end
|
98
|
+
|
99
|
+
if attributes.key?(:'user_id')
|
100
|
+
self.user_id = attributes[:'user_id']
|
101
|
+
end
|
102
|
+
|
103
|
+
if attributes.key?(:'verified_email_address')
|
104
|
+
self.verified_email_address = attributes[:'verified_email_address']
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
109
|
+
# @return Array for valid properties with the reasons
|
110
|
+
def list_invalid_properties
|
111
|
+
invalid_properties = Array.new
|
112
|
+
if @id.nil?
|
113
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
114
|
+
end
|
115
|
+
|
116
|
+
if @inbox_id.nil?
|
117
|
+
invalid_properties.push('invalid value for "inbox_id", inbox_id cannot be nil.')
|
118
|
+
end
|
119
|
+
|
120
|
+
if @user_id.nil?
|
121
|
+
invalid_properties.push('invalid value for "user_id", user_id cannot be nil.')
|
122
|
+
end
|
123
|
+
|
124
|
+
invalid_properties
|
125
|
+
end
|
126
|
+
|
127
|
+
# Check to see if the all the properties in the model are valid
|
128
|
+
# @return true if the model is valid
|
129
|
+
def valid?
|
130
|
+
return false if @id.nil?
|
131
|
+
return false if @inbox_id.nil?
|
132
|
+
return false if @user_id.nil?
|
133
|
+
true
|
134
|
+
end
|
135
|
+
|
136
|
+
# Checks equality by comparing each attribute.
|
137
|
+
# @param [Object] Object to be compared
|
138
|
+
def ==(o)
|
139
|
+
return true if self.equal?(o)
|
140
|
+
self.class == o.class &&
|
141
|
+
id == o.id &&
|
142
|
+
inbox_id == o.inbox_id &&
|
143
|
+
name == o.name &&
|
144
|
+
pending_email_address == o.pending_email_address &&
|
145
|
+
use_threads == o.use_threads &&
|
146
|
+
user_id == o.user_id &&
|
147
|
+
verified_email_address == o.verified_email_address
|
148
|
+
end
|
149
|
+
|
150
|
+
# @see the `==` method
|
151
|
+
# @param [Object] Object to be compared
|
152
|
+
def eql?(o)
|
153
|
+
self == o
|
154
|
+
end
|
155
|
+
|
156
|
+
# Calculates hash code according to all attributes.
|
157
|
+
# @return [Integer] Hash code
|
158
|
+
def hash
|
159
|
+
[id, inbox_id, name, pending_email_address, use_threads, user_id, verified_email_address].hash
|
160
|
+
end
|
161
|
+
|
162
|
+
# Builds the object from hash
|
163
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
164
|
+
# @return [Object] Returns the model itself
|
165
|
+
def self.build_from_hash(attributes)
|
166
|
+
new.build_from_hash(attributes)
|
167
|
+
end
|
168
|
+
|
169
|
+
# Builds the object from hash
|
170
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
171
|
+
# @return [Object] Returns the model itself
|
172
|
+
def build_from_hash(attributes)
|
173
|
+
return nil unless attributes.is_a?(Hash)
|
174
|
+
self.class.openapi_types.each_pair do |key, type|
|
175
|
+
if type =~ /\AArray<(.*)>/i
|
176
|
+
# check to ensure the input is an array given that the attribute
|
177
|
+
# is documented as an array but the input is not
|
178
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
179
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
180
|
+
end
|
181
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
182
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
183
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
184
|
+
end
|
185
|
+
|
186
|
+
self
|
187
|
+
end
|
188
|
+
|
189
|
+
# Deserializes the data based on type
|
190
|
+
# @param string type Data type
|
191
|
+
# @param string value Value to be deserialized
|
192
|
+
# @return [Object] Deserialized data
|
193
|
+
def _deserialize(type, value)
|
194
|
+
case type.to_sym
|
195
|
+
when :DateTime
|
196
|
+
DateTime.parse(value)
|
197
|
+
when :Date
|
198
|
+
Date.parse(value)
|
199
|
+
when :String
|
200
|
+
value.to_s
|
201
|
+
when :Integer
|
202
|
+
value.to_i
|
203
|
+
when :Float
|
204
|
+
value.to_f
|
205
|
+
when :Boolean
|
206
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
207
|
+
true
|
208
|
+
else
|
209
|
+
false
|
210
|
+
end
|
211
|
+
when :Object
|
212
|
+
# generic object (usually a Hash), return directly
|
213
|
+
value
|
214
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
215
|
+
inner_type = Regexp.last_match[:inner_type]
|
216
|
+
value.map { |v| _deserialize(inner_type, v) }
|
217
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
218
|
+
k_type = Regexp.last_match[:k_type]
|
219
|
+
v_type = Regexp.last_match[:v_type]
|
220
|
+
{}.tap do |hash|
|
221
|
+
value.each do |k, v|
|
222
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
223
|
+
end
|
224
|
+
end
|
225
|
+
else # model
|
226
|
+
MailSlurpClient.const_get(type).build_from_hash(value)
|
227
|
+
end
|
228
|
+
end
|
229
|
+
|
230
|
+
# Returns the string representation of the object
|
231
|
+
# @return [String] String presentation of the object
|
232
|
+
def to_s
|
233
|
+
to_hash.to_s
|
234
|
+
end
|
235
|
+
|
236
|
+
# to_body is an alias to to_hash (backward compatibility)
|
237
|
+
# @return [Hash] Returns the object in the form of hash
|
238
|
+
def to_body
|
239
|
+
to_hash
|
240
|
+
end
|
241
|
+
|
242
|
+
# Returns the object in the form of hash
|
243
|
+
# @return [Hash] Returns the object in the form of hash
|
244
|
+
def to_hash
|
245
|
+
hash = {}
|
246
|
+
self.class.attribute_map.each_pair do |attr, param|
|
247
|
+
value = self.send(attr)
|
248
|
+
if value.nil?
|
249
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
250
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
251
|
+
end
|
252
|
+
|
253
|
+
hash[param] = _to_hash(value)
|
254
|
+
end
|
255
|
+
hash
|
256
|
+
end
|
257
|
+
|
258
|
+
# Outputs non-array value in the form of hash
|
259
|
+
# For object, use to_hash. Otherwise, just return the value
|
260
|
+
# @param [Object] value Any valid value
|
261
|
+
# @return [Hash] Returns the value in the form of hash
|
262
|
+
def _to_hash(value)
|
263
|
+
if value.is_a?(Array)
|
264
|
+
value.compact.map { |v| _to_hash(v) }
|
265
|
+
elsif value.is_a?(Hash)
|
266
|
+
{}.tap do |hash|
|
267
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
268
|
+
end
|
269
|
+
elsif value.respond_to? :to_hash
|
270
|
+
value.to_hash
|
271
|
+
else
|
272
|
+
value
|
273
|
+
end
|
274
|
+
end
|
275
|
+
end
|
276
|
+
end
|