mailslurp_client 11.0.1 → 11.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mailslurp_client.rb +4 -0
- data/lib/mailslurp_client/api/domain_controller_api.rb +132 -0
- data/lib/mailslurp_client/api/email_controller_api.rb +251 -0
- data/lib/mailslurp_client/api/expired_controller_api.rb +271 -0
- data/lib/mailslurp_client/api/inbox_controller_api.rb +0 -193
- data/lib/mailslurp_client/models/create_domain_options.rb +23 -3
- data/lib/mailslurp_client/models/domain_dto.rb +11 -1
- data/lib/mailslurp_client/models/domain_preview.rb +10 -1
- data/lib/mailslurp_client/models/email_text_lines_result.rb +228 -0
- data/lib/mailslurp_client/models/expiration_defaults.rb +239 -0
- data/lib/mailslurp_client/models/send_email_options.rb +1 -1
- data/lib/mailslurp_client/models/update_domain_options.rb +207 -0
- data/lib/mailslurp_client/version.rb +1 -1
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 10cc58251bee14c4424c902198e830426de6c7e49416905422a88fe2e714cac7
|
4
|
+
data.tar.gz: 7cc293b665e4bd7b99c337b34efb804e7052f74d1b313a0806b2c47750a2dac0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ec1bb2436b467c2f66cefd0028856760e7a8ee26ffdb996174e2dc15b63e542cc6dee5176017fee1ac32d8a69ae2befad18ddee859d04b80ecf7cbf6f328169c
|
7
|
+
data.tar.gz: 991fca383a0b088d52b48de9af8cdeedd3fde3d0674feaa24b19096eb9539bd5a2895cb38de535e66a4d174c0319a59b0efc4e2b7a62f044ede5a5ba805ce4fc
|
data/lib/mailslurp_client.rb
CHANGED
@@ -46,7 +46,9 @@ require 'mailslurp_client/models/email_analysis'
|
|
46
46
|
require 'mailslurp_client/models/email_content_match_result'
|
47
47
|
require 'mailslurp_client/models/email_preview'
|
48
48
|
require 'mailslurp_client/models/email_projection'
|
49
|
+
require 'mailslurp_client/models/email_text_lines_result'
|
49
50
|
require 'mailslurp_client/models/email_verification_result'
|
51
|
+
require 'mailslurp_client/models/expiration_defaults'
|
50
52
|
require 'mailslurp_client/models/expired_inbox_dto'
|
51
53
|
require 'mailslurp_client/models/expired_inbox_record_projection'
|
52
54
|
require 'mailslurp_client/models/forward_email_options'
|
@@ -88,6 +90,7 @@ require 'mailslurp_client/models/template_variable'
|
|
88
90
|
require 'mailslurp_client/models/thread_projection'
|
89
91
|
require 'mailslurp_client/models/unread_count'
|
90
92
|
require 'mailslurp_client/models/update_alias_options'
|
93
|
+
require 'mailslurp_client/models/update_domain_options'
|
91
94
|
require 'mailslurp_client/models/update_group_contacts'
|
92
95
|
require 'mailslurp_client/models/update_inbox_options'
|
93
96
|
require 'mailslurp_client/models/upload_attachment_options'
|
@@ -109,6 +112,7 @@ require 'mailslurp_client/api/common_actions_controller_api'
|
|
109
112
|
require 'mailslurp_client/api/contact_controller_api'
|
110
113
|
require 'mailslurp_client/api/domain_controller_api'
|
111
114
|
require 'mailslurp_client/api/email_controller_api'
|
115
|
+
require 'mailslurp_client/api/expired_controller_api'
|
112
116
|
require 'mailslurp_client/api/form_controller_api'
|
113
117
|
require 'mailslurp_client/api/group_controller_api'
|
114
118
|
require 'mailslurp_client/api/inbox_controller_api'
|
@@ -19,6 +19,68 @@ module MailSlurpClient
|
|
19
19
|
def initialize(api_client = ApiClient.default)
|
20
20
|
@api_client = api_client
|
21
21
|
end
|
22
|
+
# Add catch all wild card inbox to domain
|
23
|
+
# Add a catch all inbox to a domain so that any emails sent to it that cannot be matched will be sent to the catch all inbox generated
|
24
|
+
# @param id [String] id
|
25
|
+
# @param [Hash] opts the optional parameters
|
26
|
+
# @return [DomainDto]
|
27
|
+
def add_domain_wildcard_catch_all(id, opts = {})
|
28
|
+
data, _status_code, _headers = add_domain_wildcard_catch_all_with_http_info(id, opts)
|
29
|
+
data
|
30
|
+
end
|
31
|
+
|
32
|
+
# Add catch all wild card inbox to domain
|
33
|
+
# Add a catch all inbox to a domain so that any emails sent to it that cannot be matched will be sent to the catch all inbox generated
|
34
|
+
# @param id [String] id
|
35
|
+
# @param [Hash] opts the optional parameters
|
36
|
+
# @return [Array<(DomainDto, Integer, Hash)>] DomainDto data, response status code and response headers
|
37
|
+
def add_domain_wildcard_catch_all_with_http_info(id, opts = {})
|
38
|
+
if @api_client.config.debugging
|
39
|
+
@api_client.config.logger.debug 'Calling API: DomainControllerApi.add_domain_wildcard_catch_all ...'
|
40
|
+
end
|
41
|
+
# verify the required parameter 'id' is set
|
42
|
+
if @api_client.config.client_side_validation && id.nil?
|
43
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling DomainControllerApi.add_domain_wildcard_catch_all"
|
44
|
+
end
|
45
|
+
# resource path
|
46
|
+
local_var_path = '/domains/{id}/wildcard'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
47
|
+
|
48
|
+
# query parameters
|
49
|
+
query_params = opts[:query_params] || {}
|
50
|
+
|
51
|
+
# header parameters
|
52
|
+
header_params = opts[:header_params] || {}
|
53
|
+
# HTTP header 'Accept' (if needed)
|
54
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
55
|
+
|
56
|
+
# form parameters
|
57
|
+
form_params = opts[:form_params] || {}
|
58
|
+
|
59
|
+
# http body (model)
|
60
|
+
post_body = opts[:body]
|
61
|
+
|
62
|
+
# return_type
|
63
|
+
return_type = opts[:return_type] || 'DomainDto'
|
64
|
+
|
65
|
+
# auth_names
|
66
|
+
auth_names = opts[:auth_names] || ['API_KEY']
|
67
|
+
|
68
|
+
new_options = opts.merge(
|
69
|
+
:header_params => header_params,
|
70
|
+
:query_params => query_params,
|
71
|
+
:form_params => form_params,
|
72
|
+
:body => post_body,
|
73
|
+
:auth_names => auth_names,
|
74
|
+
:return_type => return_type
|
75
|
+
)
|
76
|
+
|
77
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
78
|
+
if @api_client.config.debugging
|
79
|
+
@api_client.config.logger.debug "API called: DomainControllerApi#add_domain_wildcard_catch_all\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
80
|
+
end
|
81
|
+
return data, status_code, headers
|
82
|
+
end
|
83
|
+
|
22
84
|
# Create Domain
|
23
85
|
# Link a domain that you own with MailSlurp so you can create email addresses using it. Endpoint returns DNS records used for validation. You must add these verification records to your host provider's DNS setup to verify the domain.
|
24
86
|
# @param domain_options [CreateDomainOptions] domainOptions
|
@@ -262,5 +324,75 @@ module MailSlurpClient
|
|
262
324
|
end
|
263
325
|
return data, status_code, headers
|
264
326
|
end
|
327
|
+
|
328
|
+
# Update a domain
|
329
|
+
# Update values on a domain. Note you cannot change the domain name as it is immutable. Recreate the domain if you need to alter this.
|
330
|
+
# @param id [String] id
|
331
|
+
# @param update_domain_dto [UpdateDomainOptions] updateDomainDto
|
332
|
+
# @param [Hash] opts the optional parameters
|
333
|
+
# @return [DomainDto]
|
334
|
+
def update_domain(id, update_domain_dto, opts = {})
|
335
|
+
data, _status_code, _headers = update_domain_with_http_info(id, update_domain_dto, opts)
|
336
|
+
data
|
337
|
+
end
|
338
|
+
|
339
|
+
# Update a domain
|
340
|
+
# Update values on a domain. Note you cannot change the domain name as it is immutable. Recreate the domain if you need to alter this.
|
341
|
+
# @param id [String] id
|
342
|
+
# @param update_domain_dto [UpdateDomainOptions] updateDomainDto
|
343
|
+
# @param [Hash] opts the optional parameters
|
344
|
+
# @return [Array<(DomainDto, Integer, Hash)>] DomainDto data, response status code and response headers
|
345
|
+
def update_domain_with_http_info(id, update_domain_dto, opts = {})
|
346
|
+
if @api_client.config.debugging
|
347
|
+
@api_client.config.logger.debug 'Calling API: DomainControllerApi.update_domain ...'
|
348
|
+
end
|
349
|
+
# verify the required parameter 'id' is set
|
350
|
+
if @api_client.config.client_side_validation && id.nil?
|
351
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling DomainControllerApi.update_domain"
|
352
|
+
end
|
353
|
+
# verify the required parameter 'update_domain_dto' is set
|
354
|
+
if @api_client.config.client_side_validation && update_domain_dto.nil?
|
355
|
+
fail ArgumentError, "Missing the required parameter 'update_domain_dto' when calling DomainControllerApi.update_domain"
|
356
|
+
end
|
357
|
+
# resource path
|
358
|
+
local_var_path = '/domains/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
359
|
+
|
360
|
+
# query parameters
|
361
|
+
query_params = opts[:query_params] || {}
|
362
|
+
|
363
|
+
# header parameters
|
364
|
+
header_params = opts[:header_params] || {}
|
365
|
+
# HTTP header 'Accept' (if needed)
|
366
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
367
|
+
# HTTP header 'Content-Type'
|
368
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
369
|
+
|
370
|
+
# form parameters
|
371
|
+
form_params = opts[:form_params] || {}
|
372
|
+
|
373
|
+
# http body (model)
|
374
|
+
post_body = opts[:body] || @api_client.object_to_http_body(update_domain_dto)
|
375
|
+
|
376
|
+
# return_type
|
377
|
+
return_type = opts[:return_type] || 'DomainDto'
|
378
|
+
|
379
|
+
# auth_names
|
380
|
+
auth_names = opts[:auth_names] || ['API_KEY']
|
381
|
+
|
382
|
+
new_options = opts.merge(
|
383
|
+
:header_params => header_params,
|
384
|
+
:query_params => query_params,
|
385
|
+
:form_params => form_params,
|
386
|
+
:body => post_body,
|
387
|
+
:auth_names => auth_names,
|
388
|
+
:return_type => return_type
|
389
|
+
)
|
390
|
+
|
391
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
392
|
+
if @api_client.config.debugging
|
393
|
+
@api_client.config.logger.debug "API called: DomainControllerApi#update_domain\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
394
|
+
end
|
395
|
+
return data, status_code, headers
|
396
|
+
end
|
265
397
|
end
|
266
398
|
end
|
@@ -670,6 +670,139 @@ module MailSlurpClient
|
|
670
670
|
return data, status_code, headers
|
671
671
|
end
|
672
672
|
|
673
|
+
# Parse and return text from an email, stripping HTML and decoding encoded characters
|
674
|
+
# Parse an email body and return the content as an array of text. HTML parsing uses JSoup which supports JQuery/CSS style selectors
|
675
|
+
# @param email_id [String] ID of email to perform HTML query on
|
676
|
+
# @param [Hash] opts the optional parameters
|
677
|
+
# @option opts [String] :html_selector HTML selector to search for. Uses JQuery/JSoup/CSS style selector like '.my-div' to match content. See https://jsoup.org/apidocs/org/jsoup/select/Selector.html for more information.
|
678
|
+
# @return [EmailTextLinesResult]
|
679
|
+
def get_email_html_query(email_id, opts = {})
|
680
|
+
data, _status_code, _headers = get_email_html_query_with_http_info(email_id, opts)
|
681
|
+
data
|
682
|
+
end
|
683
|
+
|
684
|
+
# Parse and return text from an email, stripping HTML and decoding encoded characters
|
685
|
+
# Parse an email body and return the content as an array of text. HTML parsing uses JSoup which supports JQuery/CSS style selectors
|
686
|
+
# @param email_id [String] ID of email to perform HTML query on
|
687
|
+
# @param [Hash] opts the optional parameters
|
688
|
+
# @option opts [String] :html_selector HTML selector to search for. Uses JQuery/JSoup/CSS style selector like '.my-div' to match content. See https://jsoup.org/apidocs/org/jsoup/select/Selector.html for more information.
|
689
|
+
# @return [Array<(EmailTextLinesResult, Integer, Hash)>] EmailTextLinesResult data, response status code and response headers
|
690
|
+
def get_email_html_query_with_http_info(email_id, opts = {})
|
691
|
+
if @api_client.config.debugging
|
692
|
+
@api_client.config.logger.debug 'Calling API: EmailControllerApi.get_email_html_query ...'
|
693
|
+
end
|
694
|
+
# verify the required parameter 'email_id' is set
|
695
|
+
if @api_client.config.client_side_validation && email_id.nil?
|
696
|
+
fail ArgumentError, "Missing the required parameter 'email_id' when calling EmailControllerApi.get_email_html_query"
|
697
|
+
end
|
698
|
+
# resource path
|
699
|
+
local_var_path = '/emails/{emailId}/htmlQuery'.sub('{' + 'emailId' + '}', CGI.escape(email_id.to_s))
|
700
|
+
|
701
|
+
# query parameters
|
702
|
+
query_params = opts[:query_params] || {}
|
703
|
+
query_params[:'htmlSelector'] = opts[:'html_selector'] if !opts[:'html_selector'].nil?
|
704
|
+
|
705
|
+
# header parameters
|
706
|
+
header_params = opts[:header_params] || {}
|
707
|
+
# HTTP header 'Accept' (if needed)
|
708
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
709
|
+
|
710
|
+
# form parameters
|
711
|
+
form_params = opts[:form_params] || {}
|
712
|
+
|
713
|
+
# http body (model)
|
714
|
+
post_body = opts[:body]
|
715
|
+
|
716
|
+
# return_type
|
717
|
+
return_type = opts[:return_type] || 'EmailTextLinesResult'
|
718
|
+
|
719
|
+
# auth_names
|
720
|
+
auth_names = opts[:auth_names] || ['API_KEY']
|
721
|
+
|
722
|
+
new_options = opts.merge(
|
723
|
+
:header_params => header_params,
|
724
|
+
:query_params => query_params,
|
725
|
+
:form_params => form_params,
|
726
|
+
:body => post_body,
|
727
|
+
:auth_names => auth_names,
|
728
|
+
:return_type => return_type
|
729
|
+
)
|
730
|
+
|
731
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
732
|
+
if @api_client.config.debugging
|
733
|
+
@api_client.config.logger.debug "API called: EmailControllerApi#get_email_html_query\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
734
|
+
end
|
735
|
+
return data, status_code, headers
|
736
|
+
end
|
737
|
+
|
738
|
+
# Parse and return text from an email, stripping HTML and decoding encoded characters
|
739
|
+
# Parse an email body and return the content as an array of strings. HTML parsing uses JSoup and UNIX line separators.
|
740
|
+
# @param email_id [String] ID of email to fetch text for
|
741
|
+
# @param [Hash] opts the optional parameters
|
742
|
+
# @option opts [Boolean] :decode_html_entities Decode HTML entities
|
743
|
+
# @option opts [String] :line_separator Line separator character
|
744
|
+
# @return [EmailTextLinesResult]
|
745
|
+
def get_email_text_lines(email_id, opts = {})
|
746
|
+
data, _status_code, _headers = get_email_text_lines_with_http_info(email_id, opts)
|
747
|
+
data
|
748
|
+
end
|
749
|
+
|
750
|
+
# Parse and return text from an email, stripping HTML and decoding encoded characters
|
751
|
+
# Parse an email body and return the content as an array of strings. HTML parsing uses JSoup and UNIX line separators.
|
752
|
+
# @param email_id [String] ID of email to fetch text for
|
753
|
+
# @param [Hash] opts the optional parameters
|
754
|
+
# @option opts [Boolean] :decode_html_entities Decode HTML entities
|
755
|
+
# @option opts [String] :line_separator Line separator character
|
756
|
+
# @return [Array<(EmailTextLinesResult, Integer, Hash)>] EmailTextLinesResult data, response status code and response headers
|
757
|
+
def get_email_text_lines_with_http_info(email_id, opts = {})
|
758
|
+
if @api_client.config.debugging
|
759
|
+
@api_client.config.logger.debug 'Calling API: EmailControllerApi.get_email_text_lines ...'
|
760
|
+
end
|
761
|
+
# verify the required parameter 'email_id' is set
|
762
|
+
if @api_client.config.client_side_validation && email_id.nil?
|
763
|
+
fail ArgumentError, "Missing the required parameter 'email_id' when calling EmailControllerApi.get_email_text_lines"
|
764
|
+
end
|
765
|
+
# resource path
|
766
|
+
local_var_path = '/emails/{emailId}/textLines'.sub('{' + 'emailId' + '}', CGI.escape(email_id.to_s))
|
767
|
+
|
768
|
+
# query parameters
|
769
|
+
query_params = opts[:query_params] || {}
|
770
|
+
query_params[:'decodeHtmlEntities'] = opts[:'decode_html_entities'] if !opts[:'decode_html_entities'].nil?
|
771
|
+
query_params[:'lineSeparator'] = opts[:'line_separator'] if !opts[:'line_separator'].nil?
|
772
|
+
|
773
|
+
# header parameters
|
774
|
+
header_params = opts[:header_params] || {}
|
775
|
+
# HTTP header 'Accept' (if needed)
|
776
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
777
|
+
|
778
|
+
# form parameters
|
779
|
+
form_params = opts[:form_params] || {}
|
780
|
+
|
781
|
+
# http body (model)
|
782
|
+
post_body = opts[:body]
|
783
|
+
|
784
|
+
# return_type
|
785
|
+
return_type = opts[:return_type] || 'EmailTextLinesResult'
|
786
|
+
|
787
|
+
# auth_names
|
788
|
+
auth_names = opts[:auth_names] || ['API_KEY']
|
789
|
+
|
790
|
+
new_options = opts.merge(
|
791
|
+
:header_params => header_params,
|
792
|
+
:query_params => query_params,
|
793
|
+
:form_params => form_params,
|
794
|
+
:body => post_body,
|
795
|
+
:auth_names => auth_names,
|
796
|
+
:return_type => return_type
|
797
|
+
)
|
798
|
+
|
799
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
800
|
+
if @api_client.config.debugging
|
801
|
+
@api_client.config.logger.debug "API called: EmailControllerApi#get_email_text_lines\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
802
|
+
end
|
803
|
+
return data, status_code, headers
|
804
|
+
end
|
805
|
+
|
673
806
|
# Get all emails
|
674
807
|
# By default returns all emails across all inboxes sorted by ascending created at date. Responses are paginated. You can restrict results to a list of inbox IDs. You can also filter out read messages
|
675
808
|
# @param [Hash] opts the optional parameters
|
@@ -745,6 +878,124 @@ module MailSlurpClient
|
|
745
878
|
return data, status_code, headers
|
746
879
|
end
|
747
880
|
|
881
|
+
# Get latest email
|
882
|
+
# Get the newest email in all inboxes or in a passed set of inbox IDs
|
883
|
+
# @param [Hash] opts the optional parameters
|
884
|
+
# @option opts [Array<String>] :inbox_ids Optional set of inboxes to filter by. Only get the latest email from these inbox IDs
|
885
|
+
# @return [Email]
|
886
|
+
def get_latest_email(opts = {})
|
887
|
+
data, _status_code, _headers = get_latest_email_with_http_info(opts)
|
888
|
+
data
|
889
|
+
end
|
890
|
+
|
891
|
+
# Get latest email
|
892
|
+
# Get the newest email in all inboxes or in a passed set of inbox IDs
|
893
|
+
# @param [Hash] opts the optional parameters
|
894
|
+
# @option opts [Array<String>] :inbox_ids Optional set of inboxes to filter by. Only get the latest email from these inbox IDs
|
895
|
+
# @return [Array<(Email, Integer, Hash)>] Email data, response status code and response headers
|
896
|
+
def get_latest_email_with_http_info(opts = {})
|
897
|
+
if @api_client.config.debugging
|
898
|
+
@api_client.config.logger.debug 'Calling API: EmailControllerApi.get_latest_email ...'
|
899
|
+
end
|
900
|
+
# resource path
|
901
|
+
local_var_path = '/emails/latest'
|
902
|
+
|
903
|
+
# query parameters
|
904
|
+
query_params = opts[:query_params] || {}
|
905
|
+
query_params[:'inboxIds'] = @api_client.build_collection_param(opts[:'inbox_ids'], :multi) if !opts[:'inbox_ids'].nil?
|
906
|
+
|
907
|
+
# header parameters
|
908
|
+
header_params = opts[:header_params] || {}
|
909
|
+
# HTTP header 'Accept' (if needed)
|
910
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
911
|
+
|
912
|
+
# form parameters
|
913
|
+
form_params = opts[:form_params] || {}
|
914
|
+
|
915
|
+
# http body (model)
|
916
|
+
post_body = opts[:body]
|
917
|
+
|
918
|
+
# return_type
|
919
|
+
return_type = opts[:return_type] || 'Email'
|
920
|
+
|
921
|
+
# auth_names
|
922
|
+
auth_names = opts[:auth_names] || ['API_KEY']
|
923
|
+
|
924
|
+
new_options = opts.merge(
|
925
|
+
:header_params => header_params,
|
926
|
+
:query_params => query_params,
|
927
|
+
:form_params => form_params,
|
928
|
+
:body => post_body,
|
929
|
+
:auth_names => auth_names,
|
930
|
+
:return_type => return_type
|
931
|
+
)
|
932
|
+
|
933
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
934
|
+
if @api_client.config.debugging
|
935
|
+
@api_client.config.logger.debug "API called: EmailControllerApi#get_latest_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
936
|
+
end
|
937
|
+
return data, status_code, headers
|
938
|
+
end
|
939
|
+
|
940
|
+
# Get latest email
|
941
|
+
# Get the newest email in all inboxes or in a passed set of inbox IDs
|
942
|
+
# @param [Hash] opts the optional parameters
|
943
|
+
# @option opts [String] :inbox_id ID of the inbox you want to get the latest email from
|
944
|
+
# @return [Email]
|
945
|
+
def get_latest_email_in_inbox(opts = {})
|
946
|
+
data, _status_code, _headers = get_latest_email_in_inbox_with_http_info(opts)
|
947
|
+
data
|
948
|
+
end
|
949
|
+
|
950
|
+
# Get latest email
|
951
|
+
# Get the newest email in all inboxes or in a passed set of inbox IDs
|
952
|
+
# @param [Hash] opts the optional parameters
|
953
|
+
# @option opts [String] :inbox_id ID of the inbox you want to get the latest email from
|
954
|
+
# @return [Array<(Email, Integer, Hash)>] Email data, response status code and response headers
|
955
|
+
def get_latest_email_in_inbox_with_http_info(opts = {})
|
956
|
+
if @api_client.config.debugging
|
957
|
+
@api_client.config.logger.debug 'Calling API: EmailControllerApi.get_latest_email_in_inbox ...'
|
958
|
+
end
|
959
|
+
# resource path
|
960
|
+
local_var_path = '/emails/latestIn'
|
961
|
+
|
962
|
+
# query parameters
|
963
|
+
query_params = opts[:query_params] || {}
|
964
|
+
query_params[:'inboxId'] = opts[:'inbox_id'] if !opts[:'inbox_id'].nil?
|
965
|
+
|
966
|
+
# header parameters
|
967
|
+
header_params = opts[:header_params] || {}
|
968
|
+
# HTTP header 'Accept' (if needed)
|
969
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
970
|
+
|
971
|
+
# form parameters
|
972
|
+
form_params = opts[:form_params] || {}
|
973
|
+
|
974
|
+
# http body (model)
|
975
|
+
post_body = opts[:body]
|
976
|
+
|
977
|
+
# return_type
|
978
|
+
return_type = opts[:return_type] || 'Email'
|
979
|
+
|
980
|
+
# auth_names
|
981
|
+
auth_names = opts[:auth_names] || ['API_KEY']
|
982
|
+
|
983
|
+
new_options = opts.merge(
|
984
|
+
:header_params => header_params,
|
985
|
+
:query_params => query_params,
|
986
|
+
:form_params => form_params,
|
987
|
+
:body => post_body,
|
988
|
+
:auth_names => auth_names,
|
989
|
+
:return_type => return_type
|
990
|
+
)
|
991
|
+
|
992
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
993
|
+
if @api_client.config.debugging
|
994
|
+
@api_client.config.logger.debug "API called: EmailControllerApi#get_latest_email_in_inbox\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
995
|
+
end
|
996
|
+
return data, status_code, headers
|
997
|
+
end
|
998
|
+
|
748
999
|
# Get raw email string
|
749
1000
|
# Returns a raw, unparsed, and unprocessed email. If your client has issues processing the response it is likely due to the response content-type which is text/plain. If you need a JSON response content-type use the getRawEmailJson endpoint
|
750
1001
|
# @param email_id [String] ID of email
|
@@ -0,0 +1,271 @@
|
|
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 'cgi'
|
14
|
+
|
15
|
+
module MailSlurpClient
|
16
|
+
class ExpiredControllerApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Get default expiration settings
|
23
|
+
# Return default times used for inbox expiration
|
24
|
+
# @param [Hash] opts the optional parameters
|
25
|
+
# @return [ExpirationDefaults]
|
26
|
+
def get_expiration_defaults(opts = {})
|
27
|
+
data, _status_code, _headers = get_expiration_defaults_with_http_info(opts)
|
28
|
+
data
|
29
|
+
end
|
30
|
+
|
31
|
+
# Get default expiration settings
|
32
|
+
# Return default times used for inbox expiration
|
33
|
+
# @param [Hash] opts the optional parameters
|
34
|
+
# @return [Array<(ExpirationDefaults, Integer, Hash)>] ExpirationDefaults data, response status code and response headers
|
35
|
+
def get_expiration_defaults_with_http_info(opts = {})
|
36
|
+
if @api_client.config.debugging
|
37
|
+
@api_client.config.logger.debug 'Calling API: ExpiredControllerApi.get_expiration_defaults ...'
|
38
|
+
end
|
39
|
+
# resource path
|
40
|
+
local_var_path = '/expired/defaults'
|
41
|
+
|
42
|
+
# query parameters
|
43
|
+
query_params = opts[:query_params] || {}
|
44
|
+
|
45
|
+
# header parameters
|
46
|
+
header_params = opts[:header_params] || {}
|
47
|
+
# HTTP header 'Accept' (if needed)
|
48
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
49
|
+
|
50
|
+
# form parameters
|
51
|
+
form_params = opts[:form_params] || {}
|
52
|
+
|
53
|
+
# http body (model)
|
54
|
+
post_body = opts[:body]
|
55
|
+
|
56
|
+
# return_type
|
57
|
+
return_type = opts[:return_type] || 'ExpirationDefaults'
|
58
|
+
|
59
|
+
# auth_names
|
60
|
+
auth_names = opts[:auth_names] || ['API_KEY']
|
61
|
+
|
62
|
+
new_options = opts.merge(
|
63
|
+
:header_params => header_params,
|
64
|
+
:query_params => query_params,
|
65
|
+
:form_params => form_params,
|
66
|
+
:body => post_body,
|
67
|
+
:auth_names => auth_names,
|
68
|
+
:return_type => return_type
|
69
|
+
)
|
70
|
+
|
71
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
72
|
+
if @api_client.config.debugging
|
73
|
+
@api_client.config.logger.debug "API called: ExpiredControllerApi#get_expiration_defaults\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
74
|
+
end
|
75
|
+
return data, status_code, headers
|
76
|
+
end
|
77
|
+
|
78
|
+
# Get expired inbox record for a previously existing inbox
|
79
|
+
# Use the inboxId to return an ExpiredInboxRecord if an inbox has expired. Inboxes expire and are disabled if an expiration date is set or plan requires. Returns 404 if no expired inbox is found for the inboxId
|
80
|
+
# @param inbox_id [String] ID of inbox you want to retrieve (not the inbox ID)
|
81
|
+
# @param [Hash] opts the optional parameters
|
82
|
+
# @return [ExpiredInboxDto]
|
83
|
+
def get_expired_inbox_by_inbox_id(inbox_id, opts = {})
|
84
|
+
data, _status_code, _headers = get_expired_inbox_by_inbox_id_with_http_info(inbox_id, opts)
|
85
|
+
data
|
86
|
+
end
|
87
|
+
|
88
|
+
# Get expired inbox record for a previously existing inbox
|
89
|
+
# Use the inboxId to return an ExpiredInboxRecord if an inbox has expired. Inboxes expire and are disabled if an expiration date is set or plan requires. Returns 404 if no expired inbox is found for the inboxId
|
90
|
+
# @param inbox_id [String] ID of inbox you want to retrieve (not the inbox ID)
|
91
|
+
# @param [Hash] opts the optional parameters
|
92
|
+
# @return [Array<(ExpiredInboxDto, Integer, Hash)>] ExpiredInboxDto data, response status code and response headers
|
93
|
+
def get_expired_inbox_by_inbox_id_with_http_info(inbox_id, opts = {})
|
94
|
+
if @api_client.config.debugging
|
95
|
+
@api_client.config.logger.debug 'Calling API: ExpiredControllerApi.get_expired_inbox_by_inbox_id ...'
|
96
|
+
end
|
97
|
+
# verify the required parameter 'inbox_id' is set
|
98
|
+
if @api_client.config.client_side_validation && inbox_id.nil?
|
99
|
+
fail ArgumentError, "Missing the required parameter 'inbox_id' when calling ExpiredControllerApi.get_expired_inbox_by_inbox_id"
|
100
|
+
end
|
101
|
+
# resource path
|
102
|
+
local_var_path = '/expired/inbox/{inboxId}'.sub('{' + 'inboxId' + '}', CGI.escape(inbox_id.to_s))
|
103
|
+
|
104
|
+
# query parameters
|
105
|
+
query_params = opts[:query_params] || {}
|
106
|
+
|
107
|
+
# header parameters
|
108
|
+
header_params = opts[:header_params] || {}
|
109
|
+
# HTTP header 'Accept' (if needed)
|
110
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
111
|
+
|
112
|
+
# form parameters
|
113
|
+
form_params = opts[:form_params] || {}
|
114
|
+
|
115
|
+
# http body (model)
|
116
|
+
post_body = opts[:body]
|
117
|
+
|
118
|
+
# return_type
|
119
|
+
return_type = opts[:return_type] || 'ExpiredInboxDto'
|
120
|
+
|
121
|
+
# auth_names
|
122
|
+
auth_names = opts[:auth_names] || ['API_KEY']
|
123
|
+
|
124
|
+
new_options = opts.merge(
|
125
|
+
:header_params => header_params,
|
126
|
+
:query_params => query_params,
|
127
|
+
:form_params => form_params,
|
128
|
+
:body => post_body,
|
129
|
+
:auth_names => auth_names,
|
130
|
+
:return_type => return_type
|
131
|
+
)
|
132
|
+
|
133
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
134
|
+
if @api_client.config.debugging
|
135
|
+
@api_client.config.logger.debug "API called: ExpiredControllerApi#get_expired_inbox_by_inbox_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
136
|
+
end
|
137
|
+
return data, status_code, headers
|
138
|
+
end
|
139
|
+
|
140
|
+
# Get an expired inbox record
|
141
|
+
# Inboxes created with an expiration date will expire after the given date and be moved to an ExpiredInbox entity. You can still read emails in the inbox but it can no longer send or receive emails. Fetch the expired inboxes to view the old inboxes properties
|
142
|
+
# @param expired_id [String] ID of the ExpiredInboxRecord you want to retrieve. This is different from the ID of the inbox you are interested in. See other methods for getting ExpiredInboxRecord for an inbox inboxId)
|
143
|
+
# @param [Hash] opts the optional parameters
|
144
|
+
# @return [ExpiredInboxDto]
|
145
|
+
def get_expired_inbox_record(expired_id, opts = {})
|
146
|
+
data, _status_code, _headers = get_expired_inbox_record_with_http_info(expired_id, opts)
|
147
|
+
data
|
148
|
+
end
|
149
|
+
|
150
|
+
# Get an expired inbox record
|
151
|
+
# Inboxes created with an expiration date will expire after the given date and be moved to an ExpiredInbox entity. You can still read emails in the inbox but it can no longer send or receive emails. Fetch the expired inboxes to view the old inboxes properties
|
152
|
+
# @param expired_id [String] ID of the ExpiredInboxRecord you want to retrieve. This is different from the ID of the inbox you are interested in. See other methods for getting ExpiredInboxRecord for an inbox inboxId)
|
153
|
+
# @param [Hash] opts the optional parameters
|
154
|
+
# @return [Array<(ExpiredInboxDto, Integer, Hash)>] ExpiredInboxDto data, response status code and response headers
|
155
|
+
def get_expired_inbox_record_with_http_info(expired_id, opts = {})
|
156
|
+
if @api_client.config.debugging
|
157
|
+
@api_client.config.logger.debug 'Calling API: ExpiredControllerApi.get_expired_inbox_record ...'
|
158
|
+
end
|
159
|
+
# verify the required parameter 'expired_id' is set
|
160
|
+
if @api_client.config.client_side_validation && expired_id.nil?
|
161
|
+
fail ArgumentError, "Missing the required parameter 'expired_id' when calling ExpiredControllerApi.get_expired_inbox_record"
|
162
|
+
end
|
163
|
+
# resource path
|
164
|
+
local_var_path = '/expired/{expiredId}'.sub('{' + 'expiredId' + '}', CGI.escape(expired_id.to_s))
|
165
|
+
|
166
|
+
# query parameters
|
167
|
+
query_params = opts[:query_params] || {}
|
168
|
+
|
169
|
+
# header parameters
|
170
|
+
header_params = opts[:header_params] || {}
|
171
|
+
# HTTP header 'Accept' (if needed)
|
172
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
173
|
+
|
174
|
+
# form parameters
|
175
|
+
form_params = opts[:form_params] || {}
|
176
|
+
|
177
|
+
# http body (model)
|
178
|
+
post_body = opts[:body]
|
179
|
+
|
180
|
+
# return_type
|
181
|
+
return_type = opts[:return_type] || 'ExpiredInboxDto'
|
182
|
+
|
183
|
+
# auth_names
|
184
|
+
auth_names = opts[:auth_names] || ['API_KEY']
|
185
|
+
|
186
|
+
new_options = opts.merge(
|
187
|
+
:header_params => header_params,
|
188
|
+
:query_params => query_params,
|
189
|
+
:form_params => form_params,
|
190
|
+
:body => post_body,
|
191
|
+
:auth_names => auth_names,
|
192
|
+
:return_type => return_type
|
193
|
+
)
|
194
|
+
|
195
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
196
|
+
if @api_client.config.debugging
|
197
|
+
@api_client.config.logger.debug "API called: ExpiredControllerApi#get_expired_inbox_record\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
198
|
+
end
|
199
|
+
return data, status_code, headers
|
200
|
+
end
|
201
|
+
|
202
|
+
# List records of expired inboxes
|
203
|
+
# Inboxes created with an expiration date will expire after the given date. An ExpiredInboxRecord is created that records the inboxes old ID and email address. You can still read emails in the inbox (using the inboxes old ID) but the email address associated with the inbox can no longer send or receive emails. Fetch expired inbox records to view the old inboxes properties
|
204
|
+
# @param [Hash] opts the optional parameters
|
205
|
+
# @option opts [Integer] :page Optional page index in inbox sent email list pagination (default to 0)
|
206
|
+
# @option opts [Integer] :size Optional page size in inbox sent email list pagination (default to 20)
|
207
|
+
# @option opts [String] :sort Optional createdAt sort direction ASC or DESC (default to 'ASC')
|
208
|
+
# @return [PageExpiredInboxRecordProjection]
|
209
|
+
def get_expired_inboxes(opts = {})
|
210
|
+
data, _status_code, _headers = get_expired_inboxes_with_http_info(opts)
|
211
|
+
data
|
212
|
+
end
|
213
|
+
|
214
|
+
# List records of expired inboxes
|
215
|
+
# Inboxes created with an expiration date will expire after the given date. An ExpiredInboxRecord is created that records the inboxes old ID and email address. You can still read emails in the inbox (using the inboxes old ID) but the email address associated with the inbox can no longer send or receive emails. Fetch expired inbox records to view the old inboxes properties
|
216
|
+
# @param [Hash] opts the optional parameters
|
217
|
+
# @option opts [Integer] :page Optional page index in inbox sent email list pagination
|
218
|
+
# @option opts [Integer] :size Optional page size in inbox sent email list pagination
|
219
|
+
# @option opts [String] :sort Optional createdAt sort direction ASC or DESC
|
220
|
+
# @return [Array<(PageExpiredInboxRecordProjection, Integer, Hash)>] PageExpiredInboxRecordProjection data, response status code and response headers
|
221
|
+
def get_expired_inboxes_with_http_info(opts = {})
|
222
|
+
if @api_client.config.debugging
|
223
|
+
@api_client.config.logger.debug 'Calling API: ExpiredControllerApi.get_expired_inboxes ...'
|
224
|
+
end
|
225
|
+
allowable_values = ["ASC", "DESC"]
|
226
|
+
if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
|
227
|
+
fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
|
228
|
+
end
|
229
|
+
# resource path
|
230
|
+
local_var_path = '/expired'
|
231
|
+
|
232
|
+
# query parameters
|
233
|
+
query_params = opts[:query_params] || {}
|
234
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
235
|
+
query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
|
236
|
+
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
|
237
|
+
|
238
|
+
# header parameters
|
239
|
+
header_params = opts[:header_params] || {}
|
240
|
+
# HTTP header 'Accept' (if needed)
|
241
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
242
|
+
|
243
|
+
# form parameters
|
244
|
+
form_params = opts[:form_params] || {}
|
245
|
+
|
246
|
+
# http body (model)
|
247
|
+
post_body = opts[:body]
|
248
|
+
|
249
|
+
# return_type
|
250
|
+
return_type = opts[:return_type] || 'PageExpiredInboxRecordProjection'
|
251
|
+
|
252
|
+
# auth_names
|
253
|
+
auth_names = opts[:auth_names] || ['API_KEY']
|
254
|
+
|
255
|
+
new_options = opts.merge(
|
256
|
+
:header_params => header_params,
|
257
|
+
:query_params => query_params,
|
258
|
+
:form_params => form_params,
|
259
|
+
:body => post_body,
|
260
|
+
:auth_names => auth_names,
|
261
|
+
:return_type => return_type
|
262
|
+
)
|
263
|
+
|
264
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
265
|
+
if @api_client.config.debugging
|
266
|
+
@api_client.config.logger.debug "API called: ExpiredControllerApi#get_expired_inboxes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
267
|
+
end
|
268
|
+
return data, status_code, headers
|
269
|
+
end
|
270
|
+
end
|
271
|
+
end
|