mailslurp_client 12.6.0 → 12.6.1
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 +1 -0
- data/lib/mailslurp_client/api/inbox_controller_api.rb +92 -10
- data/lib/mailslurp_client/api/sent_emails_controller_api.rb +150 -4
- data/lib/mailslurp_client/api/tracking_controller_api.rb +5 -2
- data/lib/mailslurp_client/api/webhook_controller_api.rb +55 -1
- data/lib/mailslurp_client/models/abstract_webhook_payload.rb +3 -3
- data/lib/mailslurp_client/models/create_webhook_options.rb +3 -3
- data/lib/mailslurp_client/models/tracking_pixel_dto.rb +42 -1
- data/lib/mailslurp_client/models/tracking_pixel_projection.rb +28 -1
- data/lib/mailslurp_client/models/webhook_dto.rb +2 -2
- data/lib/mailslurp_client/models/webhook_email_opened_payload.rb +322 -0
- data/lib/mailslurp_client/models/webhook_new_attachment_payload.rb +2 -2
- data/lib/mailslurp_client/models/webhook_new_contact_payload.rb +2 -2
- data/lib/mailslurp_client/models/webhook_new_email_payload.rb +2 -2
- data/lib/mailslurp_client/models/webhook_result_entity.rb +2 -2
- data/lib/mailslurp_client/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2ddb6d7997eafd08191d6d69bf3a74dab0213c73391f70e844ccba68390c3d10
|
4
|
+
data.tar.gz: a22e111da54971b22b7d8523553331c81cf0c70d53d06013703965c5e5c2e42a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 24a5291dc9eef3efbdbd802553e4bbbc7de663d73fbabee02d952e19ec3e97c21a9ab41e8c59cd4cd966112524349ba1334b4cf8c6d2c00716f4611edcb18a73
|
7
|
+
data.tar.gz: ea391088c7c1bd7658c8c616cc3af1e29bdf09177b8ece9847f8617c89d30661f39220b434932d6d8314e93d98e6c4a6441e99fb23e96826115a477b1b68777d
|
data/lib/mailslurp_client.rb
CHANGED
@@ -121,6 +121,7 @@ require 'mailslurp_client/models/validation_message'
|
|
121
121
|
require 'mailslurp_client/models/verify_email_address_options'
|
122
122
|
require 'mailslurp_client/models/wait_for_conditions'
|
123
123
|
require 'mailslurp_client/models/webhook_dto'
|
124
|
+
require 'mailslurp_client/models/webhook_email_opened_payload'
|
124
125
|
require 'mailslurp_client/models/webhook_new_attachment_payload'
|
125
126
|
require 'mailslurp_client/models/webhook_new_contact_payload'
|
126
127
|
require 'mailslurp_client/models/webhook_new_email_payload'
|
@@ -114,10 +114,10 @@ module MailSlurpClient
|
|
114
114
|
# @param inbox_id [String] inboxId
|
115
115
|
# @param create_inbox_ruleset_options [CreateInboxRulesetOptions] createInboxRulesetOptions
|
116
116
|
# @param [Hash] opts the optional parameters
|
117
|
-
# @return [
|
117
|
+
# @return [InboxRulesetDto]
|
118
118
|
def create_inbox_ruleset(inbox_id, create_inbox_ruleset_options, opts = {})
|
119
|
-
create_inbox_ruleset_with_http_info(inbox_id, create_inbox_ruleset_options, opts)
|
120
|
-
|
119
|
+
data, _status_code, _headers = create_inbox_ruleset_with_http_info(inbox_id, create_inbox_ruleset_options, opts)
|
120
|
+
data
|
121
121
|
end
|
122
122
|
|
123
123
|
# Create an inbox ruleset
|
@@ -125,7 +125,7 @@ module MailSlurpClient
|
|
125
125
|
# @param inbox_id [String] inboxId
|
126
126
|
# @param create_inbox_ruleset_options [CreateInboxRulesetOptions] createInboxRulesetOptions
|
127
127
|
# @param [Hash] opts the optional parameters
|
128
|
-
# @return [Array<(
|
128
|
+
# @return [Array<(InboxRulesetDto, Integer, Hash)>] InboxRulesetDto data, response status code and response headers
|
129
129
|
def create_inbox_ruleset_with_http_info(inbox_id, create_inbox_ruleset_options, opts = {})
|
130
130
|
if @api_client.config.debugging
|
131
131
|
@api_client.config.logger.debug 'Calling API: InboxControllerApi.create_inbox_ruleset ...'
|
@@ -146,6 +146,8 @@ module MailSlurpClient
|
|
146
146
|
|
147
147
|
# header parameters
|
148
148
|
header_params = opts[:header_params] || {}
|
149
|
+
# HTTP header 'Accept' (if needed)
|
150
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
149
151
|
# HTTP header 'Content-Type'
|
150
152
|
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
151
153
|
|
@@ -156,7 +158,7 @@ module MailSlurpClient
|
|
156
158
|
post_body = opts[:body] || @api_client.object_to_http_body(create_inbox_ruleset_options)
|
157
159
|
|
158
160
|
# return_type
|
159
|
-
return_type = opts[:return_type]
|
161
|
+
return_type = opts[:return_type] || 'InboxRulesetDto'
|
160
162
|
|
161
163
|
# auth_names
|
162
164
|
auth_names = opts[:auth_names] || ['API_KEY']
|
@@ -991,10 +993,10 @@ module MailSlurpClient
|
|
991
993
|
# @option opts [String] :search_filter Optional search filter
|
992
994
|
# @option opts [Integer] :size Optional page size in inbox ruleset list pagination (default to 20)
|
993
995
|
# @option opts [String] :sort Optional createdAt sort direction ASC or DESC (default to 'ASC')
|
994
|
-
# @return [
|
996
|
+
# @return [PageInboxRulesetDto]
|
995
997
|
def list_inbox_rulesets(inbox_id, opts = {})
|
996
|
-
list_inbox_rulesets_with_http_info(inbox_id, opts)
|
997
|
-
|
998
|
+
data, _status_code, _headers = list_inbox_rulesets_with_http_info(inbox_id, opts)
|
999
|
+
data
|
998
1000
|
end
|
999
1001
|
|
1000
1002
|
# List inbox rulesets
|
@@ -1005,7 +1007,7 @@ module MailSlurpClient
|
|
1005
1007
|
# @option opts [String] :search_filter Optional search filter
|
1006
1008
|
# @option opts [Integer] :size Optional page size in inbox ruleset list pagination
|
1007
1009
|
# @option opts [String] :sort Optional createdAt sort direction ASC or DESC
|
1008
|
-
# @return [Array<(
|
1010
|
+
# @return [Array<(PageInboxRulesetDto, Integer, Hash)>] PageInboxRulesetDto data, response status code and response headers
|
1009
1011
|
def list_inbox_rulesets_with_http_info(inbox_id, opts = {})
|
1010
1012
|
if @api_client.config.debugging
|
1011
1013
|
@api_client.config.logger.debug 'Calling API: InboxControllerApi.list_inbox_rulesets ...'
|
@@ -1030,6 +1032,8 @@ module MailSlurpClient
|
|
1030
1032
|
|
1031
1033
|
# header parameters
|
1032
1034
|
header_params = opts[:header_params] || {}
|
1035
|
+
# HTTP header 'Accept' (if needed)
|
1036
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
1033
1037
|
|
1034
1038
|
# form parameters
|
1035
1039
|
form_params = opts[:form_params] || {}
|
@@ -1038,7 +1042,7 @@ module MailSlurpClient
|
|
1038
1042
|
post_body = opts[:body]
|
1039
1043
|
|
1040
1044
|
# return_type
|
1041
|
-
return_type = opts[:return_type]
|
1045
|
+
return_type = opts[:return_type] || 'PageInboxRulesetDto'
|
1042
1046
|
|
1043
1047
|
# auth_names
|
1044
1048
|
auth_names = opts[:auth_names] || ['API_KEY']
|
@@ -1059,6 +1063,84 @@ module MailSlurpClient
|
|
1059
1063
|
return data, status_code, headers
|
1060
1064
|
end
|
1061
1065
|
|
1066
|
+
# List inbox tracking pixels
|
1067
|
+
# List all tracking pixels sent from an inbox
|
1068
|
+
# @param inbox_id [String] inboxId
|
1069
|
+
# @param [Hash] opts the optional parameters
|
1070
|
+
# @option opts [Integer] :page Optional page index in inbox tracking pixel list pagination (default to 0)
|
1071
|
+
# @option opts [String] :search_filter Optional search filter
|
1072
|
+
# @option opts [Integer] :size Optional page size in inbox tracking pixel list pagination (default to 20)
|
1073
|
+
# @option opts [String] :sort Optional createdAt sort direction ASC or DESC (default to 'ASC')
|
1074
|
+
# @return [PageTrackingPixelProjection]
|
1075
|
+
def list_inbox_tracking_pixels(inbox_id, opts = {})
|
1076
|
+
data, _status_code, _headers = list_inbox_tracking_pixels_with_http_info(inbox_id, opts)
|
1077
|
+
data
|
1078
|
+
end
|
1079
|
+
|
1080
|
+
# List inbox tracking pixels
|
1081
|
+
# List all tracking pixels sent from an inbox
|
1082
|
+
# @param inbox_id [String] inboxId
|
1083
|
+
# @param [Hash] opts the optional parameters
|
1084
|
+
# @option opts [Integer] :page Optional page index in inbox tracking pixel list pagination
|
1085
|
+
# @option opts [String] :search_filter Optional search filter
|
1086
|
+
# @option opts [Integer] :size Optional page size in inbox tracking pixel list pagination
|
1087
|
+
# @option opts [String] :sort Optional createdAt sort direction ASC or DESC
|
1088
|
+
# @return [Array<(PageTrackingPixelProjection, Integer, Hash)>] PageTrackingPixelProjection data, response status code and response headers
|
1089
|
+
def list_inbox_tracking_pixels_with_http_info(inbox_id, opts = {})
|
1090
|
+
if @api_client.config.debugging
|
1091
|
+
@api_client.config.logger.debug 'Calling API: InboxControllerApi.list_inbox_tracking_pixels ...'
|
1092
|
+
end
|
1093
|
+
# verify the required parameter 'inbox_id' is set
|
1094
|
+
if @api_client.config.client_side_validation && inbox_id.nil?
|
1095
|
+
fail ArgumentError, "Missing the required parameter 'inbox_id' when calling InboxControllerApi.list_inbox_tracking_pixels"
|
1096
|
+
end
|
1097
|
+
allowable_values = ["ASC", "DESC"]
|
1098
|
+
if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
|
1099
|
+
fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
|
1100
|
+
end
|
1101
|
+
# resource path
|
1102
|
+
local_var_path = '/inboxes/{inboxId}/tracking-pixels'.sub('{' + 'inboxId' + '}', CGI.escape(inbox_id.to_s))
|
1103
|
+
|
1104
|
+
# query parameters
|
1105
|
+
query_params = opts[:query_params] || {}
|
1106
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
1107
|
+
query_params[:'searchFilter'] = opts[:'search_filter'] if !opts[:'search_filter'].nil?
|
1108
|
+
query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
|
1109
|
+
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
|
1110
|
+
|
1111
|
+
# header parameters
|
1112
|
+
header_params = opts[:header_params] || {}
|
1113
|
+
# HTTP header 'Accept' (if needed)
|
1114
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
1115
|
+
|
1116
|
+
# form parameters
|
1117
|
+
form_params = opts[:form_params] || {}
|
1118
|
+
|
1119
|
+
# http body (model)
|
1120
|
+
post_body = opts[:body]
|
1121
|
+
|
1122
|
+
# return_type
|
1123
|
+
return_type = opts[:return_type] || 'PageTrackingPixelProjection'
|
1124
|
+
|
1125
|
+
# auth_names
|
1126
|
+
auth_names = opts[:auth_names] || ['API_KEY']
|
1127
|
+
|
1128
|
+
new_options = opts.merge(
|
1129
|
+
:header_params => header_params,
|
1130
|
+
:query_params => query_params,
|
1131
|
+
:form_params => form_params,
|
1132
|
+
:body => post_body,
|
1133
|
+
:auth_names => auth_names,
|
1134
|
+
:return_type => return_type
|
1135
|
+
)
|
1136
|
+
|
1137
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
1138
|
+
if @api_client.config.debugging
|
1139
|
+
@api_client.config.logger.debug "API called: InboxControllerApi#list_inbox_tracking_pixels\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1140
|
+
end
|
1141
|
+
return data, status_code, headers
|
1142
|
+
end
|
1143
|
+
|
1062
1144
|
# Send Email
|
1063
1145
|
# Send an email from an inbox's email address. The request body should contain the `SendEmailOptions` that include recipients, attachments, body etc. See `SendEmailOptions` for all available properties. Note the `inboxId` refers to the inbox's id not the inbox's email address. See https://www.mailslurp.com/guides/ for more information on how to send emails. This method does not return a sent email entity due to legacy reasons. To send and get a sent email as returned response use the sister method `sendEmailAndConfirm`.
|
1064
1146
|
# @param inbox_id [String] ID of the inbox you want to send the email from
|
@@ -19,6 +19,76 @@ module MailSlurpClient
|
|
19
19
|
def initialize(api_client = ApiClient.default)
|
20
20
|
@api_client = api_client
|
21
21
|
end
|
22
|
+
# Get all sent email tracking pixels in paginated form
|
23
|
+
# @param [Hash] opts the optional parameters
|
24
|
+
# @option opts [Integer] :page Optional page index in sent email tracking pixel list pagination (default to 0)
|
25
|
+
# @option opts [String] :search_filter Optional search filter
|
26
|
+
# @option opts [Integer] :size Optional page size in sent email tracking pixel list pagination (default to 20)
|
27
|
+
# @option opts [String] :sort Optional createdAt sort direction ASC or DESC (default to 'ASC')
|
28
|
+
# @return [PageTrackingPixelProjection]
|
29
|
+
def get_all_sent_tracking_pixels(opts = {})
|
30
|
+
data, _status_code, _headers = get_all_sent_tracking_pixels_with_http_info(opts)
|
31
|
+
data
|
32
|
+
end
|
33
|
+
|
34
|
+
# Get all sent email tracking pixels in paginated form
|
35
|
+
# @param [Hash] opts the optional parameters
|
36
|
+
# @option opts [Integer] :page Optional page index in sent email tracking pixel list pagination
|
37
|
+
# @option opts [String] :search_filter Optional search filter
|
38
|
+
# @option opts [Integer] :size Optional page size in sent email tracking pixel list pagination
|
39
|
+
# @option opts [String] :sort Optional createdAt sort direction ASC or DESC
|
40
|
+
# @return [Array<(PageTrackingPixelProjection, Integer, Hash)>] PageTrackingPixelProjection data, response status code and response headers
|
41
|
+
def get_all_sent_tracking_pixels_with_http_info(opts = {})
|
42
|
+
if @api_client.config.debugging
|
43
|
+
@api_client.config.logger.debug 'Calling API: SentEmailsControllerApi.get_all_sent_tracking_pixels ...'
|
44
|
+
end
|
45
|
+
allowable_values = ["ASC", "DESC"]
|
46
|
+
if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
|
47
|
+
fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
|
48
|
+
end
|
49
|
+
# resource path
|
50
|
+
local_var_path = '/sent/tracking-pixels'
|
51
|
+
|
52
|
+
# query parameters
|
53
|
+
query_params = opts[:query_params] || {}
|
54
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
55
|
+
query_params[:'searchFilter'] = opts[:'search_filter'] if !opts[:'search_filter'].nil?
|
56
|
+
query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
|
57
|
+
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
|
58
|
+
|
59
|
+
# header parameters
|
60
|
+
header_params = opts[:header_params] || {}
|
61
|
+
# HTTP header 'Accept' (if needed)
|
62
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
63
|
+
|
64
|
+
# form parameters
|
65
|
+
form_params = opts[:form_params] || {}
|
66
|
+
|
67
|
+
# http body (model)
|
68
|
+
post_body = opts[:body]
|
69
|
+
|
70
|
+
# return_type
|
71
|
+
return_type = opts[:return_type] || 'PageTrackingPixelProjection'
|
72
|
+
|
73
|
+
# auth_names
|
74
|
+
auth_names = opts[:auth_names] || ['API_KEY']
|
75
|
+
|
76
|
+
new_options = opts.merge(
|
77
|
+
:header_params => header_params,
|
78
|
+
:query_params => query_params,
|
79
|
+
:form_params => form_params,
|
80
|
+
:body => post_body,
|
81
|
+
:auth_names => auth_names,
|
82
|
+
:return_type => return_type
|
83
|
+
)
|
84
|
+
|
85
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
86
|
+
if @api_client.config.debugging
|
87
|
+
@api_client.config.logger.debug "API called: SentEmailsControllerApi#get_all_sent_tracking_pixels\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
88
|
+
end
|
89
|
+
return data, status_code, headers
|
90
|
+
end
|
91
|
+
|
22
92
|
# Get sent email receipt
|
23
93
|
# @param id [String] id
|
24
94
|
# @param [Hash] opts the optional parameters
|
@@ -79,6 +149,82 @@ module MailSlurpClient
|
|
79
149
|
return data, status_code, headers
|
80
150
|
end
|
81
151
|
|
152
|
+
# Get all tracking pixels for a sent email in paginated form
|
153
|
+
# @param id [String] id
|
154
|
+
# @param [Hash] opts the optional parameters
|
155
|
+
# @option opts [Integer] :page Optional page index in sent email tracking pixel list pagination (default to 0)
|
156
|
+
# @option opts [String] :search_filter Optional search filter
|
157
|
+
# @option opts [Integer] :size Optional page size in sent email tracking pixel list pagination (default to 20)
|
158
|
+
# @option opts [String] :sort Optional createdAt sort direction ASC or DESC (default to 'ASC')
|
159
|
+
# @return [PageTrackingPixelProjection]
|
160
|
+
def get_sent_email_tracking_pixels(id, opts = {})
|
161
|
+
data, _status_code, _headers = get_sent_email_tracking_pixels_with_http_info(id, opts)
|
162
|
+
data
|
163
|
+
end
|
164
|
+
|
165
|
+
# Get all tracking pixels for a sent email in paginated form
|
166
|
+
# @param id [String] id
|
167
|
+
# @param [Hash] opts the optional parameters
|
168
|
+
# @option opts [Integer] :page Optional page index in sent email tracking pixel list pagination
|
169
|
+
# @option opts [String] :search_filter Optional search filter
|
170
|
+
# @option opts [Integer] :size Optional page size in sent email tracking pixel list pagination
|
171
|
+
# @option opts [String] :sort Optional createdAt sort direction ASC or DESC
|
172
|
+
# @return [Array<(PageTrackingPixelProjection, Integer, Hash)>] PageTrackingPixelProjection data, response status code and response headers
|
173
|
+
def get_sent_email_tracking_pixels_with_http_info(id, opts = {})
|
174
|
+
if @api_client.config.debugging
|
175
|
+
@api_client.config.logger.debug 'Calling API: SentEmailsControllerApi.get_sent_email_tracking_pixels ...'
|
176
|
+
end
|
177
|
+
# verify the required parameter 'id' is set
|
178
|
+
if @api_client.config.client_side_validation && id.nil?
|
179
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling SentEmailsControllerApi.get_sent_email_tracking_pixels"
|
180
|
+
end
|
181
|
+
allowable_values = ["ASC", "DESC"]
|
182
|
+
if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
|
183
|
+
fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
|
184
|
+
end
|
185
|
+
# resource path
|
186
|
+
local_var_path = '/sent/{id}/tracking-pixels'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
187
|
+
|
188
|
+
# query parameters
|
189
|
+
query_params = opts[:query_params] || {}
|
190
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
191
|
+
query_params[:'searchFilter'] = opts[:'search_filter'] if !opts[:'search_filter'].nil?
|
192
|
+
query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
|
193
|
+
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
|
194
|
+
|
195
|
+
# header parameters
|
196
|
+
header_params = opts[:header_params] || {}
|
197
|
+
# HTTP header 'Accept' (if needed)
|
198
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
199
|
+
|
200
|
+
# form parameters
|
201
|
+
form_params = opts[:form_params] || {}
|
202
|
+
|
203
|
+
# http body (model)
|
204
|
+
post_body = opts[:body]
|
205
|
+
|
206
|
+
# return_type
|
207
|
+
return_type = opts[:return_type] || 'PageTrackingPixelProjection'
|
208
|
+
|
209
|
+
# auth_names
|
210
|
+
auth_names = opts[:auth_names] || ['API_KEY']
|
211
|
+
|
212
|
+
new_options = opts.merge(
|
213
|
+
:header_params => header_params,
|
214
|
+
:query_params => query_params,
|
215
|
+
:form_params => form_params,
|
216
|
+
:body => post_body,
|
217
|
+
:auth_names => auth_names,
|
218
|
+
:return_type => return_type
|
219
|
+
)
|
220
|
+
|
221
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
222
|
+
if @api_client.config.debugging
|
223
|
+
@api_client.config.logger.debug "API called: SentEmailsControllerApi#get_sent_email_tracking_pixels\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
224
|
+
end
|
225
|
+
return data, status_code, headers
|
226
|
+
end
|
227
|
+
|
82
228
|
# Get all sent emails in paginated form
|
83
229
|
# @param [Hash] opts the optional parameters
|
84
230
|
# @option opts [String] :inbox_id Optional inboxId to filter sender of sent emails by
|
@@ -155,9 +301,9 @@ module MailSlurpClient
|
|
155
301
|
# Get all sent organization emails in paginated form
|
156
302
|
# @param [Hash] opts the optional parameters
|
157
303
|
# @option opts [String] :inbox_id Optional inboxId to filter sender of sent emails by
|
158
|
-
# @option opts [Integer] :page Optional page index in
|
304
|
+
# @option opts [Integer] :page Optional page index in sent email list pagination (default to 0)
|
159
305
|
# @option opts [String] :search_filter Optional search filter
|
160
|
-
# @option opts [Integer] :size Optional page size in
|
306
|
+
# @option opts [Integer] :size Optional page size in sent email list pagination (default to 20)
|
161
307
|
# @option opts [String] :sort Optional createdAt sort direction ASC or DESC (default to 'ASC')
|
162
308
|
# @return [PageSentEmailProjection]
|
163
309
|
def get_sent_organization_emails(opts = {})
|
@@ -168,9 +314,9 @@ module MailSlurpClient
|
|
168
314
|
# Get all sent organization emails in paginated form
|
169
315
|
# @param [Hash] opts the optional parameters
|
170
316
|
# @option opts [String] :inbox_id Optional inboxId to filter sender of sent emails by
|
171
|
-
# @option opts [Integer] :page Optional page index in
|
317
|
+
# @option opts [Integer] :page Optional page index in sent email list pagination
|
172
318
|
# @option opts [String] :search_filter Optional search filter
|
173
|
-
# @option opts [Integer] :size Optional page size in
|
319
|
+
# @option opts [Integer] :size Optional page size in sent email list pagination
|
174
320
|
# @option opts [String] :sort Optional createdAt sort direction ASC or DESC
|
175
321
|
# @return [Array<(PageSentEmailProjection, Integer, Hash)>] PageSentEmailProjection data, response status code and response headers
|
176
322
|
def get_sent_organization_emails_with_http_info(opts = {})
|
@@ -20,7 +20,7 @@ module MailSlurpClient
|
|
20
20
|
@api_client = api_client
|
21
21
|
end
|
22
22
|
# Create tracking pixel
|
23
|
-
# Create a tracking pixel
|
23
|
+
# Create a tracking pixel. A tracking pixel is an image that can be embedded in an email. When the email is viewed and the image is seen MailSlurp will mark the pixel as seen. Use tracking pixels to monitor email open events. You can receive open notifications via webhook or by fetching the pixel.
|
24
24
|
# @param create_tracking_pixel_options [CreateTrackingPixelOptions] createTrackingPixelOptions
|
25
25
|
# @param [Hash] opts the optional parameters
|
26
26
|
# @return [TrackingPixelDto]
|
@@ -30,7 +30,7 @@ module MailSlurpClient
|
|
30
30
|
end
|
31
31
|
|
32
32
|
# Create tracking pixel
|
33
|
-
# Create a tracking pixel
|
33
|
+
# Create a tracking pixel. A tracking pixel is an image that can be embedded in an email. When the email is viewed and the image is seen MailSlurp will mark the pixel as seen. Use tracking pixels to monitor email open events. You can receive open notifications via webhook or by fetching the pixel.
|
34
34
|
# @param create_tracking_pixel_options [CreateTrackingPixelOptions] createTrackingPixelOptions
|
35
35
|
# @param [Hash] opts the optional parameters
|
36
36
|
# @return [Array<(TrackingPixelDto, Integer, Hash)>] TrackingPixelDto data, response status code and response headers
|
@@ -87,6 +87,7 @@ module MailSlurpClient
|
|
87
87
|
# List tracking pixels in paginated form
|
88
88
|
# @param [Hash] opts the optional parameters
|
89
89
|
# @option opts [Integer] :page Optional page index in list pagination (default to 0)
|
90
|
+
# @option opts [String] :search_filter Optional search filter
|
90
91
|
# @option opts [Integer] :size Optional page size in list pagination (default to 20)
|
91
92
|
# @option opts [String] :sort Optional createdAt sort direction ASC or DESC (default to 'ASC')
|
92
93
|
# @return [PageTrackingPixelProjection]
|
@@ -99,6 +100,7 @@ module MailSlurpClient
|
|
99
100
|
# List tracking pixels in paginated form
|
100
101
|
# @param [Hash] opts the optional parameters
|
101
102
|
# @option opts [Integer] :page Optional page index in list pagination
|
103
|
+
# @option opts [String] :search_filter Optional search filter
|
102
104
|
# @option opts [Integer] :size Optional page size in list pagination
|
103
105
|
# @option opts [String] :sort Optional createdAt sort direction ASC or DESC
|
104
106
|
# @return [Array<(PageTrackingPixelProjection, Integer, Hash)>] PageTrackingPixelProjection data, response status code and response headers
|
@@ -116,6 +118,7 @@ module MailSlurpClient
|
|
116
118
|
# query parameters
|
117
119
|
query_params = opts[:query_params] || {}
|
118
120
|
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
121
|
+
query_params[:'searchFilter'] = opts[:'search_filter'] if !opts[:'search_filter'].nil?
|
119
122
|
query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
|
120
123
|
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
|
121
124
|
|
@@ -388,7 +388,7 @@ module MailSlurpClient
|
|
388
388
|
if @api_client.config.debugging
|
389
389
|
@api_client.config.logger.debug 'Calling API: WebhookControllerApi.get_test_webhook_payload ...'
|
390
390
|
end
|
391
|
-
allowable_values = ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT"]
|
391
|
+
allowable_values = ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED"]
|
392
392
|
if @api_client.config.client_side_validation && opts[:'event_name'] && !allowable_values.include?(opts[:'event_name'])
|
393
393
|
fail ArgumentError, "invalid value for \"event_name\", must be one of #{allowable_values}"
|
394
394
|
end
|
@@ -432,6 +432,60 @@ module MailSlurpClient
|
|
432
432
|
return data, status_code, headers
|
433
433
|
end
|
434
434
|
|
435
|
+
# Get webhook test payload for email opened event
|
436
|
+
# @param [Hash] opts the optional parameters
|
437
|
+
# @return [WebhookEmailOpenedPayload]
|
438
|
+
def get_test_webhook_payload_email_opened(opts = {})
|
439
|
+
data, _status_code, _headers = get_test_webhook_payload_email_opened_with_http_info(opts)
|
440
|
+
data
|
441
|
+
end
|
442
|
+
|
443
|
+
# Get webhook test payload for email opened event
|
444
|
+
# @param [Hash] opts the optional parameters
|
445
|
+
# @return [Array<(WebhookEmailOpenedPayload, Integer, Hash)>] WebhookEmailOpenedPayload data, response status code and response headers
|
446
|
+
def get_test_webhook_payload_email_opened_with_http_info(opts = {})
|
447
|
+
if @api_client.config.debugging
|
448
|
+
@api_client.config.logger.debug 'Calling API: WebhookControllerApi.get_test_webhook_payload_email_opened ...'
|
449
|
+
end
|
450
|
+
# resource path
|
451
|
+
local_var_path = '/webhooks/test/email-opened-payload'
|
452
|
+
|
453
|
+
# query parameters
|
454
|
+
query_params = opts[:query_params] || {}
|
455
|
+
|
456
|
+
# header parameters
|
457
|
+
header_params = opts[:header_params] || {}
|
458
|
+
# HTTP header 'Accept' (if needed)
|
459
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
460
|
+
|
461
|
+
# form parameters
|
462
|
+
form_params = opts[:form_params] || {}
|
463
|
+
|
464
|
+
# http body (model)
|
465
|
+
post_body = opts[:body]
|
466
|
+
|
467
|
+
# return_type
|
468
|
+
return_type = opts[:return_type] || 'WebhookEmailOpenedPayload'
|
469
|
+
|
470
|
+
# auth_names
|
471
|
+
auth_names = opts[:auth_names] || ['API_KEY']
|
472
|
+
|
473
|
+
new_options = opts.merge(
|
474
|
+
:header_params => header_params,
|
475
|
+
:query_params => query_params,
|
476
|
+
:form_params => form_params,
|
477
|
+
:body => post_body,
|
478
|
+
:auth_names => auth_names,
|
479
|
+
:return_type => return_type
|
480
|
+
)
|
481
|
+
|
482
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
483
|
+
if @api_client.config.debugging
|
484
|
+
@api_client.config.logger.debug "API called: WebhookControllerApi#get_test_webhook_payload_email_opened\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
485
|
+
end
|
486
|
+
return data, status_code, headers
|
487
|
+
end
|
488
|
+
|
435
489
|
# Get webhook test payload for new attachment event
|
436
490
|
# @param [Hash] opts the optional parameters
|
437
491
|
# @return [WebhookNewAttachmentPayload]
|
@@ -13,7 +13,7 @@ OpenAPI Generator version: 4.3.1
|
|
13
13
|
require 'date'
|
14
14
|
|
15
15
|
module MailSlurpClient
|
16
|
-
# Abstract webhook payload. Use the correct payload type for your webhook event type in order to access all the specific properties for that event. See the `NEW_EMAIL`,`NEW_CONTACT` and `
|
16
|
+
# Abstract webhook payload. Use the correct payload type for your webhook event type in order to access all the specific properties for that event. See the `NEW_EMAIL`,`NEW_CONTACT`, `NEW_ATTACHMENT` and `EMAIL_OPENED` payloads for the properties available for those events.
|
17
17
|
class AbstractWebhookPayload
|
18
18
|
attr_accessor :event_name
|
19
19
|
|
@@ -126,7 +126,7 @@ module MailSlurpClient
|
|
126
126
|
# @return true if the model is valid
|
127
127
|
def valid?
|
128
128
|
return false if @event_name.nil?
|
129
|
-
event_name_validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT"])
|
129
|
+
event_name_validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED"])
|
130
130
|
return false unless event_name_validator.valid?(@event_name)
|
131
131
|
return false if @message_id.nil?
|
132
132
|
return false if @webhook_id.nil?
|
@@ -136,7 +136,7 @@ module MailSlurpClient
|
|
136
136
|
# Custom attribute writer method checking allowed values (enum).
|
137
137
|
# @param [Object] event_name Object to be assigned
|
138
138
|
def event_name=(event_name)
|
139
|
-
validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT"])
|
139
|
+
validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED"])
|
140
140
|
unless validator.valid?(event_name)
|
141
141
|
fail ArgumentError, "invalid value for \"event_name\", must be one of #{validator.allowable_values}."
|
142
142
|
end
|
@@ -17,7 +17,7 @@ module MailSlurpClient
|
|
17
17
|
class CreateWebhookOptions
|
18
18
|
attr_accessor :basic_auth
|
19
19
|
|
20
|
-
# Optional webhook event name. Default is `EMAIL_RECEIVED` and is triggered when an email is received by the inbox associated with the webhook. Payload differ according to the webhook event name. The other events are `NEW_EMAIL`, `NEW_CONTACT`, and `NEW_ATTACHMENT`.
|
20
|
+
# Optional webhook event name. Default is `EMAIL_RECEIVED` and is triggered when an email is received by the inbox associated with the webhook. Payload differ according to the webhook event name. The other events are `NEW_EMAIL`, `NEW_CONTACT`, and `NEW_ATTACHMENT` and `EMAIL_OPENED`. `EMAIL_OPENED` requires the use of tracking pixels when sending. See the email tracking guide for more information.
|
21
21
|
attr_accessor :event_name
|
22
22
|
|
23
23
|
# Optional name for the webhook
|
@@ -116,7 +116,7 @@ module MailSlurpClient
|
|
116
116
|
# Check to see if the all the properties in the model are valid
|
117
117
|
# @return true if the model is valid
|
118
118
|
def valid?
|
119
|
-
event_name_validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT"])
|
119
|
+
event_name_validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED"])
|
120
120
|
return false unless event_name_validator.valid?(@event_name)
|
121
121
|
true
|
122
122
|
end
|
@@ -124,7 +124,7 @@ module MailSlurpClient
|
|
124
124
|
# Custom attribute writer method checking allowed values (enum).
|
125
125
|
# @param [Object] event_name Object to be assigned
|
126
126
|
def event_name=(event_name)
|
127
|
-
validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT"])
|
127
|
+
validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED"])
|
128
128
|
unless validator.valid?(event_name)
|
129
129
|
fail ArgumentError, "invalid value for \"event_name\", must be one of #{validator.allowable_values}."
|
130
130
|
end
|
@@ -14,23 +14,35 @@ require 'date'
|
|
14
14
|
|
15
15
|
module MailSlurpClient
|
16
16
|
class TrackingPixelDto
|
17
|
+
attr_accessor :created_at
|
18
|
+
|
17
19
|
attr_accessor :html
|
18
20
|
|
19
21
|
attr_accessor :id
|
20
22
|
|
23
|
+
attr_accessor :inbox_id
|
24
|
+
|
21
25
|
attr_accessor :recipient
|
22
26
|
|
23
27
|
attr_accessor :seen
|
24
28
|
|
29
|
+
attr_accessor :seen_at
|
30
|
+
|
31
|
+
attr_accessor :sent_email_id
|
32
|
+
|
25
33
|
attr_accessor :url
|
26
34
|
|
27
35
|
# Attribute mapping from ruby-style variable name to JSON key.
|
28
36
|
def self.attribute_map
|
29
37
|
{
|
38
|
+
:'created_at' => :'createdAt',
|
30
39
|
:'html' => :'html',
|
31
40
|
:'id' => :'id',
|
41
|
+
:'inbox_id' => :'inboxId',
|
32
42
|
:'recipient' => :'recipient',
|
33
43
|
:'seen' => :'seen',
|
44
|
+
:'seen_at' => :'seenAt',
|
45
|
+
:'sent_email_id' => :'sentEmailId',
|
34
46
|
:'url' => :'url'
|
35
47
|
}
|
36
48
|
end
|
@@ -38,10 +50,14 @@ module MailSlurpClient
|
|
38
50
|
# Attribute type mapping.
|
39
51
|
def self.openapi_types
|
40
52
|
{
|
53
|
+
:'created_at' => :'DateTime',
|
41
54
|
:'html' => :'String',
|
42
55
|
:'id' => :'String',
|
56
|
+
:'inbox_id' => :'String',
|
43
57
|
:'recipient' => :'String',
|
44
58
|
:'seen' => :'Boolean',
|
59
|
+
:'seen_at' => :'DateTime',
|
60
|
+
:'sent_email_id' => :'String',
|
45
61
|
:'url' => :'String'
|
46
62
|
}
|
47
63
|
end
|
@@ -67,6 +83,10 @@ module MailSlurpClient
|
|
67
83
|
h[k.to_sym] = v
|
68
84
|
}
|
69
85
|
|
86
|
+
if attributes.key?(:'created_at')
|
87
|
+
self.created_at = attributes[:'created_at']
|
88
|
+
end
|
89
|
+
|
70
90
|
if attributes.key?(:'html')
|
71
91
|
self.html = attributes[:'html']
|
72
92
|
end
|
@@ -75,6 +95,10 @@ module MailSlurpClient
|
|
75
95
|
self.id = attributes[:'id']
|
76
96
|
end
|
77
97
|
|
98
|
+
if attributes.key?(:'inbox_id')
|
99
|
+
self.inbox_id = attributes[:'inbox_id']
|
100
|
+
end
|
101
|
+
|
78
102
|
if attributes.key?(:'recipient')
|
79
103
|
self.recipient = attributes[:'recipient']
|
80
104
|
end
|
@@ -83,6 +107,14 @@ module MailSlurpClient
|
|
83
107
|
self.seen = attributes[:'seen']
|
84
108
|
end
|
85
109
|
|
110
|
+
if attributes.key?(:'seen_at')
|
111
|
+
self.seen_at = attributes[:'seen_at']
|
112
|
+
end
|
113
|
+
|
114
|
+
if attributes.key?(:'sent_email_id')
|
115
|
+
self.sent_email_id = attributes[:'sent_email_id']
|
116
|
+
end
|
117
|
+
|
86
118
|
if attributes.key?(:'url')
|
87
119
|
self.url = attributes[:'url']
|
88
120
|
end
|
@@ -92,6 +124,10 @@ module MailSlurpClient
|
|
92
124
|
# @return Array for valid properties with the reasons
|
93
125
|
def list_invalid_properties
|
94
126
|
invalid_properties = Array.new
|
127
|
+
if @created_at.nil?
|
128
|
+
invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
|
129
|
+
end
|
130
|
+
|
95
131
|
if @html.nil?
|
96
132
|
invalid_properties.push('invalid value for "html", html cannot be nil.')
|
97
133
|
end
|
@@ -114,6 +150,7 @@ module MailSlurpClient
|
|
114
150
|
# Check to see if the all the properties in the model are valid
|
115
151
|
# @return true if the model is valid
|
116
152
|
def valid?
|
153
|
+
return false if @created_at.nil?
|
117
154
|
return false if @html.nil?
|
118
155
|
return false if @id.nil?
|
119
156
|
return false if @seen.nil?
|
@@ -126,10 +163,14 @@ module MailSlurpClient
|
|
126
163
|
def ==(o)
|
127
164
|
return true if self.equal?(o)
|
128
165
|
self.class == o.class &&
|
166
|
+
created_at == o.created_at &&
|
129
167
|
html == o.html &&
|
130
168
|
id == o.id &&
|
169
|
+
inbox_id == o.inbox_id &&
|
131
170
|
recipient == o.recipient &&
|
132
171
|
seen == o.seen &&
|
172
|
+
seen_at == o.seen_at &&
|
173
|
+
sent_email_id == o.sent_email_id &&
|
133
174
|
url == o.url
|
134
175
|
end
|
135
176
|
|
@@ -142,7 +183,7 @@ module MailSlurpClient
|
|
142
183
|
# Calculates hash code according to all attributes.
|
143
184
|
# @return [Integer] Hash code
|
144
185
|
def hash
|
145
|
-
[html, id, recipient, seen, url].hash
|
186
|
+
[created_at, html, id, inbox_id, recipient, seen, seen_at, sent_email_id, url].hash
|
146
187
|
end
|
147
188
|
|
148
189
|
# Builds the object from hash
|
@@ -18,10 +18,16 @@ module MailSlurpClient
|
|
18
18
|
|
19
19
|
attr_accessor :id
|
20
20
|
|
21
|
+
attr_accessor :inbox_id
|
22
|
+
|
21
23
|
attr_accessor :name
|
22
24
|
|
25
|
+
attr_accessor :recipient
|
26
|
+
|
23
27
|
attr_accessor :seen
|
24
28
|
|
29
|
+
attr_accessor :seen_at
|
30
|
+
|
25
31
|
attr_accessor :user_id
|
26
32
|
|
27
33
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -29,8 +35,11 @@ module MailSlurpClient
|
|
29
35
|
{
|
30
36
|
:'created_at' => :'createdAt',
|
31
37
|
:'id' => :'id',
|
38
|
+
:'inbox_id' => :'inboxId',
|
32
39
|
:'name' => :'name',
|
40
|
+
:'recipient' => :'recipient',
|
33
41
|
:'seen' => :'seen',
|
42
|
+
:'seen_at' => :'seenAt',
|
34
43
|
:'user_id' => :'userId'
|
35
44
|
}
|
36
45
|
end
|
@@ -40,8 +49,11 @@ module MailSlurpClient
|
|
40
49
|
{
|
41
50
|
:'created_at' => :'DateTime',
|
42
51
|
:'id' => :'String',
|
52
|
+
:'inbox_id' => :'String',
|
43
53
|
:'name' => :'String',
|
54
|
+
:'recipient' => :'String',
|
44
55
|
:'seen' => :'Boolean',
|
56
|
+
:'seen_at' => :'DateTime',
|
45
57
|
:'user_id' => :'String'
|
46
58
|
}
|
47
59
|
end
|
@@ -75,14 +87,26 @@ module MailSlurpClient
|
|
75
87
|
self.id = attributes[:'id']
|
76
88
|
end
|
77
89
|
|
90
|
+
if attributes.key?(:'inbox_id')
|
91
|
+
self.inbox_id = attributes[:'inbox_id']
|
92
|
+
end
|
93
|
+
|
78
94
|
if attributes.key?(:'name')
|
79
95
|
self.name = attributes[:'name']
|
80
96
|
end
|
81
97
|
|
98
|
+
if attributes.key?(:'recipient')
|
99
|
+
self.recipient = attributes[:'recipient']
|
100
|
+
end
|
101
|
+
|
82
102
|
if attributes.key?(:'seen')
|
83
103
|
self.seen = attributes[:'seen']
|
84
104
|
end
|
85
105
|
|
106
|
+
if attributes.key?(:'seen_at')
|
107
|
+
self.seen_at = attributes[:'seen_at']
|
108
|
+
end
|
109
|
+
|
86
110
|
if attributes.key?(:'user_id')
|
87
111
|
self.user_id = attributes[:'user_id']
|
88
112
|
end
|
@@ -128,8 +152,11 @@ module MailSlurpClient
|
|
128
152
|
self.class == o.class &&
|
129
153
|
created_at == o.created_at &&
|
130
154
|
id == o.id &&
|
155
|
+
inbox_id == o.inbox_id &&
|
131
156
|
name == o.name &&
|
157
|
+
recipient == o.recipient &&
|
132
158
|
seen == o.seen &&
|
159
|
+
seen_at == o.seen_at &&
|
133
160
|
user_id == o.user_id
|
134
161
|
end
|
135
162
|
|
@@ -142,7 +169,7 @@ module MailSlurpClient
|
|
142
169
|
# Calculates hash code according to all attributes.
|
143
170
|
# @return [Integer] Hash code
|
144
171
|
def hash
|
145
|
-
[created_at, id, name, seen, user_id].hash
|
172
|
+
[created_at, id, inbox_id, name, recipient, seen, seen_at, user_id].hash
|
146
173
|
end
|
147
174
|
|
148
175
|
# Builds the object from hash
|
@@ -182,7 +182,7 @@ module MailSlurpClient
|
|
182
182
|
# Check to see if the all the properties in the model are valid
|
183
183
|
# @return true if the model is valid
|
184
184
|
def valid?
|
185
|
-
event_name_validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT"])
|
185
|
+
event_name_validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED"])
|
186
186
|
return false unless event_name_validator.valid?(@event_name)
|
187
187
|
method_validator = EnumAttributeValidator.new('String', ["GET", "HEAD", "POST", "PUT", "PATCH", "DELETE", "OPTIONS", "TRACE"])
|
188
188
|
return false unless method_validator.valid?(@method)
|
@@ -193,7 +193,7 @@ module MailSlurpClient
|
|
193
193
|
# Custom attribute writer method checking allowed values (enum).
|
194
194
|
# @param [Object] event_name Object to be assigned
|
195
195
|
def event_name=(event_name)
|
196
|
-
validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT"])
|
196
|
+
validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED"])
|
197
197
|
unless validator.valid?(event_name)
|
198
198
|
fail ArgumentError, "invalid value for \"event_name\", must be one of #{validator.allowable_values}."
|
199
199
|
end
|
@@ -0,0 +1,322 @@
|
|
1
|
+
=begin
|
2
|
+
#MailSlurp API
|
3
|
+
|
4
|
+
#MailSlurp is an API for sending and receiving emails from dynamically allocated email addresses. It's designed for developers and QA teams to test applications, process inbound emails, send templated notifications, attachments, and more. ## Resources - [Homepage](https://www.mailslurp.com) - Get an [API KEY](https://app.mailslurp.com/sign-up/) - Generated [SDK Clients](https://www.mailslurp.com/docs/) - [Examples](https://github.com/mailslurp/examples) repository
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 6.5.2
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.3.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module MailSlurpClient
|
16
|
+
# EMAIL_OPENED webhook payload. Sent to your webhook url endpoint via HTTP POST when an email containing a tracking pixel is opened and the pixel image is loaded by a reader.
|
17
|
+
class WebhookEmailOpenedPayload
|
18
|
+
# Date time of event creation
|
19
|
+
attr_accessor :created_at
|
20
|
+
|
21
|
+
# Name of the event type webhook is being triggered for.
|
22
|
+
attr_accessor :event_name
|
23
|
+
|
24
|
+
# Id of the inbox that received an email
|
25
|
+
attr_accessor :inbox_id
|
26
|
+
|
27
|
+
# Idempotent message ID. Store this ID locally or in a database to prevent message duplication.
|
28
|
+
attr_accessor :message_id
|
29
|
+
|
30
|
+
# ID of the tracking pixel
|
31
|
+
attr_accessor :pixel_id
|
32
|
+
|
33
|
+
# Email address for the recipient of the tracking pixel
|
34
|
+
attr_accessor :recipient
|
35
|
+
|
36
|
+
# ID of sent email
|
37
|
+
attr_accessor :sent_email_id
|
38
|
+
|
39
|
+
# ID of webhook entity being triggered
|
40
|
+
attr_accessor :webhook_id
|
41
|
+
|
42
|
+
# Name of the webhook being triggered
|
43
|
+
attr_accessor :webhook_name
|
44
|
+
|
45
|
+
class EnumAttributeValidator
|
46
|
+
attr_reader :datatype
|
47
|
+
attr_reader :allowable_values
|
48
|
+
|
49
|
+
def initialize(datatype, allowable_values)
|
50
|
+
@allowable_values = allowable_values.map do |value|
|
51
|
+
case datatype.to_s
|
52
|
+
when /Integer/i
|
53
|
+
value.to_i
|
54
|
+
when /Float/i
|
55
|
+
value.to_f
|
56
|
+
else
|
57
|
+
value
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
def valid?(value)
|
63
|
+
!value || allowable_values.include?(value)
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
68
|
+
def self.attribute_map
|
69
|
+
{
|
70
|
+
:'created_at' => :'createdAt',
|
71
|
+
:'event_name' => :'eventName',
|
72
|
+
:'inbox_id' => :'inboxId',
|
73
|
+
:'message_id' => :'messageId',
|
74
|
+
:'pixel_id' => :'pixelId',
|
75
|
+
:'recipient' => :'recipient',
|
76
|
+
:'sent_email_id' => :'sentEmailId',
|
77
|
+
:'webhook_id' => :'webhookId',
|
78
|
+
:'webhook_name' => :'webhookName'
|
79
|
+
}
|
80
|
+
end
|
81
|
+
|
82
|
+
# Attribute type mapping.
|
83
|
+
def self.openapi_types
|
84
|
+
{
|
85
|
+
:'created_at' => :'DateTime',
|
86
|
+
:'event_name' => :'String',
|
87
|
+
:'inbox_id' => :'String',
|
88
|
+
:'message_id' => :'String',
|
89
|
+
:'pixel_id' => :'String',
|
90
|
+
:'recipient' => :'String',
|
91
|
+
:'sent_email_id' => :'String',
|
92
|
+
:'webhook_id' => :'String',
|
93
|
+
:'webhook_name' => :'String'
|
94
|
+
}
|
95
|
+
end
|
96
|
+
|
97
|
+
# List of attributes with nullable: true
|
98
|
+
def self.openapi_nullable
|
99
|
+
Set.new([
|
100
|
+
])
|
101
|
+
end
|
102
|
+
|
103
|
+
# Initializes the object
|
104
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
105
|
+
def initialize(attributes = {})
|
106
|
+
if (!attributes.is_a?(Hash))
|
107
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::WebhookEmailOpenedPayload` initialize method"
|
108
|
+
end
|
109
|
+
|
110
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
111
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
112
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
113
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::WebhookEmailOpenedPayload`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
114
|
+
end
|
115
|
+
h[k.to_sym] = v
|
116
|
+
}
|
117
|
+
|
118
|
+
if attributes.key?(:'created_at')
|
119
|
+
self.created_at = attributes[:'created_at']
|
120
|
+
end
|
121
|
+
|
122
|
+
if attributes.key?(:'event_name')
|
123
|
+
self.event_name = attributes[:'event_name']
|
124
|
+
end
|
125
|
+
|
126
|
+
if attributes.key?(:'inbox_id')
|
127
|
+
self.inbox_id = attributes[:'inbox_id']
|
128
|
+
end
|
129
|
+
|
130
|
+
if attributes.key?(:'message_id')
|
131
|
+
self.message_id = attributes[:'message_id']
|
132
|
+
end
|
133
|
+
|
134
|
+
if attributes.key?(:'pixel_id')
|
135
|
+
self.pixel_id = attributes[:'pixel_id']
|
136
|
+
end
|
137
|
+
|
138
|
+
if attributes.key?(:'recipient')
|
139
|
+
self.recipient = attributes[:'recipient']
|
140
|
+
end
|
141
|
+
|
142
|
+
if attributes.key?(:'sent_email_id')
|
143
|
+
self.sent_email_id = attributes[:'sent_email_id']
|
144
|
+
end
|
145
|
+
|
146
|
+
if attributes.key?(:'webhook_id')
|
147
|
+
self.webhook_id = attributes[:'webhook_id']
|
148
|
+
end
|
149
|
+
|
150
|
+
if attributes.key?(:'webhook_name')
|
151
|
+
self.webhook_name = attributes[:'webhook_name']
|
152
|
+
end
|
153
|
+
end
|
154
|
+
|
155
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
156
|
+
# @return Array for valid properties with the reasons
|
157
|
+
def list_invalid_properties
|
158
|
+
invalid_properties = Array.new
|
159
|
+
invalid_properties
|
160
|
+
end
|
161
|
+
|
162
|
+
# Check to see if the all the properties in the model are valid
|
163
|
+
# @return true if the model is valid
|
164
|
+
def valid?
|
165
|
+
event_name_validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED"])
|
166
|
+
return false unless event_name_validator.valid?(@event_name)
|
167
|
+
true
|
168
|
+
end
|
169
|
+
|
170
|
+
# Custom attribute writer method checking allowed values (enum).
|
171
|
+
# @param [Object] event_name Object to be assigned
|
172
|
+
def event_name=(event_name)
|
173
|
+
validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED"])
|
174
|
+
unless validator.valid?(event_name)
|
175
|
+
fail ArgumentError, "invalid value for \"event_name\", must be one of #{validator.allowable_values}."
|
176
|
+
end
|
177
|
+
@event_name = event_name
|
178
|
+
end
|
179
|
+
|
180
|
+
# Checks equality by comparing each attribute.
|
181
|
+
# @param [Object] Object to be compared
|
182
|
+
def ==(o)
|
183
|
+
return true if self.equal?(o)
|
184
|
+
self.class == o.class &&
|
185
|
+
created_at == o.created_at &&
|
186
|
+
event_name == o.event_name &&
|
187
|
+
inbox_id == o.inbox_id &&
|
188
|
+
message_id == o.message_id &&
|
189
|
+
pixel_id == o.pixel_id &&
|
190
|
+
recipient == o.recipient &&
|
191
|
+
sent_email_id == o.sent_email_id &&
|
192
|
+
webhook_id == o.webhook_id &&
|
193
|
+
webhook_name == o.webhook_name
|
194
|
+
end
|
195
|
+
|
196
|
+
# @see the `==` method
|
197
|
+
# @param [Object] Object to be compared
|
198
|
+
def eql?(o)
|
199
|
+
self == o
|
200
|
+
end
|
201
|
+
|
202
|
+
# Calculates hash code according to all attributes.
|
203
|
+
# @return [Integer] Hash code
|
204
|
+
def hash
|
205
|
+
[created_at, event_name, inbox_id, message_id, pixel_id, recipient, sent_email_id, webhook_id, webhook_name].hash
|
206
|
+
end
|
207
|
+
|
208
|
+
# Builds the object from hash
|
209
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
210
|
+
# @return [Object] Returns the model itself
|
211
|
+
def self.build_from_hash(attributes)
|
212
|
+
new.build_from_hash(attributes)
|
213
|
+
end
|
214
|
+
|
215
|
+
# Builds the object from hash
|
216
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
217
|
+
# @return [Object] Returns the model itself
|
218
|
+
def build_from_hash(attributes)
|
219
|
+
return nil unless attributes.is_a?(Hash)
|
220
|
+
self.class.openapi_types.each_pair do |key, type|
|
221
|
+
if type =~ /\AArray<(.*)>/i
|
222
|
+
# check to ensure the input is an array given that the attribute
|
223
|
+
# is documented as an array but the input is not
|
224
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
225
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
226
|
+
end
|
227
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
228
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
229
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
230
|
+
end
|
231
|
+
|
232
|
+
self
|
233
|
+
end
|
234
|
+
|
235
|
+
# Deserializes the data based on type
|
236
|
+
# @param string type Data type
|
237
|
+
# @param string value Value to be deserialized
|
238
|
+
# @return [Object] Deserialized data
|
239
|
+
def _deserialize(type, value)
|
240
|
+
case type.to_sym
|
241
|
+
when :DateTime
|
242
|
+
DateTime.parse(value)
|
243
|
+
when :Date
|
244
|
+
Date.parse(value)
|
245
|
+
when :String
|
246
|
+
value.to_s
|
247
|
+
when :Integer
|
248
|
+
value.to_i
|
249
|
+
when :Float
|
250
|
+
value.to_f
|
251
|
+
when :Boolean
|
252
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
253
|
+
true
|
254
|
+
else
|
255
|
+
false
|
256
|
+
end
|
257
|
+
when :Object
|
258
|
+
# generic object (usually a Hash), return directly
|
259
|
+
value
|
260
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
261
|
+
inner_type = Regexp.last_match[:inner_type]
|
262
|
+
value.map { |v| _deserialize(inner_type, v) }
|
263
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
264
|
+
k_type = Regexp.last_match[:k_type]
|
265
|
+
v_type = Regexp.last_match[:v_type]
|
266
|
+
{}.tap do |hash|
|
267
|
+
value.each do |k, v|
|
268
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
269
|
+
end
|
270
|
+
end
|
271
|
+
else # model
|
272
|
+
MailSlurpClient.const_get(type).build_from_hash(value)
|
273
|
+
end
|
274
|
+
end
|
275
|
+
|
276
|
+
# Returns the string representation of the object
|
277
|
+
# @return [String] String presentation of the object
|
278
|
+
def to_s
|
279
|
+
to_hash.to_s
|
280
|
+
end
|
281
|
+
|
282
|
+
# to_body is an alias to to_hash (backward compatibility)
|
283
|
+
# @return [Hash] Returns the object in the form of hash
|
284
|
+
def to_body
|
285
|
+
to_hash
|
286
|
+
end
|
287
|
+
|
288
|
+
# Returns the object in the form of hash
|
289
|
+
# @return [Hash] Returns the object in the form of hash
|
290
|
+
def to_hash
|
291
|
+
hash = {}
|
292
|
+
self.class.attribute_map.each_pair do |attr, param|
|
293
|
+
value = self.send(attr)
|
294
|
+
if value.nil?
|
295
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
296
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
297
|
+
end
|
298
|
+
|
299
|
+
hash[param] = _to_hash(value)
|
300
|
+
end
|
301
|
+
hash
|
302
|
+
end
|
303
|
+
|
304
|
+
# Outputs non-array value in the form of hash
|
305
|
+
# For object, use to_hash. Otherwise, just return the value
|
306
|
+
# @param [Object] value Any valid value
|
307
|
+
# @return [Hash] Returns the value in the form of hash
|
308
|
+
def _to_hash(value)
|
309
|
+
if value.is_a?(Array)
|
310
|
+
value.compact.map { |v| _to_hash(v) }
|
311
|
+
elsif value.is_a?(Hash)
|
312
|
+
{}.tap do |hash|
|
313
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
314
|
+
end
|
315
|
+
elsif value.respond_to? :to_hash
|
316
|
+
value.to_hash
|
317
|
+
else
|
318
|
+
value
|
319
|
+
end
|
320
|
+
end
|
321
|
+
end
|
322
|
+
end
|
@@ -153,7 +153,7 @@ module MailSlurpClient
|
|
153
153
|
# Check to see if the all the properties in the model are valid
|
154
154
|
# @return true if the model is valid
|
155
155
|
def valid?
|
156
|
-
event_name_validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT"])
|
156
|
+
event_name_validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED"])
|
157
157
|
return false unless event_name_validator.valid?(@event_name)
|
158
158
|
true
|
159
159
|
end
|
@@ -161,7 +161,7 @@ module MailSlurpClient
|
|
161
161
|
# Custom attribute writer method checking allowed values (enum).
|
162
162
|
# @param [Object] event_name Object to be assigned
|
163
163
|
def event_name=(event_name)
|
164
|
-
validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT"])
|
164
|
+
validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED"])
|
165
165
|
unless validator.valid?(event_name)
|
166
166
|
fail ArgumentError, "invalid value for \"event_name\", must be one of #{validator.allowable_values}."
|
167
167
|
end
|
@@ -228,7 +228,7 @@ module MailSlurpClient
|
|
228
228
|
return false if @contact_id.nil?
|
229
229
|
return false if @created_at.nil?
|
230
230
|
return false if @email_addresses.nil?
|
231
|
-
event_name_validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT"])
|
231
|
+
event_name_validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED"])
|
232
232
|
return false unless event_name_validator.valid?(@event_name)
|
233
233
|
return false if @tags.nil?
|
234
234
|
true
|
@@ -237,7 +237,7 @@ module MailSlurpClient
|
|
237
237
|
# Custom attribute writer method checking allowed values (enum).
|
238
238
|
# @param [Object] event_name Object to be assigned
|
239
239
|
def event_name=(event_name)
|
240
|
-
validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT"])
|
240
|
+
validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED"])
|
241
241
|
unless validator.valid?(event_name)
|
242
242
|
fail ArgumentError, "invalid value for \"event_name\", must be one of #{validator.allowable_values}."
|
243
243
|
end
|
@@ -206,7 +206,7 @@ module MailSlurpClient
|
|
206
206
|
# Check to see if the all the properties in the model are valid
|
207
207
|
# @return true if the model is valid
|
208
208
|
def valid?
|
209
|
-
event_name_validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT"])
|
209
|
+
event_name_validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED"])
|
210
210
|
return false unless event_name_validator.valid?(@event_name)
|
211
211
|
true
|
212
212
|
end
|
@@ -214,7 +214,7 @@ module MailSlurpClient
|
|
214
214
|
# Custom attribute writer method checking allowed values (enum).
|
215
215
|
# @param [Object] event_name Object to be assigned
|
216
216
|
def event_name=(event_name)
|
217
|
-
validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT"])
|
217
|
+
validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED"])
|
218
218
|
unless validator.valid?(event_name)
|
219
219
|
fail ArgumentError, "invalid value for \"event_name\", must be one of #{validator.allowable_values}."
|
220
220
|
end
|
@@ -234,7 +234,7 @@ module MailSlurpClient
|
|
234
234
|
return false if @updated_at.nil?
|
235
235
|
return false if @user_id.nil?
|
236
236
|
return false if @webhook_event.nil?
|
237
|
-
webhook_event_validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT"])
|
237
|
+
webhook_event_validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED"])
|
238
238
|
return false unless webhook_event_validator.valid?(@webhook_event)
|
239
239
|
return false if @webhook_id.nil?
|
240
240
|
return false if @webhook_url.nil?
|
@@ -254,7 +254,7 @@ module MailSlurpClient
|
|
254
254
|
# Custom attribute writer method checking allowed values (enum).
|
255
255
|
# @param [Object] webhook_event Object to be assigned
|
256
256
|
def webhook_event=(webhook_event)
|
257
|
-
validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT"])
|
257
|
+
validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED"])
|
258
258
|
unless validator.valid?(webhook_event)
|
259
259
|
fail ArgumentError, "invalid value for \"webhook_event\", must be one of #{validator.allowable_values}."
|
260
260
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mailslurp_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 12.6.
|
4
|
+
version: 12.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- mailslurp
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-07-
|
11
|
+
date: 2021-07-03 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Create emails addresses in Ruby then send and receive real emails and
|
14
14
|
attachments. See https://www.mailslurp.com/docs/ruby/ for full Ruby documentation.
|
@@ -150,6 +150,7 @@ files:
|
|
150
150
|
- lib/mailslurp_client/models/verify_email_address_options.rb
|
151
151
|
- lib/mailslurp_client/models/wait_for_conditions.rb
|
152
152
|
- lib/mailslurp_client/models/webhook_dto.rb
|
153
|
+
- lib/mailslurp_client/models/webhook_email_opened_payload.rb
|
153
154
|
- lib/mailslurp_client/models/webhook_new_attachment_payload.rb
|
154
155
|
- lib/mailslurp_client/models/webhook_new_contact_payload.rb
|
155
156
|
- lib/mailslurp_client/models/webhook_new_email_payload.rb
|