mailslurp_client 8.2.11 → 8.2.17

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a40608cc8ee70cfd122f80fababa6cad2e55bab5bcca6f96212bd63a13502961
4
- data.tar.gz: 94ee3ff4be8b1d07e049ec5dccfcd47609c5b1767e22f14b3ce11f959b0909b3
3
+ metadata.gz: 881dae0965a313cf4e679fc47e998a276e07d3061765332c5ce6e383b5b837c9
4
+ data.tar.gz: 37bc815bc87386f28781283cc8188d67eaff8e064017f5dcf9c13b61a6e79206
5
5
  SHA512:
6
- metadata.gz: 84c3e53059f5a0d9fab85eff31f7eb70b87f241c47be0cdb681f3b378f7975e277b5d973071d4a375733113aab280f50ffe851cc03c7b533a801f6c41a3f4086
7
- data.tar.gz: b0279d78a93d3cf3692b99e04387e89239e18804fe8b2cbcb59ed216f72421705904571ecb8c7cab15e7a9781ce4c8feacfc8326251e3cc529fa0f20dda1b7b7
6
+ metadata.gz: 8f96ca7c6b8e8576577ab457784427bd827f6c2168ca80baf22d979107aac4ab9491643e6f06172fb002e0583ac34c58efa2796f35d800bd6717ea9216902fb5
7
+ data.tar.gz: 1210557bf09554f787242009ef9d604c4ce4565ec3bc0a3b72f605c484869a5707cc5e4e93f8d9fb8f5267e7e45294102f9609464ebc3197a0004cd44ea62ec0
@@ -30,6 +30,9 @@ require 'mailslurp_client/models/create_group_options'
30
30
  require 'mailslurp_client/models/create_owned_alias_options'
31
31
  require 'mailslurp_client/models/create_template_options'
32
32
  require 'mailslurp_client/models/create_webhook_options'
33
+ require 'mailslurp_client/models/dns_lookup_options'
34
+ require 'mailslurp_client/models/dns_lookup_result'
35
+ require 'mailslurp_client/models/dns_lookup_results'
33
36
  require 'mailslurp_client/models/describe_domain_options'
34
37
  require 'mailslurp_client/models/describe_mail_server_domain_result'
35
38
  require 'mailslurp_client/models/domain_dto'
@@ -46,6 +49,7 @@ require 'mailslurp_client/models/group_contacts_dto'
46
49
  require 'mailslurp_client/models/group_dto'
47
50
  require 'mailslurp_client/models/group_projection'
48
51
  require 'mailslurp_client/models/html_validation_result'
52
+ require 'mailslurp_client/models/ip_address_result'
49
53
  require 'mailslurp_client/models/inbox'
50
54
  require 'mailslurp_client/models/inbox_projection'
51
55
  require 'mailslurp_client/models/match_option'
@@ -64,7 +68,6 @@ require 'mailslurp_client/models/page_webhook_projection'
64
68
  require 'mailslurp_client/models/pageable'
65
69
  require 'mailslurp_client/models/raw_email_json'
66
70
  require 'mailslurp_client/models/send_email_options'
67
- require 'mailslurp_client/models/sent_email'
68
71
  require 'mailslurp_client/models/sent_email_dto'
69
72
  require 'mailslurp_client/models/sent_email_projection'
70
73
  require 'mailslurp_client/models/set_inbox_favourited_options'
@@ -20,7 +20,7 @@ module MailSlurpClient
20
20
  @api_client = api_client
21
21
  end
22
22
  # Upload an attachment for sending using base64 file encoding. Returns an array whose first element is the ID of the uploaded attachment.
23
- # When sending emails with attachments first upload each attachment with an upload endpoint. Record the returned attachment IDs. For legacy reasons the ID is returned in an array. Only a single ID is ever returned at one time. To send the attachments pass a list of attachment IDs with SendEmailOptions when sending an email. Using the upload endpoints prior to sending mean attachments can easily be reused.
23
+ # Email attachments are essentially files with meta data. Files are byte arrays and the meta data is a content type and a filename. These properties allow email clients to display the filename and icon etc. When sending emails with attachments first upload each attachment with an upload endpoint. Record the returned attachment ID and use it with subsequent email sending. For legacy reasons the ID is returned as the first element in an array. Only a single ID is ever returned. To send the attachments pass a list of attachment IDs with `SendEmailOptions` when sending an email. Using the upload endpoints prior to sending mean attachments can easily be reused.
24
24
  # @param upload_options [UploadAttachmentOptions] uploadOptions
