mailslurp_client 15.20.0 → 15.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/mailslurp_client/api/attachment_controller_api.rb +6 -0
- data/lib/mailslurp_client/api/bounce_controller_api.rb +79 -0
- data/lib/mailslurp_client/api/inbox_controller_api.rb +56 -2
- data/lib/mailslurp_client/api/o_auth_connection_api.rb +170 -0
- data/lib/mailslurp_client/api/phone_controller_api.rb +269 -1
- data/lib/mailslurp_client/api/user_controller_api.rb +267 -0
- data/lib/mailslurp_client/models/alias_projection.rb +29 -29
- data/lib/mailslurp_client/models/alias_thread_projection.rb +39 -39
- data/lib/mailslurp_client/models/attachment_projection.rb +25 -25
- data/lib/mailslurp_client/models/bounce_projection.rb +22 -22
- data/lib/mailslurp_client/models/bounce_recipient_projection.rb +10 -10
- data/lib/mailslurp_client/models/connector_event_projection.rb +15 -15
- data/lib/mailslurp_client/models/connector_projection.rb +15 -15
- data/lib/mailslurp_client/models/contact_projection.rb +10 -10
- data/lib/mailslurp_client/models/create_emergency_address_options.rb +2 -2
- data/lib/mailslurp_client/models/create_o_auth_connection_result.rb +211 -0
- data/lib/mailslurp_client/models/create_o_auth_exchange_result.rb +229 -0
- data/lib/mailslurp_client/models/create_phone_number_options.rb +284 -0
- data/lib/mailslurp_client/models/domain_dto.rb +27 -1
- data/lib/mailslurp_client/models/email.rb +12 -1
- data/lib/mailslurp_client/models/email_preview.rb +15 -5
- data/lib/mailslurp_client/models/email_projection.rb +42 -32
- data/lib/mailslurp_client/models/email_thread_projection.rb +52 -52
- data/lib/mailslurp_client/models/emergency_address.rb +2 -2
- data/lib/mailslurp_client/models/emergency_address_dto.rb +2 -2
- data/lib/mailslurp_client/models/entity_automation_item_projection.rb +295 -0
- data/lib/mailslurp_client/models/entity_event_item_projection.rb +303 -0
- data/lib/mailslurp_client/models/entity_favourite_item_projection.rb +296 -0
- data/lib/mailslurp_client/models/expired_inbox_record_projection.rb +15 -15
- data/lib/mailslurp_client/models/guest_portal_user_projection.rb +39 -39
- data/lib/mailslurp_client/models/inbox_dto.rb +2 -2
- data/lib/mailslurp_client/models/inbox_forwarder_event_projection.rb +10 -10
- data/lib/mailslurp_client/models/inbox_preview.rb +2 -2
- data/lib/mailslurp_client/models/inbox_replier_event_projection.rb +10 -10
- data/lib/mailslurp_client/models/list_unsubscribe_recipient_projection.rb +15 -15
- data/lib/mailslurp_client/models/missed_email_projection.rb +14 -14
- data/lib/mailslurp_client/models/opt_in_identity_projection.rb +29 -29
- data/lib/mailslurp_client/models/organization_inbox_projection.rb +2 -2
- data/lib/mailslurp_client/models/page_entity_automation_items.rb +309 -0
- data/lib/mailslurp_client/models/page_entity_event_items.rb +309 -0
- data/lib/mailslurp_client/models/page_entity_favourite_items.rb +309 -0
- data/lib/mailslurp_client/models/page_phone_message_thread_item_projection.rb +309 -0
- data/lib/mailslurp_client/models/page_phone_message_thread_projection.rb +309 -0
- data/lib/mailslurp_client/models/page_reputation_items.rb +309 -0
- data/lib/mailslurp_client/models/phone_message_thread_item_projection.rb +315 -0
- data/lib/mailslurp_client/models/phone_message_thread_projection.rb +315 -0
- data/lib/mailslurp_client/models/phone_number_dto.rb +2 -2
- data/lib/mailslurp_client/models/phone_number_projection.rb +17 -17
- data/lib/mailslurp_client/models/phone_plan_availability_item.rb +2 -2
- data/lib/mailslurp_client/models/phone_plan_dto.rb +2 -2
- data/lib/mailslurp_client/models/plus_address_projection.rb +29 -29
- data/lib/mailslurp_client/models/reputation_item_projection.rb +317 -0
- data/lib/mailslurp_client/models/search_inboxes_options.rb +2 -2
- data/lib/mailslurp_client/models/sent_email_dto.rb +12 -1
- data/lib/mailslurp_client/models/sent_email_projection.rb +25 -25
- data/lib/mailslurp_client/models/sent_sms_projection.rb +15 -15
- data/lib/mailslurp_client/models/sms_preview.rb +15 -1
- data/lib/mailslurp_client/models/sms_projection.rb +15 -15
- data/lib/mailslurp_client/models/template_projection.rb +15 -15
- data/lib/mailslurp_client/models/tracking_pixel_projection.rb +15 -15
- data/lib/mailslurp_client/models/unknown_missed_email_projection.rb +10 -10
- data/lib/mailslurp_client/models/wait_for_sms_conditions.rb +1 -1
- data/lib/mailslurp_client/models/webhook_projection.rb +47 -47
- data/lib/mailslurp_client/version.rb +1 -1
- data/lib/mailslurp_client.rb +16 -0
- metadata +18 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5d8a0c5306f41dcd1ab333e4dc2ee75065e8c6e089f1df18c1ed3e3fa544b650
|
4
|
+
data.tar.gz: 99477adcfc50ec1078d05bf6fba111674433cd9a94001cd53c81ae360486d5d5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7db5fa9fb1238be131d2b0d3452080187d4c6cec467117ccb7088c3ab9364ef3e938add14c37772c254996d89422a2d346333e081e96f79eede7edc6a3b6a23a
|
7
|
+
data.tar.gz: f2dfc5d866bd13bddbd05a9c3f0ebb6badf5f71d9d756761562b13f92ebfc9c1148da19b9699cd31297459e5f7c86b09df17f23b427dd0dcd039c3035d1e5962
|
@@ -389,6 +389,8 @@ module MailSlurpClient
|
|
389
389
|
# @option opts [DateTime] :since Filter by created at after the given timestamp
|
390
390
|
# @option opts [DateTime] :before Filter by created at before the given timestamp
|
391
391
|
# @option opts [String] :inbox_id Optional inboxId to filter attachments by
|
392
|
+
# @option opts [String] :email_id Optional emailId to filter attachments by
|
393
|
+
# @option opts [String] :sent_email_id Optional sentEmailId to filter attachments by
|
392
394
|
# @return [PageAttachmentEntity]
|
393
395
|
def get_attachments(opts = {})
|
394
396
|
data, _status_code, _headers = get_attachments_with_http_info(opts)
|
@@ -405,6 +407,8 @@ module MailSlurpClient
|
|
405
407
|
# @option opts [DateTime] :since Filter by created at after the given timestamp
|
406
408
|
# @option opts [DateTime] :before Filter by created at before the given timestamp
|
407
409
|
# @option opts [String] :inbox_id Optional inboxId to filter attachments by
|
410
|
+
# @option opts [String] :email_id Optional emailId to filter attachments by
|
411
|
+
# @option opts [String] :sent_email_id Optional sentEmailId to filter attachments by
|
408
412
|
# @return [Array<(PageAttachmentEntity, Integer, Hash)>] PageAttachmentEntity data, response status code and response headers
|
409
413
|
def get_attachments_with_http_info(opts = {})
|
410
414
|
if @api_client.config.debugging
|
@@ -426,6 +430,8 @@ module MailSlurpClient
|
|
426
430
|
query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil?
|
427
431
|
query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
|
428
432
|
query_params[:'inboxId'] = opts[:'inbox_id'] if !opts[:'inbox_id'].nil?
|
433
|
+
query_params[:'emailId'] = opts[:'email_id'] if !opts[:'email_id'].nil?
|
434
|
+
query_params[:'sentEmailId'] = opts[:'sent_email_id'] if !opts[:'sent_email_id'].nil?
|
429
435
|
|
430
436
|
# header parameters
|
431
437
|
header_params = opts[:header_params] || {}
|
@@ -637,5 +637,84 @@ module MailSlurpClient
|
|
637
637
|
end
|
638
638
|
return data, status_code, headers
|
639
639
|
end
|
640
|
+
|
641
|
+
# Get paginated list of reputation items.
|
642
|
+
# List of complaints and bounces
|
643
|
+
# @param [Hash] opts the optional parameters
|
644
|
+
# @option opts [Integer] :page Optional page index (default to 0)
|
645
|
+
# @option opts [Integer] :size Optional page size (default to 20)
|
646
|
+
# @option opts [String] :sort Optional createdAt sort direction ASC or DESC (default to 'DESC')
|
647
|
+
# @option opts [DateTime] :since Filter by created at after the given timestamp
|
648
|
+
# @option opts [DateTime] :before Filter by created at before the given timestamp
|
649
|
+
# @return [PageReputationItems]
|
650
|
+
def get_reputation_items(opts = {})
|
651
|
+
data, _status_code, _headers = get_reputation_items_with_http_info(opts)
|
652
|
+
data
|
653
|
+
end
|
654
|
+
|
655
|
+
# Get paginated list of reputation items.
|
656
|
+
# List of complaints and bounces
|
657
|
+
# @param [Hash] opts the optional parameters
|
658
|
+
# @option opts [Integer] :page Optional page index
|
659
|
+
# @option opts [Integer] :size Optional page size
|
660
|
+
# @option opts [String] :sort Optional createdAt sort direction ASC or DESC
|
661
|
+
# @option opts [DateTime] :since Filter by created at after the given timestamp
|
662
|
+
# @option opts [DateTime] :before Filter by created at before the given timestamp
|
663
|
+
# @return [Array<(PageReputationItems, Integer, Hash)>] PageReputationItems data, response status code and response headers
|
664
|
+
def get_reputation_items_with_http_info(opts = {})
|
665
|
+
if @api_client.config.debugging
|
666
|
+
@api_client.config.logger.debug 'Calling API: BounceControllerApi.get_reputation_items ...'
|
667
|
+
end
|
668
|
+
if @api_client.config.client_side_validation && !opts[:'size'].nil? && opts[:'size'] > 100
|
669
|
+
fail ArgumentError, 'invalid value for "opts[:"size"]" when calling BounceControllerApi.get_reputation_items, must be smaller than or equal to 100.'
|
670
|
+
end
|
671
|
+
|
672
|
+
allowable_values = ["ASC", "DESC"]
|
673
|
+
if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
|
674
|
+
fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
|
675
|
+
end
|
676
|
+
# resource path
|
677
|
+
local_var_path = '/bounce/reputation-items'
|
678
|
+
|
679
|
+
# query parameters
|
680
|
+
query_params = opts[:query_params] || {}
|
681
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
682
|
+
query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
|
683
|
+
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
|
684
|
+
query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil?
|
685
|
+
query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
|
686
|
+
|
687
|
+
# header parameters
|
688
|
+
header_params = opts[:header_params] || {}
|
689
|
+
# HTTP header 'Accept' (if needed)
|
690
|
+
header_params['Accept'] = @api_client.select_header_accept(['*/*'])
|
691
|
+
|
692
|
+
# form parameters
|
693
|
+
form_params = opts[:form_params] || {}
|
694
|
+
|
695
|
+
# http body (model)
|
696
|
+
post_body = opts[:body]
|
697
|
+
|
698
|
+
# return_type
|
699
|
+
return_type = opts[:return_type] || 'PageReputationItems'
|
700
|
+
|
701
|
+
# auth_names
|
702
|
+
auth_names = opts[:auth_names] || ['API_KEY']
|
703
|
+
|
704
|
+
new_options = opts.merge(
|
705
|
+
:header_params => header_params,
|
706
|
+
:query_params => query_params,
|
707
|
+
:form_params => form_params,
|
708
|
+
:body => post_body,
|
709
|
+
:auth_names => auth_names,
|
710
|
+
:return_type => return_type
|
711
|
+
)
|
712
|
+
|
713
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
714
|
+
if @api_client.config.debugging
|
715
|
+
@api_client.config.logger.debug "API called: BounceControllerApi#get_reputation_items\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
716
|
+
end
|
717
|
+
return data, status_code, headers
|
718
|
+
end
|
640
719
|
end
|
641
720
|
end
|
@@ -797,6 +797,60 @@ module MailSlurpClient
|
|
797
797
|
return data, status_code, headers
|
798
798
|
end
|
799
799
|
|
800
|
+
# Does inbox have automations
|
801
|
+
# Check if an inbox has automations.
|
802
|
+
# @param [Hash] opts the optional parameters
|
803
|
+
# @return [nil]
|
804
|
+
def does_inbox_have_automations(opts = {})
|
805
|
+
does_inbox_have_automations_with_http_info(opts)
|
806
|
+
nil
|
807
|
+
end
|
808
|
+
|
809
|
+
# Does inbox have automations
|
810
|
+
# Check if an inbox has automations.
|
811
|
+
# @param [Hash] opts the optional parameters
|
812
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
813
|
+
def does_inbox_have_automations_with_http_info(opts = {})
|
814
|
+
if @api_client.config.debugging
|
815
|
+
@api_client.config.logger.debug 'Calling API: InboxControllerApi.does_inbox_have_automations ...'
|
816
|
+
end
|
817
|
+
# resource path
|
818
|
+
local_var_path = '/inboxes/automations'
|
819
|
+
|
820
|
+
# query parameters
|
821
|
+
query_params = opts[:query_params] || {}
|
822
|
+
|
823
|
+
# header parameters
|
824
|
+
header_params = opts[:header_params] || {}
|
825
|
+
|
826
|
+
# form parameters
|
827
|
+
form_params = opts[:form_params] || {}
|
828
|
+
|
829
|
+
# http body (model)
|
830
|
+
post_body = opts[:body]
|
831
|
+
|
832
|
+
# return_type
|
833
|
+
return_type = opts[:return_type]
|
834
|
+
|
835
|
+
# auth_names
|
836
|
+
auth_names = opts[:auth_names] || ['API_KEY']
|
837
|
+
|
838
|
+
new_options = opts.merge(
|
839
|
+
:header_params => header_params,
|
840
|
+
:query_params => query_params,
|
841
|
+
:form_params => form_params,
|
842
|
+
:body => post_body,
|
843
|
+
:auth_names => auth_names,
|
844
|
+
:return_type => return_type
|
845
|
+
)
|
846
|
+
|
847
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
848
|
+
if @api_client.config.debugging
|
849
|
+
@api_client.config.logger.debug "API called: InboxControllerApi#does_inbox_have_automations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
850
|
+
end
|
851
|
+
return data, status_code, headers
|
852
|
+
end
|
853
|
+
|
800
854
|
# Remove expired inboxes
|
801
855
|
# Remove any expired inboxes for your account (instead of waiting for scheduled removal on server)
|
802
856
|
# @param [Hash] opts the optional parameters
|
@@ -905,7 +959,7 @@ module MailSlurpClient
|
|
905
959
|
if @api_client.config.client_side_validation && opts[:'inbox_type'] && !allowable_values.include?(opts[:'inbox_type'])
|
906
960
|
fail ArgumentError, "invalid value for \"inbox_type\", must be one of #{allowable_values}"
|
907
961
|
end
|
908
|
-
allowable_values = ["ALIAS", "THREAD", "CATCH_ALL", "CONNECTOR", "ACCOUNT", "GUEST"]
|
962
|
+
allowable_values = ["ALIAS", "THREAD", "CATCH_ALL", "CONNECTOR", "ACCOUNT", "GUEST", "OAUTH_CONNECTION_GMAIL"]
|
909
963
|
if @api_client.config.client_side_validation && opts[:'inbox_function'] && !allowable_values.include?(opts[:'inbox_function'])
|
910
964
|
fail ArgumentError, "invalid value for \"inbox_function\", must be one of #{allowable_values}"
|
911
965
|
end
|
@@ -1009,7 +1063,7 @@ module MailSlurpClient
|
|
1009
1063
|
if @api_client.config.client_side_validation && opts[:'inbox_type'] && !allowable_values.include?(opts[:'inbox_type'])
|
1010
1064
|
fail ArgumentError, "invalid value for \"inbox_type\", must be one of #{allowable_values}"
|
1011
1065
|
end
|
1012
|
-
allowable_values = ["ALIAS", "THREAD", "CATCH_ALL", "CONNECTOR", "ACCOUNT", "GUEST"]
|
1066
|
+
allowable_values = ["ALIAS", "THREAD", "CATCH_ALL", "CONNECTOR", "ACCOUNT", "GUEST", "OAUTH_CONNECTION_GMAIL"]
|
1013
1067
|
if @api_client.config.client_side_validation && opts[:'inbox_function'] && !allowable_values.include?(opts[:'inbox_function'])
|
1014
1068
|
fail ArgumentError, "invalid value for \"inbox_function\", must be one of #{allowable_values}"
|
1015
1069
|
end
|
@@ -0,0 +1,170 @@
|
|
1
|
+
=begin
|
2
|
+
#MailSlurp API
|
3
|
+
|
4
|
+
#MailSlurp is an API for sending and receiving emails and SMS from dynamically allocated email addresses and phone numbers. 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://docs.mailslurp.com/) - [Examples](https://github.com/mailslurp/examples) repository
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 6.5.2
|
7
|
+
Contact: contact@mailslurp.dev
|
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 OAuthConnectionApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Create an OAuth connection
|
23
|
+
# Configure an inbox for OAuth sync with MailSlurp
|
24
|
+
# @param redirect_base [String]
|
25
|
+
# @param o_auth_connection_type [String]
|
26
|
+
# @param [Hash] opts the optional parameters
|
27
|
+
# @option opts [String] :email_address
|
28
|
+
# @return [CreateOAuthConnectionResult]
|
29
|
+
def create_o_auth_connection(redirect_base, o_auth_connection_type, opts = {})
|
30
|
+
data, _status_code, _headers = create_o_auth_connection_with_http_info(redirect_base, o_auth_connection_type, opts)
|
31
|
+
data
|
32
|
+
end
|
33
|
+
|
34
|
+
# Create an OAuth connection
|
35
|
+
# Configure an inbox for OAuth sync with MailSlurp
|
36
|
+
# @param redirect_base [String]
|
37
|
+
# @param o_auth_connection_type [String]
|
38
|
+
# @param [Hash] opts the optional parameters
|
39
|
+
# @option opts [String] :email_address
|
40
|
+
# @return [Array<(CreateOAuthConnectionResult, Integer, Hash)>] CreateOAuthConnectionResult data, response status code and response headers
|
41
|
+
def create_o_auth_connection_with_http_info(redirect_base, o_auth_connection_type, opts = {})
|
42
|
+
if @api_client.config.debugging
|
43
|
+
@api_client.config.logger.debug 'Calling API: OAuthConnectionApi.create_o_auth_connection ...'
|
44
|
+
end
|
45
|
+
# verify the required parameter 'redirect_base' is set
|
46
|
+
if @api_client.config.client_side_validation && redirect_base.nil?
|
47
|
+
fail ArgumentError, "Missing the required parameter 'redirect_base' when calling OAuthConnectionApi.create_o_auth_connection"
|
48
|
+
end
|
49
|
+
# verify the required parameter 'o_auth_connection_type' is set
|
50
|
+
if @api_client.config.client_side_validation && o_auth_connection_type.nil?
|
51
|
+
fail ArgumentError, "Missing the required parameter 'o_auth_connection_type' when calling OAuthConnectionApi.create_o_auth_connection"
|
52
|
+
end
|
53
|
+
# verify enum value
|
54
|
+
allowable_values = ["GOOGLE", "MICROSOFT"]
|
55
|
+
if @api_client.config.client_side_validation && !allowable_values.include?(o_auth_connection_type)
|
56
|
+
fail ArgumentError, "invalid value for \"o_auth_connection_type\", must be one of #{allowable_values}"
|
57
|
+
end
|
58
|
+
# resource path
|
59
|
+
local_var_path = '/oauth-connection'
|
60
|
+
|
61
|
+
# query parameters
|
62
|
+
query_params = opts[:query_params] || {}
|
63
|
+
query_params[:'redirectBase'] = redirect_base
|
64
|
+
query_params[:'oAuthConnectionType'] = o_auth_connection_type
|
65
|
+
query_params[:'emailAddress'] = opts[:'email_address'] if !opts[:'email_address'].nil?
|
66
|
+
|
67
|
+
# header parameters
|
68
|
+
header_params = opts[:header_params] || {}
|
69
|
+
# HTTP header 'Accept' (if needed)
|
70
|
+
header_params['Accept'] = @api_client.select_header_accept(['*/*'])
|
71
|
+
|
72
|
+
# form parameters
|
73
|
+
form_params = opts[:form_params] || {}
|
74
|
+
|
75
|
+
# http body (model)
|
76
|
+
post_body = opts[:body]
|
77
|
+
|
78
|
+
# return_type
|
79
|
+
return_type = opts[:return_type] || 'CreateOAuthConnectionResult'
|
80
|
+
|
81
|
+
# auth_names
|
82
|
+
auth_names = opts[:auth_names] || ['API_KEY']
|
83
|
+
|
84
|
+
new_options = opts.merge(
|
85
|
+
:header_params => header_params,
|
86
|
+
:query_params => query_params,
|
87
|
+
:form_params => form_params,
|
88
|
+
:body => post_body,
|
89
|
+
:auth_names => auth_names,
|
90
|
+
:return_type => return_type
|
91
|
+
)
|
92
|
+
|
93
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
94
|
+
if @api_client.config.debugging
|
95
|
+
@api_client.config.logger.debug "API called: OAuthConnectionApi#create_o_auth_connection\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
96
|
+
end
|
97
|
+
return data, status_code, headers
|
98
|
+
end
|
99
|
+
|
100
|
+
# Exchange authorization code for access token and create inbox
|
101
|
+
# Exchange an OAuth code for an access token and create an inbox connection in MailSlurp
|
102
|
+
# @param authorization_code [String]
|
103
|
+
# @param redirect_uri [String]
|
104
|
+
# @param [Hash] opts the optional parameters
|
105
|
+
# @return [CreateOAuthExchangeResult]
|
106
|
+
def exchange_authorization_token_and_create_or_update_inbox(authorization_code, redirect_uri, opts = {})
|
107
|
+
data, _status_code, _headers = exchange_authorization_token_and_create_or_update_inbox_with_http_info(authorization_code, redirect_uri, opts)
|
108
|
+
data
|
109
|
+
end
|
110
|
+
|
111
|
+
# Exchange authorization code for access token and create inbox
|
112
|
+
# Exchange an OAuth code for an access token and create an inbox connection in MailSlurp
|
113
|
+
# @param authorization_code [String]
|
114
|
+
# @param redirect_uri [String]
|
115
|
+
# @param [Hash] opts the optional parameters
|
116
|
+
# @return [Array<(CreateOAuthExchangeResult, Integer, Hash)>] CreateOAuthExchangeResult data, response status code and response headers
|
117
|
+
def exchange_authorization_token_and_create_or_update_inbox_with_http_info(authorization_code, redirect_uri, opts = {})
|
118
|
+
if @api_client.config.debugging
|
119
|
+
@api_client.config.logger.debug 'Calling API: OAuthConnectionApi.exchange_authorization_token_and_create_or_update_inbox ...'
|
120
|
+
end
|
121
|
+
# verify the required parameter 'authorization_code' is set
|
122
|
+
if @api_client.config.client_side_validation && authorization_code.nil?
|
123
|
+
fail ArgumentError, "Missing the required parameter 'authorization_code' when calling OAuthConnectionApi.exchange_authorization_token_and_create_or_update_inbox"
|
124
|
+
end
|
125
|
+
# verify the required parameter 'redirect_uri' is set
|
126
|
+
if @api_client.config.client_side_validation && redirect_uri.nil?
|
127
|
+
fail ArgumentError, "Missing the required parameter 'redirect_uri' when calling OAuthConnectionApi.exchange_authorization_token_and_create_or_update_inbox"
|
128
|
+
end
|
129
|
+
# resource path
|
130
|
+
local_var_path = '/oauth-connection/oauth-exchange/google'
|
131
|
+
|
132
|
+
# query parameters
|
133
|
+
query_params = opts[:query_params] || {}
|
134
|
+
query_params[:'authorizationCode'] = authorization_code
|
135
|
+
query_params[:'redirectUri'] = redirect_uri
|
136
|
+
|
137
|
+
# header parameters
|
138
|
+
header_params = opts[:header_params] || {}
|
139
|
+
# HTTP header 'Accept' (if needed)
|
140
|
+
header_params['Accept'] = @api_client.select_header_accept(['*/*'])
|
141
|
+
|
142
|
+
# form parameters
|
143
|
+
form_params = opts[:form_params] || {}
|
144
|
+
|
145
|
+
# http body (model)
|
146
|
+
post_body = opts[:body]
|
147
|
+
|
148
|
+
# return_type
|
149
|
+
return_type = opts[:return_type] || 'CreateOAuthExchangeResult'
|
150
|
+
|
151
|
+
# auth_names
|
152
|
+
auth_names = opts[:auth_names] || ['API_KEY']
|
153
|
+
|
154
|
+
new_options = opts.merge(
|
155
|
+
:header_params => header_params,
|
156
|
+
:query_params => query_params,
|
157
|
+
:form_params => form_params,
|
158
|
+
:body => post_body,
|
159
|
+
:auth_names => auth_names,
|
160
|
+
:return_type => return_type
|
161
|
+
)
|
162
|
+
|
163
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
164
|
+
if @api_client.config.debugging
|
165
|
+
@api_client.config.logger.debug "API called: OAuthConnectionApi#exchange_authorization_token_and_create_or_update_inbox\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
166
|
+
end
|
167
|
+
return data, status_code, headers
|
168
|
+
end
|
169
|
+
end
|
170
|
+
end
|
@@ -83,6 +83,70 @@ module MailSlurpClient
|
|
83
83
|
return data, status_code, headers
|
84
84
|
end
|
85
85
|
|
86
|
+
# Add phone number to your account. Only works if you have already added a plan and an initial phone number in your account and acknowledged the pricing and terms of service by enabling API phone creation.
|
87
|
+
# Create new phone number
|
88
|
+
# @param create_phone_number_options [CreatePhoneNumberOptions]
|
89
|
+
# @param [Hash] opts the optional parameters
|
90
|
+
# @return [PhoneNumberDto]
|
91
|
+
def create_phone_number(create_phone_number_options, opts = {})
|
92
|
+
data, _status_code, _headers = create_phone_number_with_http_info(create_phone_number_options, opts)
|
93
|
+
data
|
94
|
+
end
|
95
|
+
|
96
|
+
# Add phone number to your account. Only works if you have already added a plan and an initial phone number in your account and acknowledged the pricing and terms of service by enabling API phone creation.
|
97
|
+
# Create new phone number
|
98
|
+
# @param create_phone_number_options [CreatePhoneNumberOptions]
|
99
|
+
# @param [Hash] opts the optional parameters
|
100
|
+
# @return [Array<(PhoneNumberDto, Integer, Hash)>] PhoneNumberDto data, response status code and response headers
|
101
|
+
def create_phone_number_with_http_info(create_phone_number_options, opts = {})
|
102
|
+
if @api_client.config.debugging
|
103
|
+
@api_client.config.logger.debug 'Calling API: PhoneControllerApi.create_phone_number ...'
|
104
|
+
end
|
105
|
+
# verify the required parameter 'create_phone_number_options' is set
|
106
|
+
if @api_client.config.client_side_validation && create_phone_number_options.nil?
|
107
|
+
fail ArgumentError, "Missing the required parameter 'create_phone_number_options' when calling PhoneControllerApi.create_phone_number"
|
108
|
+
end
|
109
|
+
# resource path
|
110
|
+
local_var_path = '/phone'
|
111
|
+
|
112
|
+
# query parameters
|
113
|
+
query_params = opts[:query_params] || {}
|
114
|
+
|
115
|
+
# header parameters
|
116
|
+
header_params = opts[:header_params] || {}
|
117
|
+
# HTTP header 'Accept' (if needed)
|
118
|
+
header_params['Accept'] = @api_client.select_header_accept(['*/*'])
|
119
|
+
# HTTP header 'Content-Type'
|
120
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
121
|
+
|
122
|
+
# form parameters
|
123
|
+
form_params = opts[:form_params] || {}
|
124
|
+
|
125
|
+
# http body (model)
|
126
|
+
post_body = opts[:body] || @api_client.object_to_http_body(create_phone_number_options)
|
127
|
+
|
128
|
+
# return_type
|
129
|
+
return_type = opts[:return_type] || 'PhoneNumberDto'
|
130
|
+
|
131
|
+
# auth_names
|
132
|
+
auth_names = opts[:auth_names] || ['API_KEY']
|
133
|
+
|
134
|
+
new_options = opts.merge(
|
135
|
+
:header_params => header_params,
|
136
|
+
:query_params => query_params,
|
137
|
+
:form_params => form_params,
|
138
|
+
:body => post_body,
|
139
|
+
:auth_names => auth_names,
|
140
|
+
:return_type => return_type
|
141
|
+
)
|
142
|
+
|
143
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
144
|
+
if @api_client.config.debugging
|
145
|
+
@api_client.config.logger.debug "API called: PhoneControllerApi#create_phone_number\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
146
|
+
end
|
147
|
+
return data, status_code, headers
|
148
|
+
end
|
149
|
+
|
86
150
|
# Delete an emergency address
|
87
151
|
# Delete an emergency address
|
88
152
|
# @param address_id [String]
|
@@ -205,6 +269,68 @@ module MailSlurpClient
|
|
205
269
|
return data, status_code, headers
|
206
270
|
end
|
207
271
|
|
272
|
+
# Get the latest messages for all phones
|
273
|
+
# List all message threads for all phones
|
274
|
+
# @param [Hash] opts the optional parameters
|
275
|
+
# @option opts [Integer] :page (default to 0)
|
276
|
+
# @option opts [Integer] :size (default to 20)
|
277
|
+
# @return [PagePhoneMessageThreadProjection]
|
278
|
+
def get_all_phone_message_threads(opts = {})
|
279
|
+
data, _status_code, _headers = get_all_phone_message_threads_with_http_info(opts)
|
280
|
+
data
|
281
|
+
end
|
282
|
+
|
283
|
+
# Get the latest messages for all phones
|
284
|
+
# List all message threads for all phones
|
285
|
+
# @param [Hash] opts the optional parameters
|
286
|
+
# @option opts [Integer] :page
|
287
|
+
# @option opts [Integer] :size
|
288
|
+
# @return [Array<(PagePhoneMessageThreadProjection, Integer, Hash)>] PagePhoneMessageThreadProjection data, response status code and response headers
|
289
|
+
def get_all_phone_message_threads_with_http_info(opts = {})
|
290
|
+
if @api_client.config.debugging
|
291
|
+
@api_client.config.logger.debug 'Calling API: PhoneControllerApi.get_all_phone_message_threads ...'
|
292
|
+
end
|
293
|
+
# resource path
|
294
|
+
local_var_path = '/phone/numbers/message-threads'
|
295
|
+
|
296
|
+
# query parameters
|
297
|
+
query_params = opts[:query_params] || {}
|
298
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
299
|
+
query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
|
300
|
+
|
301
|
+
# header parameters
|
302
|
+
header_params = opts[:header_params] || {}
|
303
|
+
# HTTP header 'Accept' (if needed)
|
304
|
+
header_params['Accept'] = @api_client.select_header_accept(['*/*'])
|
305
|
+
|
306
|
+
# form parameters
|
307
|
+
form_params = opts[:form_params] || {}
|
308
|
+
|
309
|
+
# http body (model)
|
310
|
+
post_body = opts[:body]
|
311
|
+
|
312
|
+
# return_type
|
313
|
+
return_type = opts[:return_type] || 'PagePhoneMessageThreadProjection'
|
314
|
+
|
315
|
+
# auth_names
|
316
|
+
auth_names = opts[:auth_names] || ['API_KEY']
|
317
|
+
|
318
|
+
new_options = opts.merge(
|
319
|
+
:header_params => header_params,
|
320
|
+
:query_params => query_params,
|
321
|
+
:form_params => form_params,
|
322
|
+
:body => post_body,
|
323
|
+
:auth_names => auth_names,
|
324
|
+
:return_type => return_type
|
325
|
+
)
|
326
|
+
|
327
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
328
|
+
if @api_client.config.debugging
|
329
|
+
@api_client.config.logger.debug "API called: PhoneControllerApi#get_all_phone_message_threads\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
330
|
+
end
|
331
|
+
return data, status_code, headers
|
332
|
+
end
|
333
|
+
|
208
334
|
# Get consent status
|
209
335
|
# Get the status of phone usage consent
|
210
336
|
# @param [Hash] opts the optional parameters
|
@@ -379,6 +505,148 @@ module MailSlurpClient
|
|
379
505
|
return data, status_code, headers
|
380
506
|
end
|
381
507
|
|
508
|
+
# Get messages in a phone thread
|
509
|
+
# List message thread messages for a phone message thread
|
510
|
+
# @param phone_number_id [String]
|
511
|
+
# @param other_number [String]
|
512
|
+
# @param [Hash] opts the optional parameters
|
513
|
+
# @option opts [Integer] :page (default to 0)
|
514
|
+
# @option opts [Integer] :size (default to 20)
|
515
|
+
# @return [PagePhoneMessageThreadItemProjection]
|
516
|
+
def get_phone_message_thread_items(phone_number_id, other_number, opts = {})
|
517
|
+
data, _status_code, _headers = get_phone_message_thread_items_with_http_info(phone_number_id, other_number, opts)
|
518
|
+
data
|
519
|
+
end
|
520
|
+
|
521
|
+
# Get messages in a phone thread
|
522
|
+
# List message thread messages for a phone message thread
|
523
|
+
# @param phone_number_id [String]
|
524
|
+
# @param other_number [String]
|
525
|
+
# @param [Hash] opts the optional parameters
|
526
|
+
# @option opts [Integer] :page
|
527
|
+
# @option opts [Integer] :size
|
528
|
+
# @return [Array<(PagePhoneMessageThreadItemProjection, Integer, Hash)>] PagePhoneMessageThreadItemProjection data, response status code and response headers
|
529
|
+
def get_phone_message_thread_items_with_http_info(phone_number_id, other_number, opts = {})
|
530
|
+
if @api_client.config.debugging
|
531
|
+
@api_client.config.logger.debug 'Calling API: PhoneControllerApi.get_phone_message_thread_items ...'
|
532
|
+
end
|
533
|
+
# verify the required parameter 'phone_number_id' is set
|
534
|
+
if @api_client.config.client_side_validation && phone_number_id.nil?
|
535
|
+
fail ArgumentError, "Missing the required parameter 'phone_number_id' when calling PhoneControllerApi.get_phone_message_thread_items"
|
536
|
+
end
|
537
|
+
# verify the required parameter 'other_number' is set
|
538
|
+
if @api_client.config.client_side_validation && other_number.nil?
|
539
|
+
fail ArgumentError, "Missing the required parameter 'other_number' when calling PhoneControllerApi.get_phone_message_thread_items"
|
540
|
+
end
|
541
|
+
# resource path
|
542
|
+
local_var_path = '/phone/numbers/{phoneNumberId}/message-threads/{otherNumber}'.sub('{' + 'phoneNumberId' + '}', CGI.escape(phone_number_id.to_s)).sub('{' + 'otherNumber' + '}', CGI.escape(other_number.to_s))
|
543
|
+
|
544
|
+
# query parameters
|
545
|
+
query_params = opts[:query_params] || {}
|
546
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
547
|
+
query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
|
548
|
+
|
549
|
+
# header parameters
|
550
|
+
header_params = opts[:header_params] || {}
|
551
|
+
# HTTP header 'Accept' (if needed)
|
552
|
+
header_params['Accept'] = @api_client.select_header_accept(['*/*'])
|
553
|
+
|
554
|
+
# form parameters
|
555
|
+
form_params = opts[:form_params] || {}
|
556
|
+
|
557
|
+
# http body (model)
|
558
|
+
post_body = opts[:body]
|
559
|
+
|
560
|
+
# return_type
|
561
|
+
return_type = opts[:return_type] || 'PagePhoneMessageThreadItemProjection'
|
562
|
+
|
563
|
+
# auth_names
|
564
|
+
auth_names = opts[:auth_names] || ['API_KEY']
|
565
|
+
|
566
|
+
new_options = opts.merge(
|
567
|
+
:header_params => header_params,
|
568
|
+
:query_params => query_params,
|
569
|
+
:form_params => form_params,
|
570
|
+
:body => post_body,
|
571
|
+
:auth_names => auth_names,
|
572
|
+
:return_type => return_type
|
573
|
+
)
|
574
|
+
|
575
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
576
|
+
if @api_client.config.debugging
|
577
|
+
@api_client.config.logger.debug "API called: PhoneControllerApi#get_phone_message_thread_items\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
578
|
+
end
|
579
|
+
return data, status_code, headers
|
580
|
+
end
|
581
|
+
|
582
|
+
# Get the latest message preview for a thread
|
583
|
+
# List message threads for a phone
|
584
|
+
# @param phone_number_id [String]
|
585
|
+
# @param [Hash] opts the optional parameters
|
586
|
+
# @option opts [Integer] :page (default to 0)
|
587
|
+
# @option opts [Integer] :size (default to 20)
|
588
|
+
# @return [PagePhoneMessageThreadProjection]
|
589
|
+
def get_phone_message_threads(phone_number_id, opts = {})
|
590
|
+
data, _status_code, _headers = get_phone_message_threads_with_http_info(phone_number_id, opts)
|
591
|
+
data
|
592
|
+
end
|
593
|
+
|
594
|
+
# Get the latest message preview for a thread
|
595
|
+
# List message threads for a phone
|
596
|
+
# @param phone_number_id [String]
|
597
|
+
# @param [Hash] opts the optional parameters
|
598
|
+
# @option opts [Integer] :page
|
599
|
+
# @option opts [Integer] :size
|
600
|
+
# @return [Array<(PagePhoneMessageThreadProjection, Integer, Hash)>] PagePhoneMessageThreadProjection data, response status code and response headers
|
601
|
+
def get_phone_message_threads_with_http_info(phone_number_id, opts = {})
|
602
|
+
if @api_client.config.debugging
|
603
|
+
@api_client.config.logger.debug 'Calling API: PhoneControllerApi.get_phone_message_threads ...'
|
604
|
+
end
|
605
|
+
# verify the required parameter 'phone_number_id' is set
|
606
|
+
if @api_client.config.client_side_validation && phone_number_id.nil?
|
607
|
+
fail ArgumentError, "Missing the required parameter 'phone_number_id' when calling PhoneControllerApi.get_phone_message_threads"
|
608
|
+
end
|
609
|
+
# resource path
|
610
|
+
local_var_path = '/phone/numbers/{phoneNumberId}/message-threads'.sub('{' + 'phoneNumberId' + '}', CGI.escape(phone_number_id.to_s))
|
611
|
+
|
612
|
+
# query parameters
|
613
|
+
query_params = opts[:query_params] || {}
|
614
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
615
|
+
query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
|
616
|
+
|
617
|
+
# header parameters
|
618
|
+
header_params = opts[:header_params] || {}
|
619
|
+
# HTTP header 'Accept' (if needed)
|
620
|
+
header_params['Accept'] = @api_client.select_header_accept(['*/*'])
|
621
|
+
|
622
|
+
# form parameters
|
623
|
+
form_params = opts[:form_params] || {}
|
624
|
+
|
625
|
+
# http body (model)
|
626
|
+
post_body = opts[:body]
|
627
|
+
|
628
|
+
# return_type
|
629
|
+
return_type = opts[:return_type] || 'PagePhoneMessageThreadProjection'
|
630
|
+
|
631
|
+
# auth_names
|
632
|
+
auth_names = opts[:auth_names] || ['API_KEY']
|
633
|
+
|
634
|
+
new_options = opts.merge(
|
635
|
+
:header_params => header_params,
|
636
|
+
:query_params => query_params,
|
637
|
+
:form_params => form_params,
|
638
|
+
:body => post_body,
|
639
|
+
:auth_names => auth_names,
|
640
|
+
:return_type => return_type
|
641
|
+
)
|
642
|
+
|
643
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
644
|
+
if @api_client.config.debugging
|
645
|
+
@api_client.config.logger.debug "API called: PhoneControllerApi#get_phone_message_threads\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
646
|
+
end
|
647
|
+
return data, status_code, headers
|
648
|
+
end
|
649
|
+
|
382
650
|
# Get a phone number by ID
|
383
651
|
# Get a phone number by ID
|
384
652
|
# @param phone_number_id [String]
|
@@ -476,7 +744,7 @@ module MailSlurpClient
|
|
476
744
|
if @api_client.config.debugging
|
477
745
|
@api_client.config.logger.debug 'Calling API: PhoneControllerApi.get_phone_numbers ...'
|
478
746
|
end
|
479
|
-
allowable_values = ["US", "GB", "AU"]
|
747
|
+
allowable_values = ["US", "GB", "AU", "CA", "EE", "HK", "PL", "CH", "PT", "NL", "IL", "SE"]
|
480
748
|
if @api_client.config.client_side_validation && opts[:'phone_country'] && !allowable_values.include?(opts[:'phone_country'])
|
481
749
|
fail ArgumentError, "invalid value for \"phone_country\", must be one of #{allowable_values}"
|
482
750
|
end
|