mailslurp_client 11.1.0 → 11.4.22
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 +3 -0
- data/lib/mailslurp_client/api/domain_controller_api.rb +132 -0
- data/lib/mailslurp_client/api/email_controller_api.rb +137 -22
- 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/expiration_defaults.rb +239 -0
- data/lib/mailslurp_client/models/update_domain_options.rb +207 -0
- data/lib/mailslurp_client/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aef4b7af2f3f59476edbe6983d41622f285dd6302fe524e91fb27c399a6f242d
|
4
|
+
data.tar.gz: e78c4a6d1921170ea4afd60c994e4734e02f48894b7f34e66eb9665315d6f2b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a015ae37ee22012ddebfdf16849e47ae48dddaa4e385ea6ae50796e06b8e560d9fb6e7e83df968bef09c9134886b98dbed32130b6bf98ec09c5948208258a19
|
7
|
+
data.tar.gz: 98e8012e2189181ca3f4fe544c158c08aadfcfc4b8b345d7cd14d2950a118232af1da6de92bb648169553b460b5e9724affdb754198a3bed1dcc5c9e434fd829
|
data/lib/mailslurp_client.rb
CHANGED
@@ -48,6 +48,7 @@ require 'mailslurp_client/models/email_preview'
|
|
48
48
|
require 'mailslurp_client/models/email_projection'
|
49
49
|
require 'mailslurp_client/models/email_text_lines_result'
|
50
50
|
require 'mailslurp_client/models/email_verification_result'
|
51
|
+
require 'mailslurp_client/models/expiration_defaults'
|
51
52
|
require 'mailslurp_client/models/expired_inbox_dto'
|
52
53
|
require 'mailslurp_client/models/expired_inbox_record_projection'
|
53
54
|
require 'mailslurp_client/models/forward_email_options'
|
@@ -89,6 +90,7 @@ require 'mailslurp_client/models/template_variable'
|
|
89
90
|
require 'mailslurp_client/models/thread_projection'
|
90
91
|
require 'mailslurp_client/models/unread_count'
|
91
92
|
require 'mailslurp_client/models/update_alias_options'
|
93
|
+
require 'mailslurp_client/models/update_domain_options'
|
92
94
|
require 'mailslurp_client/models/update_group_contacts'
|
93
95
|
require 'mailslurp_client/models/update_inbox_options'
|
94
96
|
require 'mailslurp_client/models/upload_attachment_options'
|
@@ -110,6 +112,7 @@ require 'mailslurp_client/api/common_actions_controller_api'
|
|
110
112
|
require 'mailslurp_client/api/contact_controller_api'
|
111
113
|
require 'mailslurp_client/api/domain_controller_api'
|
112
114
|
require 'mailslurp_client/api/email_controller_api'
|
115
|
+
require 'mailslurp_client/api/expired_controller_api'
|
113
116
|
require 'mailslurp_client/api/form_controller_api'
|
114
117
|
require 'mailslurp_client/api/group_controller_api'
|
115
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
|
@@ -673,21 +673,21 @@ module MailSlurpClient
|
|
673
673
|
# Parse and return text from an email, stripping HTML and decoding encoded characters
|
674
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
675
|
# @param email_id [String] ID of email to perform HTML query on
|
676
|
-
# @param html_selector [String] 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.
|
677
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
678
|
# @return [EmailTextLinesResult]
|
679
|
-
def get_email_html_query(email_id,
|
680
|
-
data, _status_code, _headers = get_email_html_query_with_http_info(email_id,
|
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
681
|
data
|
682
682
|
end
|
683
683
|
|
684
684
|
# Parse and return text from an email, stripping HTML and decoding encoded characters
|
685
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
686
|
# @param email_id [String] ID of email to perform HTML query on
|
687
|
-
# @param html_selector [String] 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.
|
688
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
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,
|
690
|
+
def get_email_html_query_with_http_info(email_id, opts = {})
|
691
691
|
if @api_client.config.debugging
|
692
692
|
@api_client.config.logger.debug 'Calling API: EmailControllerApi.get_email_html_query ...'
|
693
693
|
end
|
@@ -695,15 +695,12 @@ module MailSlurpClient
|
|
695
695
|
if @api_client.config.client_side_validation && email_id.nil?
|
696
696
|
fail ArgumentError, "Missing the required parameter 'email_id' when calling EmailControllerApi.get_email_html_query"
|
697
697
|
end
|
698
|
-
# verify the required parameter 'html_selector' is set
|
699
|
-
if @api_client.config.client_side_validation && html_selector.nil?
|
700
|
-
fail ArgumentError, "Missing the required parameter 'html_selector' when calling EmailControllerApi.get_email_html_query"
|
701
|
-
end
|
702
698
|
# resource path
|
703
|
-
local_var_path = '/emails/{emailId}/
|
699
|
+
local_var_path = '/emails/{emailId}/htmlQuery'.sub('{' + 'emailId' + '}', CGI.escape(email_id.to_s))
|
704
700
|
|
705
701
|
# query parameters
|
706
702
|
query_params = opts[:query_params] || {}
|
703
|
+
query_params[:'htmlSelector'] = opts[:'html_selector'] if !opts[:'html_selector'].nil?
|
707
704
|
|
708
705
|
# header parameters
|
709
706
|
header_params = opts[:header_params] || {}
|
@@ -731,7 +728,7 @@ module MailSlurpClient
|
|
731
728
|
:return_type => return_type
|
732
729
|
)
|
733
730
|
|
734
|
-
data, status_code, headers = @api_client.call_api(:
|
731
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
735
732
|
if @api_client.config.debugging
|
736
733
|
@api_client.config.logger.debug "API called: EmailControllerApi#get_email_html_query\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
737
734
|
end
|
@@ -740,38 +737,38 @@ module MailSlurpClient
|
|
740
737
|
|
741
738
|
# Parse and return text from an email, stripping HTML and decoding encoded characters
|
742
739
|
# Parse an email body and return the content as an array of strings. HTML parsing uses JSoup and UNIX line separators.
|
743
|
-
# @param decode_html_entities [Boolean] Decode HTML entities
|
744
740
|
# @param email_id [String] ID of email to fetch text for
|
745
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
|
746
744
|
# @return [EmailTextLinesResult]
|
747
|
-
def get_email_text_lines(
|
748
|
-
data, _status_code, _headers = get_email_text_lines_with_http_info(
|
745
|
+
def get_email_text_lines(email_id, opts = {})
|
746
|
+
data, _status_code, _headers = get_email_text_lines_with_http_info(email_id, opts)
|
749
747
|
data
|
750
748
|
end
|
751
749
|
|
752
750
|
# Parse and return text from an email, stripping HTML and decoding encoded characters
|
753
751
|
# Parse an email body and return the content as an array of strings. HTML parsing uses JSoup and UNIX line separators.
|
754
|
-
# @param decode_html_entities [Boolean] Decode HTML entities
|
755
752
|
# @param email_id [String] ID of email to fetch text for
|
756
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
|
757
756
|
# @return [Array<(EmailTextLinesResult, Integer, Hash)>] EmailTextLinesResult data, response status code and response headers
|
758
|
-
def get_email_text_lines_with_http_info(
|
757
|
+
def get_email_text_lines_with_http_info(email_id, opts = {})
|
759
758
|
if @api_client.config.debugging
|
760
759
|
@api_client.config.logger.debug 'Calling API: EmailControllerApi.get_email_text_lines ...'
|
761
760
|
end
|
762
|
-
# verify the required parameter 'decode_html_entities' is set
|
763
|
-
if @api_client.config.client_side_validation && decode_html_entities.nil?
|
764
|
-
fail ArgumentError, "Missing the required parameter 'decode_html_entities' when calling EmailControllerApi.get_email_text_lines"
|
765
|
-
end
|
766
761
|
# verify the required parameter 'email_id' is set
|
767
762
|
if @api_client.config.client_side_validation && email_id.nil?
|
768
763
|
fail ArgumentError, "Missing the required parameter 'email_id' when calling EmailControllerApi.get_email_text_lines"
|
769
764
|
end
|
770
765
|
# resource path
|
771
|
-
local_var_path = '/emails/{emailId}/
|
766
|
+
local_var_path = '/emails/{emailId}/textLines'.sub('{' + 'emailId' + '}', CGI.escape(email_id.to_s))
|
772
767
|
|
773
768
|
# query parameters
|
774
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?
|
775
772
|
|
776
773
|
# header parameters
|
777
774
|
header_params = opts[:header_params] || {}
|
@@ -799,7 +796,7 @@ module MailSlurpClient
|
|
799
796
|
:return_type => return_type
|
800
797
|
)
|
801
798
|
|
802
|
-
data, status_code, headers = @api_client.call_api(:
|
799
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
803
800
|
if @api_client.config.debugging
|
804
801
|
@api_client.config.logger.debug "API called: EmailControllerApi#get_email_text_lines\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
805
802
|
end
|
@@ -881,6 +878,124 @@ module MailSlurpClient
|
|
881
878
|
return data, status_code, headers
|
882
879
|
end
|
883
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
|
+
|
884
999
|
# Get raw email string
|
885
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
|
886
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
|