25
25
  # @param [Hash] opts the optional parameters
26
26
  # @return [Array<String>]
@@ -30,7 +30,7 @@ module MailSlurpClient
30
30
  end
31
31
 
32
32
  # Upload an attachment for sending using base64 file encoding. Returns an array whose first element is the ID of the uploaded attachment.
33
- # When sending emails with attachments first upload each attachment with an upload endpoint. Record the returned attachment IDs. For legacy reasons the ID is returned in an array. Only a single ID is ever returned at one time. To send the attachments pass a list of attachment IDs with SendEmailOptions when sending an email. Using the upload endpoints prior to sending mean attachments can easily be reused.
33
+ # Email attachments are essentially files with meta data. Files are byte arrays and the meta data is a content type and a filename. These properties allow email clients to display the filename and icon etc. When sending emails with attachments first upload each attachment with an upload endpoint. Record the returned attachment ID and use it with subsequent email sending. For legacy reasons the ID is returned as the first element in an array. Only a single ID is ever returned. To send the attachments pass a list of attachment IDs with &#x60;SendEmailOptions&#x60; when sending an email. Using the upload endpoints prior to sending mean attachments can easily be reused.
34
34
  # @param upload_options [UploadAttachmentOptions] uploadOptions
35
35
  # @param [Hash] opts the optional parameters
36
36
  # @return [Array<(Array<String>, Integer, Hash)>] Array<String> data, response status code and response headers
@@ -84,7 +84,7 @@ module MailSlurpClient
84
84
  end
85
85
 
86
86
  # Upload an attachment for sending using file byte stream input octet stream. Returns an array whose first element is the ID of the uploaded attachment.
87
- # When sending emails with attachments first upload each attachment with an upload endpoint. Record the returned attachment IDs. For legacy reasons the ID is returned in an array. Only a single ID is ever returned at one time. To send the attachments pass a list of attachment IDs with SendEmailOptions when sending an email. Using the upload endpoints prior to sending mean attachments can easily be reused.
87
+ # Email attachments are essentially files with meta data. Files are byte arrays and the meta data is a content type and a filename. These properties allow email clients to display the filename and icon etc. When sending emails with attachments first upload each attachment with an upload endpoint. Record the returned attachment ID and use it with subsequent email sending. For legacy reasons the ID is returned as the first element in an array. Only a single ID is ever returned. To send the attachments pass a list of attachment IDs with `SendEmailOptions` when sending an email. Using the upload endpoints prior to sending mean attachments can easily be reused.
88
88
  # @param [Hash] opts the optional parameters
89
89
  # @option opts [String] :string Optional contentType for file. For instance &#x60;application/pdf&#x60;
90
90
  # @option opts [String] :filename Optional filename to save upload with
@@ -96,7 +96,7 @@ module MailSlurpClient
96
96
  end
97
97
 
98
98
  # Upload an attachment for sending using file byte stream input octet stream. Returns an array whose first element is the ID of the uploaded attachment.
99
- # When sending emails with attachments first upload each attachment with an upload endpoint. Record the returned attachment IDs. For legacy reasons the ID is returned in an array. Only a single ID is ever returned at one time. To send the attachments pass a list of attachment IDs with SendEmailOptions when sending an email. Using the upload endpoints prior to sending mean attachments can easily be reused.
99
+ # Email attachments are essentially files with meta data. Files are byte arrays and the meta data is a content type and a filename. These properties allow email clients to display the filename and icon etc. When sending emails with attachments first upload each attachment with an upload endpoint. Record the returned attachment ID and use it with subsequent email sending. For legacy reasons the ID is returned as the first element in an array. Only a single ID is ever returned. To send the attachments pass a list of attachment IDs with &#x60;SendEmailOptions&#x60; when sending an email. Using the upload endpoints prior to sending mean attachments can easily be reused.
100
100
  # @param [Hash] opts the optional parameters
101
101
  # @option opts [String] :string Optional contentType for file. For instance &#x60;application/pdf&#x60;
