mailslurp_client 12.7.1 → 12.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mailslurp_client.rb +6 -0
- data/lib/mailslurp_client/api/bounce_controller_api.rb +284 -0
- data/lib/mailslurp_client/api/sent_emails_controller_api.rb +60 -0
- data/lib/mailslurp_client/models/bounce.rb +325 -0
- data/lib/mailslurp_client/models/bounce_projection.rb +234 -0
- data/lib/mailslurp_client/models/bounce_recipient.rb +262 -0
- data/lib/mailslurp_client/models/page_bounced_email.rb +299 -0
- data/lib/mailslurp_client/models/page_bounced_recipients.rb +299 -0
- data/lib/mailslurp_client/version.rb +1 -1
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 76c2b51b52d7f63580e4bc83b871eb60321b422deafab4d32f480050825affed
|
4
|
+
data.tar.gz: b2193b5d4554b6fdbaade20bb9f791ca1eac9d163d24fd47faea01aa6e2bec1a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7771fa21777885c9cc0003f17188e518af59d5317ef9ddb811c9a93ff13919dd4467469cb9d66934da5c25a52320462835e9abf8780313a370126740a98f9ec7
|
7
|
+
data.tar.gz: 2d873c50edcdedfbe3d787d8ad31023bdd923e6ae154d4262be6571bcee52f671b2a64d51cf9d04ceb1a36a01a96081fdc72d8e070324a3106cb0ff07cde9913
|
data/lib/mailslurp_client.rb
CHANGED
@@ -23,6 +23,9 @@ require 'mailslurp_client/models/alias_projection'
|
|
23
23
|
require 'mailslurp_client/models/attachment_meta_data'
|
24
24
|
require 'mailslurp_client/models/attachment_projection'
|
25
25
|
require 'mailslurp_client/models/basic_auth_options'
|
26
|
+
require 'mailslurp_client/models/bounce'
|
27
|
+
require 'mailslurp_client/models/bounce_projection'
|
28
|
+
require 'mailslurp_client/models/bounce_recipient'
|
26
29
|
require 'mailslurp_client/models/bulk_send_email_options'
|
27
30
|
require 'mailslurp_client/models/condition_option'
|
28
31
|
require 'mailslurp_client/models/contact_dto'
|
@@ -82,6 +85,8 @@ require 'mailslurp_client/models/name_server_record'
|
|
82
85
|
require 'mailslurp_client/models/organization_inbox_projection'
|
83
86
|
require 'mailslurp_client/models/page_alias'
|
84
87
|
require 'mailslurp_client/models/page_attachment_entity'
|
88
|
+
require 'mailslurp_client/models/page_bounced_email'
|
89
|
+
require 'mailslurp_client/models/page_bounced_recipients'
|
85
90
|
require 'mailslurp_client/models/page_contact_projection'
|
86
91
|
require 'mailslurp_client/models/page_email_preview'
|
87
92
|
require 'mailslurp_client/models/page_email_projection'
|
@@ -140,6 +145,7 @@ require 'mailslurp_client/models/webhook_test_result'
|
|
140
145
|
# APIs
|
141
146
|
require 'mailslurp_client/api/alias_controller_api'
|
142
147
|
require 'mailslurp_client/api/attachment_controller_api'
|
148
|
+
require 'mailslurp_client/api/bounce_controller_api'
|
143
149
|
require 'mailslurp_client/api/bulk_actions_controller_api'
|
144
150
|
require 'mailslurp_client/api/common_actions_controller_api'
|
145
151
|
require 'mailslurp_client/api/contact_controller_api'
|
@@ -0,0 +1,284 @@
|
|
1
|
+
=begin
|
2
|
+
#MailSlurp API
|
3
|
+
|
4
|
+
#MailSlurp is an API for sending and receiving emails from dynamically allocated email addresses. It's designed for developers and QA teams to test applications, process inbound emails, send templated notifications, attachments, and more. ## Resources - [Homepage](https://www.mailslurp.com) - Get an [API KEY](https://app.mailslurp.com/sign-up/) - Generated [SDK Clients](https://www.mailslurp.com/docs/) - [Examples](https://github.com/mailslurp/examples) repository
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 6.5.2
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.3.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'cgi'
|
14
|
+
|
15
|
+
module MailSlurpClient
|
16
|
+
class BounceControllerApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Get a bounced email.
|
23
|
+
# Bounced emails are email you have sent that were rejected by a recipient
|
24
|
+
# @param id [String] ID of the bounced email to fetch
|
25
|
+
# @param [Hash] opts the optional parameters
|
26
|
+
# @return [nil]
|
27
|
+
def get_bounced_email(id, opts = {})
|
28
|
+
get_bounced_email_with_http_info(id, opts)
|
29
|
+
nil
|
30
|
+
end
|
31
|
+
|
32
|
+
# Get a bounced email.
|
33
|
+
# Bounced emails are email you have sent that were rejected by a recipient
|
34
|
+
# @param id [String] ID of the bounced email to fetch
|
35
|
+
# @param [Hash] opts the optional parameters
|
36
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
37
|
+
def get_bounced_email_with_http_info(id, opts = {})
|
38
|
+
if @api_client.config.debugging
|
39
|
+
@api_client.config.logger.debug 'Calling API: BounceControllerApi.get_bounced_email ...'
|
40
|
+
end
|
41
|
+
# verify the required parameter 'id' is set
|
42
|
+
if @api_client.config.client_side_validation && id.nil?
|
43
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling BounceControllerApi.get_bounced_email"
|
44
|
+
end
|
45
|
+
# resource path
|
46
|
+
local_var_path = '/bounce/emails/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
47
|
+
|
48
|
+
# query parameters
|
49
|
+
query_params = opts[:query_params] || {}
|
50
|
+
|
51
|
+
# header parameters
|
52
|
+
header_params = opts[:header_params] || {}
|
53
|
+
# HTTP header 'Accept' (if needed)
|
54
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
55
|
+
|
56
|
+
# form parameters
|
57
|
+
form_params = opts[:form_params] || {}
|
58
|
+
|
59
|
+
# http body (model)
|
60
|
+
post_body = opts[:body]
|
61
|
+
|
62
|
+
# return_type
|
63
|
+
return_type = opts[:return_type]
|
64
|
+
|
65
|
+
# auth_names
|
66
|
+
auth_names = opts[:auth_names] || ['API_KEY']
|
67
|
+
|
68
|
+
new_options = opts.merge(
|
69
|
+
:header_params => header_params,
|
70
|
+
:query_params => query_params,
|
71
|
+
:form_params => form_params,
|
72
|
+
:body => post_body,
|
73
|
+
:auth_names => auth_names,
|
74
|
+
:return_type => return_type
|
75
|
+
)
|
76
|
+
|
77
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
78
|
+
if @api_client.config.debugging
|
79
|
+
@api_client.config.logger.debug "API called: BounceControllerApi#get_bounced_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
80
|
+
end
|
81
|
+
return data, status_code, headers
|
82
|
+
end
|
83
|
+
|
84
|
+
# Get a bounced email.
|
85
|
+
# Bounced emails are email you have sent that were rejected by a recipient
|
86
|
+
# @param id [String] ID of the bounced recipient
|
87
|
+
# @param [Hash] opts the optional parameters
|
88
|
+
# @return [nil]
|
89
|
+
def get_bounced_email1(id, opts = {})
|
90
|
+
get_bounced_email1_with_http_info(id, opts)
|
91
|
+
nil
|
92
|
+
end
|
93
|
+
|
94
|
+
# Get a bounced email.
|
95
|
+
# Bounced emails are email you have sent that were rejected by a recipient
|
96
|
+
# @param id [String] ID of the bounced recipient
|
97
|
+
# @param [Hash] opts the optional parameters
|
98
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
99
|
+
def get_bounced_email1_with_http_info(id, opts = {})
|
100
|
+
if @api_client.config.debugging
|
101
|
+
@api_client.config.logger.debug 'Calling API: BounceControllerApi.get_bounced_email1 ...'
|
102
|
+
end
|
103
|
+
# verify the required parameter 'id' is set
|
104
|
+
if @api_client.config.client_side_validation && id.nil?
|
105
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling BounceControllerApi.get_bounced_email1"
|
106
|
+
end
|
107
|
+
# resource path
|
108
|
+
local_var_path = '/bounce/recipients/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
109
|
+
|
110
|
+
# query parameters
|
111
|
+
query_params = opts[:query_params] || {}
|
112
|
+
|
113
|
+
# header parameters
|
114
|
+
header_params = opts[:header_params] || {}
|
115
|
+
# HTTP header 'Accept' (if needed)
|
116
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
117
|
+
|
118
|
+
# form parameters
|
119
|
+
form_params = opts[:form_params] || {}
|
120
|
+
|
121
|
+
# http body (model)
|
122
|
+
post_body = opts[:body]
|
123
|
+
|
124
|
+
# return_type
|
125
|
+
return_type = opts[:return_type]
|
126
|
+
|
127
|
+
# auth_names
|
128
|
+
auth_names = opts[:auth_names] || ['API_KEY']
|
129
|
+
|
130
|
+
new_options = opts.merge(
|
131
|
+
:header_params => header_params,
|
132
|
+
:query_params => query_params,
|
133
|
+
:form_params => form_params,
|
134
|
+
:body => post_body,
|
135
|
+
:auth_names => auth_names,
|
136
|
+
:return_type => return_type
|
137
|
+
)
|
138
|
+
|
139
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
140
|
+
if @api_client.config.debugging
|
141
|
+
@api_client.config.logger.debug "API called: BounceControllerApi#get_bounced_email1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
142
|
+
end
|
143
|
+
return data, status_code, headers
|
144
|
+
end
|
145
|
+
|
146
|
+
# Get paginated list of bounced emails.
|
147
|
+
# Bounced emails are email you have sent that were rejected by a recipient
|
148
|
+
# @param [Hash] opts the optional parameters
|
149
|
+
# @option opts [Integer] :page Optional page index (default to 0)
|
150
|
+
# @option opts [Integer] :size Optional page size (default to 20)
|
151
|
+
# @option opts [String] :sort Optional createdAt sort direction ASC or DESC (default to 'ASC')
|
152
|
+
# @return [nil]
|
153
|
+
def get_bounced_emails(opts = {})
|
154
|
+
get_bounced_emails_with_http_info(opts)
|
155
|
+
nil
|
156
|
+
end
|
157
|
+
|
158
|
+
# Get paginated list of bounced emails.
|
159
|
+
# Bounced emails are email you have sent that were rejected by a recipient
|
160
|
+
# @param [Hash] opts the optional parameters
|
161
|
+
# @option opts [Integer] :page Optional page index
|
162
|
+
# @option opts [Integer] :size Optional page size
|
163
|
+
# @option opts [String] :sort Optional createdAt sort direction ASC or DESC
|
164
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
165
|
+
def get_bounced_emails_with_http_info(opts = {})
|
166
|
+
if @api_client.config.debugging
|
167
|
+
@api_client.config.logger.debug 'Calling API: BounceControllerApi.get_bounced_emails ...'
|
168
|
+
end
|
169
|
+
allowable_values = ["ASC", "DESC"]
|
170
|
+
if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
|
171
|
+
fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
|
172
|
+
end
|
173
|
+
# resource path
|
174
|
+
local_var_path = '/bounce/emails'
|
175
|
+
|
176
|
+
# query parameters
|
177
|
+
query_params = opts[:query_params] || {}
|
178
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
179
|
+
query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
|
180
|
+
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
|
181
|
+
|
182
|
+
# header parameters
|
183
|
+
header_params = opts[:header_params] || {}
|
184
|
+
# HTTP header 'Accept' (if needed)
|
185
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
186
|
+
|
187
|
+
# form parameters
|
188
|
+
form_params = opts[:form_params] || {}
|
189
|
+
|
190
|
+
# http body (model)
|
191
|
+
post_body = opts[:body]
|
192
|
+
|
193
|
+
# return_type
|
194
|
+
return_type = opts[:return_type]
|
195
|
+
|
196
|
+
# auth_names
|
197
|
+
auth_names = opts[:auth_names] || ['API_KEY']
|
198
|
+
|
199
|
+
new_options = opts.merge(
|
200
|
+
:header_params => header_params,
|
201
|
+
:query_params => query_params,
|
202
|
+
:form_params => form_params,
|
203
|
+
:body => post_body,
|
204
|
+
:auth_names => auth_names,
|
205
|
+
:return_type => return_type
|
206
|
+
)
|
207
|
+
|
208
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
209
|
+
if @api_client.config.debugging
|
210
|
+
@api_client.config.logger.debug "API called: BounceControllerApi#get_bounced_emails\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
211
|
+
end
|
212
|
+
return data, status_code, headers
|
213
|
+
end
|
214
|
+
|
215
|
+
# Get paginated list of bounced recipients.
|
216
|
+
# Bounced recipients are email addresses that you have sent emails to that did not accept the sent email. Once a recipient is bounced you cannot send emails to that address.
|
217
|
+
# @param [Hash] opts the optional parameters
|
218
|
+
# @option opts [Integer] :page Optional page index (default to 0)
|
219
|
+
# @option opts [Integer] :size Optional page size (default to 20)
|
220
|
+
# @option opts [String] :sort Optional createdAt sort direction ASC or DESC (default to 'ASC')
|
221
|
+
# @return [nil]
|
222
|
+
def get_bounced_recipients(opts = {})
|
223
|
+
get_bounced_recipients_with_http_info(opts)
|
224
|
+
nil
|
225
|
+
end
|
226
|
+
|
227
|
+
# Get paginated list of bounced recipients.
|
228
|
+
# Bounced recipients are email addresses that you have sent emails to that did not accept the sent email. Once a recipient is bounced you cannot send emails to that address.
|
229
|
+
# @param [Hash] opts the optional parameters
|
230
|
+
# @option opts [Integer] :page Optional page index
|
231
|
+
# @option opts [Integer] :size Optional page size
|
232
|
+
# @option opts [String] :sort Optional createdAt sort direction ASC or DESC
|
233
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
234
|
+
def get_bounced_recipients_with_http_info(opts = {})
|
235
|
+
if @api_client.config.debugging
|
236
|
+
@api_client.config.logger.debug 'Calling API: BounceControllerApi.get_bounced_recipients ...'
|
237
|
+
end
|
238
|
+
allowable_values = ["ASC", "DESC"]
|
239
|
+
if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
|
240
|
+
fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
|
241
|
+
end
|
242
|
+
# resource path
|
243
|
+
local_var_path = '/bounce/recipients'
|
244
|
+
|
245
|
+
# query parameters
|
246
|
+
query_params = opts[:query_params] || {}
|
247
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
248
|
+
query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
|
249
|
+
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
|
250
|
+
|
251
|
+
# header parameters
|
252
|
+
header_params = opts[:header_params] || {}
|
253
|
+
# HTTP header 'Accept' (if needed)
|
254
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
255
|
+
|
256
|
+
# form parameters
|
257
|
+
form_params = opts[:form_params] || {}
|
258
|
+
|
259
|
+
# http body (model)
|
260
|
+
post_body = opts[:body]
|
261
|
+
|
262
|
+
# return_type
|
263
|
+
return_type = opts[:return_type]
|
264
|
+
|
265
|
+
# auth_names
|
266
|
+
auth_names = opts[:auth_names] || ['API_KEY']
|
267
|
+
|
268
|
+
new_options = opts.merge(
|
269
|
+
:header_params => header_params,
|
270
|
+
:query_params => query_params,
|
271
|
+
:form_params => form_params,
|
272
|
+
:body => post_body,
|
273
|
+
:auth_names => auth_names,
|
274
|
+
:return_type => return_type
|
275
|
+
)
|
276
|
+
|
277
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
278
|
+
if @api_client.config.debugging
|
279
|
+
@api_client.config.logger.debug "API called: BounceControllerApi#get_bounced_recipients\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
280
|
+
end
|
281
|
+
return data, status_code, headers
|
282
|
+
end
|
283
|
+
end
|
284
|
+
end
|
@@ -149,6 +149,66 @@ module MailSlurpClient
|
|
149
149
|
return data, status_code, headers
|
150
150
|
end
|
151
151
|
|
152
|
+
# Get sent email HTML content
|
153
|
+
# @param id [String] id
|
154
|
+
# @param [Hash] opts the optional parameters
|
155
|
+
# @return [String]
|
156
|
+
def get_sent_email_html_content(id, opts = {})
|
157
|
+
data, _status_code, _headers = get_sent_email_html_content_with_http_info(id, opts)
|
158
|
+
data
|
159
|
+
end
|
160
|
+
|
161
|
+
# Get sent email HTML content
|
162
|
+
# @param id [String] id
|
163
|
+
# @param [Hash] opts the optional parameters
|
164
|
+
# @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
|
165
|
+
def get_sent_email_html_content_with_http_info(id, opts = {})
|
166
|
+
if @api_client.config.debugging
|
167
|
+
@api_client.config.logger.debug 'Calling API: SentEmailsControllerApi.get_sent_email_html_content ...'
|
168
|
+
end
|
169
|
+
# verify the required parameter 'id' is set
|
170
|
+
if @api_client.config.client_side_validation && id.nil?
|
171
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling SentEmailsControllerApi.get_sent_email_html_content"
|
172
|
+
end
|
173
|
+
# resource path
|
174
|
+
local_var_path = '/sent/{id}/html'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
175
|
+
|
176
|
+
# query parameters
|
177
|
+
query_params = opts[:query_params] || {}
|
178
|
+
|
179
|
+
# header parameters
|
180
|
+
header_params = opts[:header_params] || {}
|
181
|
+
# HTTP header 'Accept' (if needed)
|
182
|
+
header_params['Accept'] = @api_client.select_header_accept(['text/html'])
|
183
|
+
|
184
|
+
# form parameters
|
185
|
+
form_params = opts[:form_params] || {}
|
186
|
+
|
187
|
+
# http body (model)
|
188
|
+
post_body = opts[:body]
|
189
|
+
|
190
|
+
# return_type
|
191
|
+
return_type = opts[:return_type] || 'String'
|
192
|
+
|
193
|
+
# auth_names
|
194
|
+
auth_names = opts[:auth_names] || ['API_KEY']
|
195
|
+
|
196
|
+
new_options = opts.merge(
|
197
|
+
:header_params => header_params,
|
198
|
+
:query_params => query_params,
|
199
|
+
:form_params => form_params,
|
200
|
+
:body => post_body,
|
201
|
+
:auth_names => auth_names,
|
202
|
+
:return_type => return_type
|
203
|
+
)
|
204
|
+
|
205
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
206
|
+
if @api_client.config.debugging
|
207
|
+
@api_client.config.logger.debug "API called: SentEmailsControllerApi#get_sent_email_html_content\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
208
|
+
end
|
209
|
+
return data, status_code, headers
|
210
|
+
end
|
211
|
+
|
152
212
|
# Get all tracking pixels for a sent email in paginated form
|
153
213
|
# @param id [String] id
|
154
214
|
# @param [Hash] opts the optional parameters
|
@@ -0,0 +1,325 @@
|
|
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
|
+
class Bounce
|
17
|
+
attr_accessor :bounce_mta
|
18
|
+
|
19
|
+
attr_accessor :bounce_recipients
|
20
|
+
|
21
|
+
attr_accessor :bounce_sub_type
|
22
|
+
|
23
|
+
attr_accessor :bounce_type
|
24
|
+
|
25
|
+
attr_accessor :created_at
|
26
|
+
|
27
|
+
attr_accessor :id
|
28
|
+
|
29
|
+
attr_accessor :notification_type
|
30
|
+
|
31
|
+
attr_accessor :sender
|
32
|
+
|
33
|
+
attr_accessor :sent_to_recipients
|
34
|
+
|
35
|
+
attr_accessor :updated_at
|
36
|
+
|
37
|
+
attr_accessor :user_id
|
38
|
+
|
39
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
40
|
+
def self.attribute_map
|
41
|
+
{
|
42
|
+
:'bounce_mta' => :'bounceMta',
|
43
|
+
:'bounce_recipients' => :'bounceRecipients',
|
44
|
+
:'bounce_sub_type' => :'bounceSubType',
|
45
|
+
:'bounce_type' => :'bounceType',
|
46
|
+
:'created_at' => :'createdAt',
|
47
|
+
:'id' => :'id',
|
48
|
+
:'notification_type' => :'notificationType',
|
49
|
+
:'sender' => :'sender',
|
50
|
+
:'sent_to_recipients' => :'sentToRecipients',
|
51
|
+
:'updated_at' => :'updatedAt',
|
52
|
+
:'user_id' => :'userId'
|
53
|
+
}
|
54
|
+
end
|
55
|
+
|
56
|
+
# Attribute type mapping.
|
57
|
+
def self.openapi_types
|
58
|
+
{
|
59
|
+
:'bounce_mta' => :'String',
|
60
|
+
:'bounce_recipients' => :'Array<String>',
|
61
|
+
:'bounce_sub_type' => :'String',
|
62
|
+
:'bounce_type' => :'String',
|
63
|
+
:'created_at' => :'DateTime',
|
64
|
+
:'id' => :'String',
|
65
|
+
:'notification_type' => :'String',
|
66
|
+
:'sender' => :'String',
|
67
|
+
:'sent_to_recipients' => :'Array<String>',
|
68
|
+
:'updated_at' => :'DateTime',
|
69
|
+
:'user_id' => :'String'
|
70
|
+
}
|
71
|
+
end
|
72
|
+
|
73
|
+
# List of attributes with nullable: true
|
74
|
+
def self.openapi_nullable
|
75
|
+
Set.new([
|
76
|
+
])
|
77
|
+
end
|
78
|
+
|
79
|
+
# Initializes the object
|
80
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
81
|
+
def initialize(attributes = {})
|
82
|
+
if (!attributes.is_a?(Hash))
|
83
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::Bounce` initialize method"
|
84
|
+
end
|
85
|
+
|
86
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
87
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
88
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
89
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::Bounce`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
90
|
+
end
|
91
|
+
h[k.to_sym] = v
|
92
|
+
}
|
93
|
+
|
94
|
+
if attributes.key?(:'bounce_mta')
|
95
|
+
self.bounce_mta = attributes[:'bounce_mta']
|
96
|
+
end
|
97
|
+
|
98
|
+
if attributes.key?(:'bounce_recipients')
|
99
|
+
if (value = attributes[:'bounce_recipients']).is_a?(Array)
|
100
|
+
self.bounce_recipients = value
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
if attributes.key?(:'bounce_sub_type')
|
105
|
+
self.bounce_sub_type = attributes[:'bounce_sub_type']
|
106
|
+
end
|
107
|
+
|
108
|
+
if attributes.key?(:'bounce_type')
|
109
|
+
self.bounce_type = attributes[:'bounce_type']
|
110
|
+
end
|
111
|
+
|
112
|
+
if attributes.key?(:'created_at')
|
113
|
+
self.created_at = attributes[:'created_at']
|
114
|
+
end
|
115
|
+
|
116
|
+
if attributes.key?(:'id')
|
117
|
+
self.id = attributes[:'id']
|
118
|
+
end
|
119
|
+
|
120
|
+
if attributes.key?(:'notification_type')
|
121
|
+
self.notification_type = attributes[:'notification_type']
|
122
|
+
end
|
123
|
+
|
124
|
+
if attributes.key?(:'sender')
|
125
|
+
self.sender = attributes[:'sender']
|
126
|
+
end
|
127
|
+
|
128
|
+
if attributes.key?(:'sent_to_recipients')
|
129
|
+
if (value = attributes[:'sent_to_recipients']).is_a?(Array)
|
130
|
+
self.sent_to_recipients = value
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
134
|
+
if attributes.key?(:'updated_at')
|
135
|
+
self.updated_at = attributes[:'updated_at']
|
136
|
+
end
|
137
|
+
|
138
|
+
if attributes.key?(:'user_id')
|
139
|
+
self.user_id = attributes[:'user_id']
|
140
|
+
end
|
141
|
+
end
|
142
|
+
|
143
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
144
|
+
# @return Array for valid properties with the reasons
|
145
|
+
def list_invalid_properties
|
146
|
+
invalid_properties = Array.new
|
147
|
+
if @created_at.nil?
|
148
|
+
invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
|
149
|
+
end
|
150
|
+
|
151
|
+
if @notification_type.nil?
|
152
|
+
invalid_properties.push('invalid value for "notification_type", notification_type cannot be nil.')
|
153
|
+
end
|
154
|
+
|
155
|
+
if @sender.nil?
|
156
|
+
invalid_properties.push('invalid value for "sender", sender cannot be nil.')
|
157
|
+
end
|
158
|
+
|
159
|
+
if @updated_at.nil?
|
160
|
+
invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
|
161
|
+
end
|
162
|
+
|
163
|
+
if @user_id.nil?
|
164
|
+
invalid_properties.push('invalid value for "user_id", user_id cannot be nil.')
|
165
|
+
end
|
166
|
+
|
167
|
+
invalid_properties
|
168
|
+
end
|
169
|
+
|
170
|
+
# Check to see if the all the properties in the model are valid
|
171
|
+
# @return true if the model is valid
|
172
|
+
def valid?
|
173
|
+
return false if @created_at.nil?
|
174
|
+
return false if @notification_type.nil?
|
175
|
+
return false if @sender.nil?
|
176
|
+
return false if @updated_at.nil?
|
177
|
+
return false if @user_id.nil?
|
178
|
+
true
|
179
|
+
end
|
180
|
+
|
181
|
+
# Checks equality by comparing each attribute.
|
182
|
+
# @param [Object] Object to be compared
|
183
|
+
def ==(o)
|
184
|
+
return true if self.equal?(o)
|
185
|
+
self.class == o.class &&
|
186
|
+
bounce_mta == o.bounce_mta &&
|
187
|
+
bounce_recipients == o.bounce_recipients &&
|
188
|
+
bounce_sub_type == o.bounce_sub_type &&
|
189
|
+
bounce_type == o.bounce_type &&
|
190
|
+
created_at == o.created_at &&
|
191
|
+
id == o.id &&
|
192
|
+
notification_type == o.notification_type &&
|
193
|
+
sender == o.sender &&
|
194
|
+
sent_to_recipients == o.sent_to_recipients &&
|
195
|
+
updated_at == o.updated_at &&
|
196
|
+
user_id == o.user_id
|
197
|
+
end
|
198
|
+
|
199
|
+
# @see the `==` method
|
200
|
+
# @param [Object] Object to be compared
|
201
|
+
def eql?(o)
|
202
|
+
self == o
|
203
|
+
end
|
204
|
+
|
205
|
+
# Calculates hash code according to all attributes.
|
206
|
+
# @return [Integer] Hash code
|
207
|
+
def hash
|
208
|
+
[bounce_mta, bounce_recipients, bounce_sub_type, bounce_type, created_at, id, notification_type, sender, sent_to_recipients, updated_at, user_id].hash
|
209
|
+
end
|
210
|
+
|
211
|
+
# Builds the object from hash
|
212
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
213
|
+
# @return [Object] Returns the model itself
|
214
|
+
def self.build_from_hash(attributes)
|
215
|
+
new.build_from_hash(attributes)
|
216
|
+
end
|
217
|
+
|
218
|
+
# Builds the object from hash
|
219
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
220
|
+
# @return [Object] Returns the model itself
|
221
|
+
def build_from_hash(attributes)
|
222
|
+
return nil unless attributes.is_a?(Hash)
|
223
|
+
self.class.openapi_types.each_pair do |key, type|
|
224
|
+
if type =~ /\AArray<(.*)>/i
|
225
|
+
# check to ensure the input is an array given that the attribute
|
226
|
+
# is documented as an array but the input is not
|
227
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
228
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
229
|
+
end
|
230
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
231
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
232
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
233
|
+
end
|
234
|
+
|
235
|
+
self
|
236
|
+
end
|
237
|
+
|
238
|
+
# Deserializes the data based on type
|
239
|
+
# @param string type Data type
|
240
|
+
# @param string value Value to be deserialized
|
241
|
+
# @return [Object] Deserialized data
|
242
|
+
def _deserialize(type, value)
|
243
|
+
case type.to_sym
|
244
|
+
when :DateTime
|
245
|
+
DateTime.parse(value)
|
246
|
+
when :Date
|
247
|
+
Date.parse(value)
|
248
|
+
when :String
|
249
|
+
value.to_s
|
250
|
+
when :Integer
|
251
|
+
value.to_i
|
252
|
+
when :Float
|
253
|
+
value.to_f
|
254
|
+
when :Boolean
|
255
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
256
|
+
true
|
257
|
+
else
|
258
|
+
false
|
259
|
+
end
|
260
|
+
when :Object
|
261
|
+
# generic object (usually a Hash), return directly
|
262
|
+
value
|
263
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
264
|
+
inner_type = Regexp.last_match[:inner_type]
|
265
|
+
value.map { |v| _deserialize(inner_type, v) }
|
266
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
267
|
+
k_type = Regexp.last_match[:k_type]
|
268
|
+
v_type = Regexp.last_match[:v_type]
|
269
|
+
{}.tap do |hash|
|
270
|
+
value.each do |k, v|
|
271
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
272
|
+
end
|
273
|
+
end
|
274
|
+
else # model
|
275
|
+
MailSlurpClient.const_get(type).build_from_hash(value)
|
276
|
+
end
|
277
|
+
end
|
278
|
+
|
279
|
+
# Returns the string representation of the object
|
280
|
+
# @return [String] String presentation of the object
|
281
|
+
def to_s
|
282
|
+
to_hash.to_s
|
283
|
+
end
|
284
|
+
|
285
|
+
# to_body is an alias to to_hash (backward compatibility)
|
286
|
+
# @return [Hash] Returns the object in the form of hash
|
287
|
+
def to_body
|
288
|
+
to_hash
|
289
|
+
end
|
290
|
+
|
291
|
+
# Returns the object in the form of hash
|
292
|
+
# @return [Hash] Returns the object in the form of hash
|
293
|
+
def to_hash
|
294
|
+
hash = {}
|
295
|
+
self.class.attribute_map.each_pair do |attr, param|
|
296
|
+
value = self.send(attr)
|
297
|
+
if value.nil?
|
298
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
299
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
300
|
+
end
|
301
|
+
|
302
|
+
hash[param] = _to_hash(value)
|
303
|
+
end
|
304
|
+
hash
|
305
|
+
end
|
306
|
+
|
307
|
+
# Outputs non-array value in the form of hash
|
308
|
+
# For object, use to_hash. Otherwise, just return the value
|
309
|
+
# @param [Object] value Any valid value
|
310
|
+
# @return [Hash] Returns the value in the form of hash
|
311
|
+
def _to_hash(value)
|
312
|
+
if value.is_a?(Array)
|
313
|
+
value.compact.map { |v| _to_hash(v) }
|
314
|
+
elsif value.is_a?(Hash)
|
315
|
+
{}.tap do |hash|
|
316
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
317
|
+
end
|
318
|
+
elsif value.respond_to? :to_hash
|
319
|
+
value.to_hash
|
320
|
+
else
|
321
|
+
value
|
322
|
+
end
|
323
|
+
end
|
324
|
+
end
|
325
|
+
end
|