102
102
  # @option opts [String] :filename Optional filename to save upload with
@@ -150,7 +150,7 @@ module MailSlurpClient
150
150
  end
151
151
 
152
152
  # Upload an attachment for sending using a Multipart Form request. Returns an array whose first element is the ID of the uploaded attachment.
153
- # When sending emails with attachments first upload each attachment with an upload endpoint. Record the returned attachment IDs. For legacy reasons the ID is returned in an array. Only a single ID is ever returned at one time. To send the attachments pass a list of attachment IDs with SendEmailOptions when sending an email. Using the upload endpoints prior to sending mean attachments can easily be reused.
153
+ # Email attachments are essentially files with meta data. Files are byte arrays and the meta data is a content type and a filename. These properties allow email clients to display the filename and icon etc. When sending emails with attachments first upload each attachment with an upload endpoint. Record the returned attachment ID and use it with subsequent email sending. For legacy reasons the ID is returned as the first element in an array. Only a single ID is ever returned. To send the attachments pass a list of attachment IDs with `SendEmailOptions` when sending an email. Using the upload endpoints prior to sending mean attachments can easily be reused.
154
154
  # @param file [File] file
155
155
  # @param [Hash] opts the optional parameters
156
156
  # @option opts [String] :content_type Optional content type of attachment
@@ -163,7 +163,7 @@ module MailSlurpClient
163
163
  end
164
164
 
165
165
  # Upload an attachment for sending using a Multipart Form request. Returns an array whose first element is the ID of the uploaded attachment.
166
- # When sending emails with attachments first upload each attachment with an upload endpoint. Record the returned attachment IDs. For legacy reasons the ID is returned in an array. Only a single ID is ever returned at one time. To send the attachments pass a list of attachment IDs with SendEmailOptions when sending an email. Using the upload endpoints prior to sending mean attachments can easily be reused.
166
+ # Email attachments are essentially files with meta data. Files are byte arrays and the meta data is a content type and a filename. These properties allow email clients to display the filename and icon etc. When sending emails with attachments first upload each attachment with an upload endpoint. Record the returned attachment ID and use it with subsequent email sending. For legacy reasons the ID is returned as the first element in an array. Only a single ID is ever returned. To send the attachments pass a list of attachment IDs with &#x60;SendEmailOptions&#x60; when sending an email. Using the upload endpoints prior to sending mean attachments can easily be reused.
167
167
  # @param file [File] file
168
168
  # @param [Hash] opts the optional parameters
169
169
  # @option opts [String] :content_type Optional content type of attachment
@@ -536,7 +536,7 @@ module MailSlurpClient
536
536
  end
537
537
 
538
538
  # Get email content regex pattern match results. Runs regex against email body and returns match groups.
539
- # Return the matches for a given Java style regex pattern. Do not include the typical `/` at start or end of regex in some languages. Given an example `your code is: 12345` the pattern to extract match looks like `code is: (\\d{6})`. This will return an array of matches with the first matching the entire pattern and the subsequent matching the groups: `['code is: 123456', '123456']` See https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html for more information of available patterns.
539
+ # Return the matches for a given Java style regex pattern. Do not include the typical `/` at start or end of regex in some languages. Given an example `your code is: 12345` the pattern to extract match looks like `code is: (\\d{6})`. This will return an array of matches with the first matching the entire pattern and the subsequent matching the groups: `['code is: 123456', '123456']` See https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html for more information of available patterns.
540
540
  # @param email_id [String] ID of email to match against
541
541
  # @param content_match_options [ContentMatchOptions] contentMatchOptions
542
542
  # @param [Hash] opts the optional parameters
@@ -547,7 +547,7 @@ module MailSlurpClient
547
547
  end
548
548
 
549
549
  # Get email content regex pattern match results. Runs regex against email body and returns match groups.
550
- # Return the matches for a given Java style regex pattern. Do not include the typical &#x60;/&#x60; at start or end of regex in some languages. Given an example &#x60;your code is: 12345&#x60; the pattern to extract match looks like &#x60;code is: (\\d{6})&#x60;. This will return an array of matches with the first matching the entire pattern and the subsequent matching the groups: &#x60;[&#39;code is: 123456&#39;, &#39;123456&#39;]&#x60; See https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html for more information of available patterns.
550
+ # Return the matches for a given Java style regex pattern. Do not include the typical &#x60;/&#x60; at start or end of regex in some languages. Given an example &#x60;your code is: 12345&#x60; the pattern to extract match looks like &#x60;code is: (\\d{6})&#x60;. This will return an array of matches with the first matching the entire pattern and the subsequent matching the groups: &#x60;[&#39;code is: 123456&#39;, &#39;123456&#39;]&#x60; See https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html for more information of available patterns.
551
551
  # @param email_id [String] ID of email to match against
552
552
  # @param content_match_options [ContentMatchOptions] contentMatchOptions
553
553
  # @param [Hash] opts the optional parameters
@@ -598,7 +598,7 @@ module MailSlurpClient
598
598
  :return_type => return_type
599
599
  )
600
600
 
601
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
601
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
602
602
  if @api_client.config.debugging
603
603
  @api_client.config.logger.debug "API called: EmailControllerApi#get_email_content_match\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
604
604
  end
@@ -675,7 +675,7 @@ module MailSlurpClient
675
675
  # @param [Hash] opts the optional parameters
676
676
  # @option opts [Array<String>] :inbox_id Optional inbox ids to filter by. Can be repeated. By default will use all inboxes belonging to your account.
677
677
  # @option opts [Integer] :page Optional page index in email list pagination (default to 0)
678
- # @option opts [Integer] :size Optional page size in email list pagination (default to 20)
678
+ # @option opts [Integer] :size Optional page size in email list pagination. Maximum size is 100. Use page index and sort to page through larger results (default to 20)
679
679
  # @option opts [String] :sort Optional createdAt sort direction ASC or DESC (default to 'ASC')
680
680
  # @option opts [Boolean] :unread_only Optional filter for unread emails only. All emails are considered unread until they are viewed in the dashboard or requested directly (default to false)
681
681
  # @return [PageEmailProjection]
@@ -689,7 +689,7 @@ module MailSlurpClient
689
689
  # @param [Hash] opts the optional parameters
690
690
  # @option opts [Array<String>] :inbox_id Optional inbox ids to filter by. Can be repeated. By default will use all inboxes belonging to your account.
691
691
  # @option opts [Integer] :page Optional page index in email list pagination
692
- # @option opts [Integer] :size Optional page size in email list pagination
692
+ # @option opts [Integer] :size Optional page size in email list pagination. Maximum size is 100. Use page index and sort to page through larger results
693
693
  # @option opts [String] :sort Optional createdAt sort direction ASC or DESC
694
694
  # @option opts [Boolean] :unread_only Optional filter for unread emails only. All emails are considered unread until they are viewed in the dashboard or requested directly
695
695
  # @return [Array<(PageEmailProjection, Integer, Hash)>] PageEmailProjection data, response status code and response headers
@@ -207,8 +207,8 @@ module MailSlurpClient
207
207
  return data, status_code, headers
208
208
  end
209
209
 
210
- # List Inboxes Paginated
211
- # List inboxes in paginated form. Allows for page index, page size, and sort direction. Can also filter by favourited or email address like pattern.
210
+ # List All Inboxes Paginated
211
+ # 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
212
  # @param [Hash] opts the optional parameters
213
213
  # @option opts [Boolean] :favourite Optionally filter results for favourites only (default to false)
214
214
  # @option opts [Integer] :page Optional page index in inbox list pagination (default to 0)
@@ -222,8 +222,8 @@ module MailSlurpClient
222
222
  data
223
223
  end
224
224
 
225
- # List Inboxes Paginated
226
- # List inboxes in paginated form. Allows for page index, page size, and sort direction. Can also filter by favourited or email address like pattern.
225
+ # List All Inboxes Paginated
226
+ # List inboxes in paginated form. The results are available on the &#x60;content&#x60; 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 &#x60;getInboxes&#x60; method returns a full list of inboxes but is limited to 100 results.
227
227
  # @param [Hash] opts the optional parameters
228
228
  # @option opts [Boolean] :favourite Optionally filter results for favourites only
229
229
  # @option opts [Integer] :page Optional page index in inbox list pagination
@@ -285,14 +285,15 @@ module MailSlurpClient
285
285
  return data, status_code, headers
286
286
  end
287
287
 
288
- # Get emails in an Inbox
288
+ # 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
289
  # 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
290
  # @param inbox_id [String] Id of inbox that emails belongs to
291
291
  # @param [Hash] opts the optional parameters
292
- # @option opts [Integer] :limit Limit the result set, ordered by received date time sort direction
292
+ # @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
293
  # @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
294
  # @option opts [Integer] :retry_timeout Maximum milliseconds to spend retrying inbox database until minCount emails are returned
295
295
  # @option opts [DateTime] :since Exclude emails received before this ISO 8601 date time
296
+ # @option opts [Integer] :size Alias for limit. Assessed first before assessing any passed limit.
296
297
  # @option opts [String] :sort Sort the results by received date and direction ASC or DESC
297
298
  # @return [Array<EmailPreview>]
298
299
  def get_emails(inbox_id, opts = {})
@@ -300,14 +301,15 @@ module MailSlurpClient
300
301
  data
301
302
  end
302
303
 
303
- # Get emails in an Inbox
304
+ # 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
305
  # List emails that an inbox has received. Only emails that are sent to the inbox&#39;s email address will appear in the inbox. It may take several seconds for any email you send to an inbox&#39;s email address to appear in the inbox. To make this endpoint wait for a minimum number of emails use the &#x60;minCount&#x60; parameter. The server will retry the inbox database until the &#x60;minCount&#x60; is satisfied or the &#x60;retryTimeout&#x60; is reached
305
306
  # @param inbox_id [String] Id of inbox that emails belongs to
306
307
  # @param [Hash] opts the optional parameters
307
- # @option opts [Integer] :limit Limit the result set, ordered by received date time sort direction
308
+ # @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
309
  # @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
310
  # @option opts [Integer] :retry_timeout Maximum milliseconds to spend retrying inbox database until minCount emails are returned
310
311
  # @option opts [DateTime] :since Exclude emails received before this ISO 8601 date time
312
+ # @option opts [Integer] :size Alias for limit. Assessed first before assessing any passed limit.
311
313
  # @option opts [String] :sort Sort the results by received date and direction ASC or DESC
312
314
  # @return [Array<(Array<EmailPreview>, Integer, Hash)>] Array<EmailPreview> data, response status code and response headers
313
315
  def get_emails_with_http_info(inbox_id, opts = {})
@@ -331,6 +333,7 @@ module MailSlurpClient
331
333
  query_params[:'minCount'] = opts[:'min_count'] if !opts[:'min_count'].nil?
332
334
  query_params[:'retryTimeout'] = opts[:'retry_timeout'] if !opts[:'retry_timeout'].nil?
333
335
  query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil?
336
+ query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
334
337
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
335
338
 
336
339
  # header parameters
@@ -635,8 +638,10 @@ module MailSlurpClient
635
638
  end
636
639
 
637
640
  # List Inboxes / Email Addresses
638
- # List the inboxes you have created
641
+ # List the inboxes you have created. Note use of the more advanced `getAllEmails` is recommended. You can provide a limit and sort parameter.
639
642
  # @param [Hash] opts the optional parameters
643
+ # @option opts [Integer] :size Optional result size limit. Note an automatic limit of 100 results is applied. See the paginated &#x60;getAllEmails&#x60; for larger queries. (default to 100)
644
+ # @option opts [String] :sort Optional createdAt sort direction ASC or DESC (default to 'ASC')
640
645
  # @return [Array<Inbox>]
641
646
  def get_inboxes(opts = {})
642
647
  data, _status_code, _headers = get_inboxes_with_http_info(opts)
@@ -644,18 +649,26 @@ module MailSlurpClient
644
649
  end
645
650
 
646
651
  # List Inboxes / Email Addresses
647
- # List the inboxes you have created
652
+ # List the inboxes you have created. Note use of the more advanced &#x60;getAllEmails&#x60; is recommended. You can provide a limit and sort parameter.
648
653
  # @param [Hash] opts the optional parameters
654
+ # @option opts [Integer] :size Optional result size limit. Note an automatic limit of 100 results is applied. See the paginated &#x60;getAllEmails&#x60; for larger queries.
655
+ # @option opts [String] :sort Optional createdAt sort direction ASC or DESC
649
656
  # @return [Array<(Array<Inbox>, Integer, Hash)>] Array<Inbox> data, response status code and response headers
650
657
  def get_inboxes_with_http_info(opts = {})
651
658
  if @api_client.config.debugging
652
659
  @api_client.config.logger.debug 'Calling API: InboxControllerApi.get_inboxes ...'
653
660
  end
661
+ allowable_values = ["ASC", "DESC"]
662
+ if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
663
+ fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
664
+ end
654
665
  # resource path
655
666
  local_var_path = '/inboxes'
656
667
 
657
668
  # query parameters
658
669
  query_params = opts[:query_params] || {}
670
+ query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
671
+ query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
659
672
 
660
673
  # header parameters
661
674
  header_params = opts[:header_params] || {}
@@ -759,7 +772,7 @@ module MailSlurpClient
759
772
  # @param inbox_id [String] ID of the inbox you want to send the email from
760
773
  # @param [Hash] opts the optional parameters
761
774
  # @option opts [SendEmailOptions] :send_email_options Options for the email
762
- # @return [SentEmail]
775
+ # @return [SentEmailDto]
763
776
  def send_email_and_confirm(inbox_id, opts = {})
764
777
  data, _status_code, _headers = send_email_and_confirm_with_http_info(inbox_id, opts)
765
778
  data
@@ -770,7 +783,7 @@ module MailSlurpClient
770
783
  # @param inbox_id [String] ID of the inbox you want to send the email from
771
784
  # @param [Hash] opts the optional parameters
772
785
  # @option opts [SendEmailOptions] :send_email_options Options for the email
773
- # @return [Array<(SentEmail, Integer, Hash)>] SentEmail data, response status code and response headers
786
+ # @return [Array<(SentEmailDto, Integer, Hash)>] SentEmailDto data, response status code and response headers
774
787
  def send_email_and_confirm_with_http_info(inbox_id, opts = {})
775
788
  if @api_client.config.debugging
776
789
  @api_client.config.logger.debug 'Calling API: InboxControllerApi.send_email_and_confirm ...'
@@ -799,7 +812,7 @@ module MailSlurpClient
799
812
  post_body = opts[:body] || @api_client.object_to_http_body(opts[:'send_email_options'])
800
813
 
801
814
  # return_type
802
- return_type = opts[:return_type] || 'SentEmail'
815
+ return_type = opts[:return_type] || 'SentEmailDto'
803
816
 
804
817
  # auth_names
805
818
  auth_names = opts[:auth_names] || ['API_KEY']
@@ -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
@@ -213,7 +213,7 @@ module MailSlurpClient
213
213
  end
214
214
 
215
215
  # Wait or return list of emails that match simple matching patterns
216
- # Perform a search of emails in an inbox with the given patterns. If results match expected count then return or else retry the search until results are found or timeout is reached. Match options allow simple CONTAINS or EQUALS filtering on SUBJECT, TO, BCC, CC, and FROM. See the `MatchOptions` object for options.
216
+ # Perform a search of emails in an inbox with the given patterns. If results match expected count then return or else retry the search until results are found or timeout is reached. Match options allow simple CONTAINS or EQUALS filtering on SUBJECT, TO, BCC, CC, and FROM. See the `MatchOptions` object for options. An example payload is `{ matches: [{field: 'SUBJECT',should:'CONTAIN',value:'needle'}] }`. You can use an array of matches and they will be applied sequentially to filter out emails. If you want to perform matches and extractions of content using Regex patterns see the EmailController `getEmailContentMatch` method.
217
217
  # @param match_options [MatchOptions] matchOptions
218
218
  # @param [Hash] opts the optional parameters
219
219
  # @option opts [Integer] :count Number of emails to wait for. Must be greater that 1
@@ -227,7 +227,7 @@ module MailSlurpClient
227
227
  end
228
228
 
229
229
  # Wait or return list of emails that match simple matching patterns
230
- # Perform a search of emails in an inbox with the given patterns. If results match expected count then return or else retry the search until results are found or timeout is reached. Match options allow simple CONTAINS or EQUALS filtering on SUBJECT, TO, BCC, CC, and FROM. See the &#x60;MatchOptions&#x60; object for options.
230
+ # Perform a search of emails in an inbox with the given patterns. If results match expected count then return or else retry the search until results are found or timeout is reached. Match options allow simple CONTAINS or EQUALS filtering on SUBJECT, TO, BCC, CC, and FROM. See the &#x60;MatchOptions&#x60; object for options. An example payload is &#x60;{ matches: [{field: &#39;SUBJECT&#39;,should:&#39;CONTAIN&#39;,value:&#39;needle&#39;}] }&#x60;. You can use an array of matches and they will be applied sequentially to filter out emails. If you want to perform matches and extractions of content using Regex patterns see the EmailController &#x60;getEmailContentMatch&#x60; method.
231
231
  # @param match_options [MatchOptions] matchOptions
232
232
  # @param [Hash] opts the optional parameters
233
233
  # @option opts [Integer] :count Number of emails to wait for. Must be greater that 1
@@ -0,0 +1,252 @@
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
+ # Options for DNS query.
17
+ class DNSLookupOptions
18
+ # List of record types you wish to query such as MX, DNS, TXT, NS, A etc.
19
+ attr_accessor :hostname
20
+
21
+ # Optionally control whether to omit the final dot in full DNS name values.
22
+ attr_accessor :omit_final_dns_dot
23
+
24
+ # List of record types you wish to query such as MX, DNS, TXT, NS, A etc.
25
+ attr_accessor :record_types
26
+
27
+ class EnumAttributeValidator
28
+ attr_reader :datatype
29
+ attr_reader :allowable_values
30
+
31
+ def initialize(datatype, allowable_values)
32
+ @allowable_values = allowable_values.map do |value|
33
+ case datatype.to_s
34
+ when /Integer/i
35
+ value.to_i
36
+ when /Float/i
37
+ value.to_f
38
+ else
39
+ value
40
+ end
41
+ end
42
+ end
43
+
44
+ def valid?(value)
45
+ !value || allowable_values.include?(value)
46
+ end
47
+ end
48
+
49
+ # Attribute mapping from ruby-style variable name to JSON key.
50
+ def self.attribute_map
51
+ {
52
+ :'hostname' => :'hostname',
53
+ :'omit_final_dns_dot' => :'omitFinalDNSDot',
54
+ :'record_types' => :'recordTypes'
55
+ }
56
+ end
57
+
58
+ # Attribute type mapping.
59
+ def self.openapi_types
60
+ {
61
+ :'hostname' => :'String',
62
+ :'omit_final_dns_dot' => :'Boolean',
63
+ :'record_types' => :'Array<String>'
64
+ }
65
+ end
66
+
67
+ # List of attributes with nullable: true
68
+ def self.openapi_nullable
69
+ Set.new([
70
+ ])
71
+ end
72
+
73
+ # Initializes the object
74
+ # @param [Hash] attributes Model attributes in the form of hash
75
+ def initialize(attributes = {})
76
+ if (!attributes.is_a?(Hash))
77
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::DNSLookupOptions` initialize method"
78
+ end
79
+
80
+ # check to see if the attribute exists and convert string to symbol for hash key
81
+ attributes = attributes.each_with_object({}) { |(k, v), h|
82
+ if (!self.class.attribute_map.key?(k.to_sym))
83
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::DNSLookupOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
84
+ end
85
+ h[k.to_sym] = v
86
+ }
87
+
88
+ if attributes.key?(:'hostname')
89
+ self.hostname = attributes[:'hostname']
90
+ end
91
+
92
+ if attributes.key?(:'omit_final_dns_dot')
93
+ self.omit_final_dns_dot = attributes[:'omit_final_dns_dot']
94
+ end
95
+
96
+ if attributes.key?(:'record_types')
97
+ if (value = attributes[:'record_types']).is_a?(Array)
98
+ self.record_types = value
99
+ end
100
+ end
101
+ end
102
+
103
+ # Show invalid properties with the reasons. Usually used together with valid?
104
+ # @return Array for valid properties with the reasons
105
+ def list_invalid_properties
106
+ invalid_properties = Array.new
107
+ invalid_properties
108
+ end
109
+
110
+ # Check to see if the all the properties in the model are valid
111
+ # @return true if the model is valid
112
+ def valid?
113
+ true
114
+ end
115
+
116
+ # Checks equality by comparing each attribute.
117
+ # @param [Object] Object to be compared
118
+ def ==(o)
119
+ return true if self.equal?(o)
120
+ self.class == o.class &&
121
+ hostname == o.hostname &&
122
+ omit_final_dns_dot == o.omit_final_dns_dot &&
123
+ record_types == o.record_types
124
+ end
125
+
126
+ # @see the `==` method
127
+ # @param [Object] Object to be compared
128
+ def eql?(o)
129
+ self == o
130
+ end
131
+
132
+ # Calculates hash code according to all attributes.
133
+ # @return [Integer] Hash code
134
+ def hash
135
+ [hostname, omit_final_dns_dot, record_types].hash
136
+ end
137
+
138
+ # Builds the object from hash
139
+ # @param [Hash] attributes Model attributes in the form of hash
140
+ # @return [Object] Returns the model itself
141
+ def self.build_from_hash(attributes)
142
+ new.build_from_hash(attributes)
143
+ end
144
+
145
+ # Builds the object from hash
146
+ # @param [Hash] attributes Model attributes in the form of hash
147
+ # @return [Object] Returns the model itself
148
+ def build_from_hash(attributes)
149
+ return nil unless attributes.is_a?(Hash)
150
+ self.class.openapi_types.each_pair do |key, type|
151
+ if type =~ /\AArray<(.*)>/i
152
+ # check to ensure the input is an array given that the attribute
153
+ # is documented as an array but the input is not
154
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
155
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
156
+ end
157
+ elsif !attributes[self.class.attribute_map[key]].nil?
158
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
159
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
160
+ end
161
+
162
+ self
163
+ end
164
+
165
+ # Deserializes the data based on type
166
+ # @param string type Data type
167
+ # @param string value Value to be deserialized
168
+ # @return [Object] Deserialized data
169
+ def _deserialize(type, value)
170
+ case type.to_sym
171
+ when :DateTime
172
+ DateTime.parse(value)
173
+ when :Date
174
+ Date.parse(value)
175
+ when :String
176
+ value.to_s
177
+ when :Integer
178
+ value.to_i
179
+ when :Float
180
+ value.to_f
181
+ when :Boolean
182
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
183
+ true
184
+ else
185
+ false
186
+ end
187
+ when :Object
188
+ # generic object (usually a Hash), return directly
189
+ value
190
+ when /\AArray<(?<inner_type>.+)>\z/
191
+ inner_type = Regexp.last_match[:inner_type]
192
+ value.map { |v| _deserialize(inner_type, v) }
193
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
194
+ k_type = Regexp.last_match[:k_type]
195
+ v_type = Regexp.last_match[:v_type]
196
+ {}.tap do |hash|
197
+ value.each do |k, v|
198
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
199
+ end
200
+ end
201
+ else # model
202
+ MailSlurpClient.const_get(type).build_from_hash(value)
203
+ end
204
+ end
205
+
206
+ # Returns the string representation of the object
207
+ # @return [String] String presentation of the object
208
+ def to_s
209
+ to_hash.to_s
210
+ end
211
+
212
+ # to_body is an alias to to_hash (backward compatibility)
213
+ # @return [Hash] Returns the object in the form of hash
214
+ def to_body
215
+ to_hash
216
+ end
217
+
218
+ # Returns the object in the form of hash
219
+ # @return [Hash] Returns the object in the form of hash
220
+ def to_hash
221
+ hash = {}
222
+ self.class.attribute_map.each_pair do |attr, param|
223
+ value = self.send(attr)
224
+ if value.nil?
225
+ is_nullable = self.class.openapi_nullable.include?(attr)
226
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
227
+ end
228
+
229
+ hash[param] = _to_hash(value)
230
+ end
231
+ hash
232
+ end
233
+
234
+ # Outputs non-array value in the form of hash
235
+ # For object, use to_hash. Otherwise, just return the value
236
+ # @param [Object] value Any valid value
237
+ # @return [Hash] Returns the value in the form of hash
238
+ def _to_hash(value)
239
+ if value.is_a?(Array)
240
+ value.compact.map { |v| _to_hash(v) }
241
+ elsif value.is_a?(Hash)
242
+ {}.tap do |hash|
243
+ value.each { |k, v| hash[k] = _to_hash(v) }
244
+ end
245
+ elsif value.respond_to? :to_hash
246
+ value.to_hash
247
+ else
248
+ value
249
+ end
250
+ end
251
+ end
252
+ end