mailslurp_client 11.8.8 → 11.8.13

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c702eade426101609dd2228636c548bd8d633824725c638accce8b628e0d141a
4
- data.tar.gz: 8ebca99cae0bfa1478c8406c1afc3cd7ec0139ec66bc10b41d9bdaa70bdf657d
3
+ metadata.gz: 11ebaabec4bbbf121b6a4e25953c0c9facd1eca5f287d13652d58e8e148857d3
4
+ data.tar.gz: 1b99f7d5e4dfc0079e8918051a83b7a32b81171dbd3eee85eaad1c9d4aa429ce
5
5
  SHA512:
6
- metadata.gz: 4852c644b188bd2f36d27df68980aa93773f928c9f4dcbf7ea46d9022ea0ec735e9b634b2a72286612ead872ace64b7ec06a2535f1d1e302d504c6c7592bd0ee
7
- data.tar.gz: 309f2a0b7d470befc805a6bcf036c4c8c48e4287a2e04939ae68cb0a0c82daf8742aa73e21eb238d17af576175b2501791a6cbe9776cfa98365fed5d40c22faa
6
+ metadata.gz: a3da7479cb4a1577644c0113c3f0a04eafe3153e57825ee87dab7a7197fbf5ff110ee6aaa94ce90dd66a878112fe2e7a98d3c138ebe86c31bedbee0cd0271343
7
+ data.tar.gz: e0ed6e71c82824d0b3d8e34b443f56f2e364c4aa16cd9b634442b51be529c02ea0e9adcfb8ad3b4748d3fc8d0a9059f6e1db16e46a63af18019ebaa3961a9e52
@@ -104,6 +104,7 @@ require 'mailslurp_client/models/validation_message'
104
104
  require 'mailslurp_client/models/verify_email_address_options'
105
105
  require 'mailslurp_client/models/wait_for_conditions'
106
106
  require 'mailslurp_client/models/webhook_dto'
107
+ require 'mailslurp_client/models/webhook_payload'
107
108
  require 'mailslurp_client/models/webhook_projection'
108
109
  require 'mailslurp_client/models/webhook_test_request'
109
110
  require 'mailslurp_client/models/webhook_test_response'
@@ -803,7 +803,7 @@ module MailSlurpClient
803
803
  return data, status_code, headers
804
804
  end
805
805
 
806
- # Get all emails
806
+ # Get all emails in all inboxes. Email API list all.
807
807
  # By default returns all emails across all inboxes sorted by ascending created at date. Responses are paginated. You can restrict results to a list of inbox IDs. You can also filter out read messages
808
808
  # @param [Hash] opts the optional parameters
809
809
  # @option opts [Array<String>] :inbox_id Optional inbox ids to filter by. Can be repeated. By default will use all inboxes belonging to your account.
@@ -817,7 +817,7 @@ module MailSlurpClient
817
817
  data
818
818
  end
819
819
 
820
- # Get all emails
820
+ # Get all emails in all inboxes. Email API list all.
821
821
  # By default returns all emails across all inboxes sorted by ascending created at date. Responses are paginated. You can restrict results to a list of inbox IDs. You can also filter out read messages
822
822
  # @param [Hash] opts the optional parameters
823
823
  # @option opts [Array<String>] :inbox_id Optional inbox ids to filter by. Can be repeated. By default will use all inboxes belonging to your account.
@@ -996,7 +996,7 @@ module MailSlurpClient
996
996
  return data, status_code, headers
997
997
  end
998
998
 
999
- # Get all organization emails
999
+ # Get all organization emails. List team or shared test email accounts
1000
1000
  # By default returns all emails across all team inboxes sorted by ascending created at date. Responses are paginated. You can restrict results to a list of inbox IDs. You can also filter out read messages
1001
1001
  # @param [Hash] opts the optional parameters
1002
1002
  # @option opts [Array<String>] :inbox_id Optional inbox ids to filter by. Can be repeated. By default will use all inboxes belonging to your account.
@@ -1010,7 +1010,7 @@ module MailSlurpClient
1010
1010
  data
1011
1011
  end
1012
1012
 
1013
- # Get all organization emails
1013
+ # Get all organization emails. List team or shared test email accounts
1014
1014
  # By default returns all emails across all team inboxes sorted by ascending created at date. Responses are paginated. You can restrict results to a list of inbox IDs. You can also filter out read messages
1015
1015
  # @param [Hash] opts the optional parameters
1016
1016
  # @option opts [Array<String>] :inbox_id Optional inbox ids to filter by. Can be repeated. By default will use all inboxes belonging to your account.
@@ -1196,7 +1196,7 @@ module MailSlurpClient
1196
1196
  end
1197
1197
 
1198
1198
  # Get unread email count
1199
- # Get number of emails unread
1199
+ # Get number of emails unread. Unread means has not been viewed in dashboard or returned in an email API response
1200
1200
  # @param [Hash] opts the optional parameters
1201
1201
  # @return [UnreadCount]
1202
1202
  def get_unread_email_count(opts = {})
@@ -1205,7 +1205,7 @@ module MailSlurpClient
1205
1205
  end
1206
1206
 
1207
1207
  # Get unread email count
1208
- # Get number of emails unread
1208
+ # Get number of emails unread. Unread means has not been viewed in dashboard or returned in an email API response
1209
1209
  # @param [Hash] opts the optional parameters
1210
1210
  # @return [Array<(UnreadCount, Integer, Hash)>] UnreadCount data, response status code and response headers
1211
1211
  def get_unread_email_count_with_http_info(opts = {})
@@ -156,8 +156,8 @@ module MailSlurpClient
156
156
  # List Webhooks Paginated
157
157
  # List webhooks in paginated form. Allows for page index, page size, and sort direction.
158
158
  # @param [Hash] opts the optional parameters
159
- # @option opts [Integer] :page Optional page index in inbox list pagination (default to 0)
160
- # @option opts [Integer] :size Optional page size in inbox list pagination (default to 20)
159
+ # @option opts [Integer] :page Optional page index in list pagination (default to 0)
160
+ # @option opts [Integer] :size Optional page size in list pagination (default to 20)
161
161
  # @option opts [String] :sort Optional createdAt sort direction ASC or DESC (default to 'ASC')
162
162
  # @return [PageWebhookProjection]
163
163
  def get_all_webhooks(opts = {})
@@ -168,8 +168,8 @@ module MailSlurpClient
168
168
  # List Webhooks Paginated
169
169
  # List webhooks in paginated form. Allows for page index, page size, and sort direction.
170
170
  # @param [Hash] opts the optional parameters
171
- # @option opts [Integer] :page Optional page index in inbox list pagination
172
- # @option opts [Integer] :size Optional page size in inbox list pagination
171
+ # @option opts [Integer] :page Optional page index in list pagination
172
+ # @option opts [Integer] :size Optional page size in list pagination
173
173
  # @option opts [String] :sort Optional createdAt sort direction ASC or DESC
174
174
  # @return [Array<(PageWebhookProjection, Integer, Hash)>] PageWebhookProjection data, response status code and response headers
175
175
  def get_all_webhooks_with_http_info(opts = {})
@@ -222,6 +222,60 @@ module MailSlurpClient
222
222
  return data, status_code, headers
223
223
  end
224
224
 
225
+ # Get test webhook payload example
226
+ # @param [Hash] opts the optional parameters
227
+ # @return [WebhookPayload]
228
+ def get_test_webhook_payload(opts = {})
229
+ data, _status_code, _headers = get_test_webhook_payload_with_http_info(opts)
230
+ data
231
+ end
232
+
233
+ # Get test webhook payload example
234
+ # @param [Hash] opts the optional parameters
235
+ # @return [Array<(WebhookPayload, Integer, Hash)>] WebhookPayload data, response status code and response headers
236
+ def get_test_webhook_payload_with_http_info(opts = {})
237
+ if @api_client.config.debugging
238
+ @api_client.config.logger.debug 'Calling API: WebhookControllerApi.get_test_webhook_payload ...'
239
+ end
240
+ # resource path
241
+ local_var_path = '/webhooks/test'
242
+
243
+ # query parameters
244
+ query_params = opts[:query_params] || {}
245
+
246
+ # header parameters
247
+ header_params = opts[:header_params] || {}
248
+ # HTTP header 'Accept' (if needed)
249
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
250
+
251
+ # form parameters
252
+ form_params = opts[:form_params] || {}
253
+
254
+ # http body (model)
255
+ post_body = opts[:body]
256
+
257
+ # return_type
258
+ return_type = opts[:return_type] || 'WebhookPayload'
259
+
260
+ # auth_names
261
+ auth_names = opts[:auth_names] || ['API_KEY']
262
+
263
+ new_options = opts.merge(
264
+ :header_params => header_params,
265
+ :query_params => query_params,
266
+ :form_params => form_params,
267
+ :body => post_body,
268
+ :auth_names => auth_names,
269
+ :return_type => return_type
270
+ )
271
+
272
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
273
+ if @api_client.config.debugging
274
+ @api_client.config.logger.debug "API called: WebhookControllerApi#get_test_webhook_payload\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
275
+ end
276
+ return data, status_code, headers
277
+ end
278
+
225
279
  # Get a webhook for an Inbox
226
280
  # @param webhook_id [String] webhookId
227
281
  # @param [Hash] opts the optional parameters
@@ -282,7 +336,7 @@ module MailSlurpClient
282
336
  return data, status_code, headers
283
337
  end
284
338
 
285
- # Get all Webhooks for an Inbox
339
+ # Get all webhooks for an Inbox
286
340
  # @param inbox_id [String] inboxId
287
341
  # @param [Hash] opts the optional parameters
288
342
  # @return [Array<WebhookDto>]
@@ -291,7 +345,7 @@ module MailSlurpClient
291
345
  data
292
346
  end
293
347
 
294
- # Get all Webhooks for an Inbox
348
+ # Get all webhooks for an Inbox
295
349
  # @param inbox_id [String] inboxId
296
350
  # @param [Hash] opts the optional parameters
297
351
  # @return [Array<(Array<WebhookDto>, Integer, Hash)>] Array<WebhookDto> data, response status code and response headers
@@ -24,12 +24,38 @@ module MailSlurpClient
24
24
  # The top level domain you wish to use with MailSlurp. Do not specify subdomain just the top level. So `test.com` covers all subdomains such as `mail.test.com`. Don't include a protocol such as `http://`. Once added you must complete the verification steps by adding the returned records to your domain.
25
25
  attr_accessor :domain
26
26
 
27
+ # Domain type to create. HTTP or SMTP domain. HTTP domain uses MailSlurps SES MX records. SMTP uses a custom SMTP server MX record
28
+ attr_accessor :domain_type
29
+
30
+ class EnumAttributeValidator
31
+ attr_reader :datatype
32
+ attr_reader :allowable_values
33
+
34
+ def initialize(datatype, allowable_values)
35
+ @allowable_values = allowable_values.map do |value|
36
+ case datatype.to_s
37
+ when /Integer/i
38
+ value.to_i
39
+ when /Float/i
40
+ value.to_f
41
+ else
42
+ value
43
+ end
44
+ end
45
+ end
46
+
47
+ def valid?(value)
48
+ !value || allowable_values.include?(value)
49
+ end
50
+ end
51
+
27
52
  # Attribute mapping from ruby-style variable name to JSON key.
28
53
  def self.attribute_map
29
54
  {
30
55
  :'created_catch_all_inbox' => :'createdCatchAllInbox',
31
56
  :'description' => :'description',
32
- :'domain' => :'domain'
57
+ :'domain' => :'domain',
58
+ :'domain_type' => :'domainType'
33
59
  }
34
60
  end
35
61
 
@@ -38,7 +64,8 @@ module MailSlurpClient
38
64
  {
39
65
  :'created_catch_all_inbox' => :'Boolean',
40
66
  :'description' => :'String',
41
- :'domain' => :'String'
67
+ :'domain' => :'String',
68
+ :'domain_type' => :'String'
42
69
  }
43
70
  end
44
71
 
@@ -74,6 +101,10 @@ module MailSlurpClient
74
101
  if attributes.key?(:'domain')
75
102
  self.domain = attributes[:'domain']
76
103
  end
104
+
105
+ if attributes.key?(:'domain_type')
106
+ self.domain_type = attributes[:'domain_type']
107
+ end
77
108
  end
78
109
 
79
110
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -86,9 +117,21 @@ module MailSlurpClient
86
117
  # Check to see if the all the properties in the model are valid
87
118
  # @return true if the model is valid
88
119
  def valid?
120
+ domain_type_validator = EnumAttributeValidator.new('String', ["HTTP_INBOX", "SMTP_DOMAIN"])
121
+ return false unless domain_type_validator.valid?(@domain_type)
89
122
  true
90
123
  end
91
124
 
125
+ # Custom attribute writer method checking allowed values (enum).
126
+ # @param [Object] domain_type Object to be assigned
127
+ def domain_type=(domain_type)
128
+ validator = EnumAttributeValidator.new('String', ["HTTP_INBOX", "SMTP_DOMAIN"])
129
+ unless validator.valid?(domain_type)
130
+ fail ArgumentError, "invalid value for \"domain_type\", must be one of #{validator.allowable_values}."
131
+ end
132
+ @domain_type = domain_type
133
+ end
134
+
92
135
  # Checks equality by comparing each attribute.
93
136
  # @param [Object] Object to be compared
94
137
  def ==(o)
@@ -96,7 +139,8 @@ module MailSlurpClient
96
139
  self.class == o.class &&
97
140
  created_catch_all_inbox == o.created_catch_all_inbox &&
98
141
  description == o.description &&
99
- domain == o.domain
142
+ domain == o.domain &&
143
+ domain_type == o.domain_type
100
144
  end
101
145
 
102
146
  # @see the `==` method
@@ -108,7 +152,7 @@ module MailSlurpClient
108
152
  # Calculates hash code according to all attributes.
109
153
  # @return [Integer] Hash code
110
154
  def hash
111
- [created_catch_all_inbox, description, domain].hash
155
+ [created_catch_all_inbox, description, domain, domain_type].hash
112
156
  end
113
157
 
114
158
  # Builds the object from hash
@@ -33,6 +33,9 @@ module MailSlurpClient
33
33
  # Is the inbox favorited. Favouriting inboxes is typically done in the dashboard for quick access or filtering
34
34
  attr_accessor :favourite
35
35
 
36
+ # HTTP or SMTP inbox
37
+ attr_accessor :inbox_type
38
+
36
39
  # Optional name of the inbox. Displayed in the dashboard for easier search
37
40
  attr_accessor :name
38
41
 
@@ -42,6 +45,28 @@ module MailSlurpClient
42
45
  # Use the MailSlurp domain name pool with this inbox when creating the email address. Defaults to null. If enabled the inbox will be an email address with a domain randomly chosen from a list of the MailSlurp domains. This is useful when the default `@mailslurp.com` email addresses used with inboxes are blocked or considered spam by a provider or receiving service. When domain pool is enabled an email address will be generated ending in `@mailslurp.{world,info,xyz,...}` . This means a TLD is randomly selecting from a list of `.biz`, `.info`, `.xyz` etc to add variance to the generated email addresses. When null or false MailSlurp uses the default behavior of `@mailslurp.com` or custom email address provided by the emailAddress field.
43
46
  attr_accessor :use_domain_pool
44
47
 
48
+ class EnumAttributeValidator
49
+ attr_reader :datatype
50
+ attr_reader :allowable_values
51
+
52
+ def initialize(datatype, allowable_values)
53
+ @allowable_values = allowable_values.map do |value|
54
+ case datatype.to_s
55
+ when /Integer/i
56
+ value.to_i
57
+ when /Float/i
58
+ value.to_f
59
+ else
60
+ value
61
+ end
62
+ end
63
+ end
64
+
65
+ def valid?(value)
66
+ !value || allowable_values.include?(value)
67
+ end
68
+ end
69
+
45
70
  # Attribute mapping from ruby-style variable name to JSON key.
46
71
  def self.attribute_map
47
72
  {
@@ -51,6 +76,7 @@ module MailSlurpClient
51
76
  :'expires_at' => :'expiresAt',
52
77
  :'expires_in' => :'expiresIn',
53
78
  :'favourite' => :'favourite',
79
+ :'inbox_type' => :'inboxType',
54
80
  :'name' => :'name',
55
81
  :'tags' => :'tags',
56
82
  :'use_domain_pool' => :'useDomainPool'
@@ -66,6 +92,7 @@ module MailSlurpClient
66
92
  :'expires_at' => :'DateTime',
67
93
  :'expires_in' => :'Integer',
68
94
  :'favourite' => :'Boolean',
95
+ :'inbox_type' => :'String',
69
96
  :'name' => :'String',
70
97
  :'tags' => :'Array<String>',
71
98
  :'use_domain_pool' => :'Boolean'
@@ -117,6 +144,10 @@ module MailSlurpClient
117
144
  self.favourite = attributes[:'favourite']
118
145
  end
119
146
 
147
+ if attributes.key?(:'inbox_type')
148
+ self.inbox_type = attributes[:'inbox_type']
149
+ end
150
+
120
151
  if attributes.key?(:'name')
121
152
  self.name = attributes[:'name']
122
153
  end
@@ -142,9 +173,21 @@ module MailSlurpClient
142
173
  # Check to see if the all the properties in the model are valid
143
174
  # @return true if the model is valid
144
175
  def valid?
176
+ inbox_type_validator = EnumAttributeValidator.new('String', ["HTTP_INBOX", "SMTP_INBOX"])
177
+ return false unless inbox_type_validator.valid?(@inbox_type)
145
178
  true
146
179
  end
147
180
 
181
+ # Custom attribute writer method checking allowed values (enum).
182
+ # @param [Object] inbox_type Object to be assigned
183
+ def inbox_type=(inbox_type)
184
+ validator = EnumAttributeValidator.new('String', ["HTTP_INBOX", "SMTP_INBOX"])
185
+ unless validator.valid?(inbox_type)
186
+ fail ArgumentError, "invalid value for \"inbox_type\", must be one of #{validator.allowable_values}."
187
+ end
188
+ @inbox_type = inbox_type
189
+ end
190
+
148
191
  # Checks equality by comparing each attribute.
149
192
  # @param [Object] Object to be compared
150
193
  def ==(o)
@@ -156,6 +199,7 @@ module MailSlurpClient
156
199
  expires_at == o.expires_at &&
157
200
  expires_in == o.expires_in &&
158
201
  favourite == o.favourite &&
202
+ inbox_type == o.inbox_type &&
159
203
  name == o.name &&
160
204
  tags == o.tags &&
161
205
  use_domain_pool == o.use_domain_pool
@@ -170,7 +214,7 @@ module MailSlurpClient
170
214
  # Calculates hash code according to all attributes.
171
215
  # @return [Integer] Hash code
172
216
  def hash
173
- [allow_team_access, description, email_address, expires_at, expires_in, favourite, name, tags, use_domain_pool].hash
217
+ [allow_team_access, description, email_address, expires_at, expires_in, favourite, inbox_type, name, tags, use_domain_pool].hash
174
218
  end
175
219
 
176
220
  # Builds the object from hash
@@ -0,0 +1,370 @@
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
+ # MailSlurp webhook payload schema. This schema describes the JSON object that is sent via HTTP POST to webhook urls when an email is received by an inbox that a webhook is attached to. Payloads may be delivered multiple times so use the ID as a key for event uniqueness. The payload contains IDs for the email and inbox affected. Use these to fetch more data related to the event using appropriate inbox and email endpoints. See https://www.mailslurp.com/guides/email-webhooks/ for more information. Your webhook endpoint should accept POST HTTP request and return a 200 in under 30 seconds. Process the webhook asynchronously if you need to.
17
+ class WebhookPayload
18
+ # List of attachment meta data objects if attachments present
19
+ attr_accessor :attachment_meta_datas
20
+
21
+ # List of `BCC` recipients email was addressed to
22
+ attr_accessor :bcc
23
+
24
+ # List of `CC` recipients email was addressed to
25
+ attr_accessor :cc
26
+
27
+ # Date time of event creation
28
+ attr_accessor :created_at
29
+
30
+ # ID of the email that was received. Use this ID for fetching the email
31
+ attr_accessor :email_id
32
+
33
+ # Name of the event type webhook is being triggered for
34
+ attr_accessor :event_name
35
+
36
+ # Who the email was sent from
37
+ attr_accessor :from
38
+
39
+ # Id of the inbox that receive an email
40
+ attr_accessor :inbox_id
41
+
42
+ # Idempotent message ID. Store this ID locally or in a database to prevent message duplication.
43
+ attr_accessor :message_id
44
+
45
+ # The subject line of the email message
46
+ attr_accessor :subject
47
+
48
+ # List of `To` recipients email was addressed to
49
+ attr_accessor :to
50
+
51
+ # ID of webhook entity being triggered
52
+ attr_accessor :webhook_id
53
+
54
+ # Name of the webhook being triggered
55
+ attr_accessor :webhook_name
56
+
57
+ class EnumAttributeValidator
58
+ attr_reader :datatype
59
+ attr_reader :allowable_values
60
+
61
+ def initialize(datatype, allowable_values)
62
+ @allowable_values = allowable_values.map do |value|
63
+ case datatype.to_s
64
+ when /Integer/i
65
+ value.to_i
66
+ when /Float/i
67
+ value.to_f
68
+ else
69
+ value
70
+ end
71
+ end
72
+ end
73
+
74
+ def valid?(value)
75
+ !value || allowable_values.include?(value)
76
+ end
77
+ end
78
+
79
+ # Attribute mapping from ruby-style variable name to JSON key.
80
+ def self.attribute_map
81
+ {
82
+ :'attachment_meta_datas' => :'attachmentMetaDatas',
83
+ :'bcc' => :'bcc',
84
+ :'cc' => :'cc',
85
+ :'created_at' => :'createdAt',
86
+ :'email_id' => :'emailId',
87
+ :'event_name' => :'eventName',
88
+ :'from' => :'from',
89
+ :'inbox_id' => :'inboxId',
90
+ :'message_id' => :'messageId',
91
+ :'subject' => :'subject',
92
+ :'to' => :'to',
93
+ :'webhook_id' => :'webhookId',
94
+ :'webhook_name' => :'webhookName'
95
+ }
96
+ end
97
+
98
+ # Attribute type mapping.
99
+ def self.openapi_types
100
+ {
101
+ :'attachment_meta_datas' => :'Array<AttachmentMetaData>',
102
+ :'bcc' => :'Array<String>',
103
+ :'cc' => :'Array<String>',
104
+ :'created_at' => :'DateTime',
105
+ :'email_id' => :'String',
106
+ :'event_name' => :'String',
107
+ :'from' => :'String',
108
+ :'inbox_id' => :'String',
109
+ :'message_id' => :'String',
110
+ :'subject' => :'String',
111
+ :'to' => :'Array<String>',
112
+ :'webhook_id' => :'String',
113
+ :'webhook_name' => :'String'
114
+ }
115
+ end
116
+
117
+ # List of attributes with nullable: true
118
+ def self.openapi_nullable
119
+ Set.new([
120
+ ])
121
+ end
122
+
123
+ # Initializes the object
124
+ # @param [Hash] attributes Model attributes in the form of hash
125
+ def initialize(attributes = {})
126
+ if (!attributes.is_a?(Hash))
127
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::WebhookPayload` initialize method"
128
+ end
129
+
130
+ # check to see if the attribute exists and convert string to symbol for hash key
131
+ attributes = attributes.each_with_object({}) { |(k, v), h|
132
+ if (!self.class.attribute_map.key?(k.to_sym))
133
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::WebhookPayload`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
134
+ end
135
+ h[k.to_sym] = v
136
+ }
137
+
138
+ if attributes.key?(:'attachment_meta_datas')
139
+ if (value = attributes[:'attachment_meta_datas']).is_a?(Array)
140
+ self.attachment_meta_datas = value
141
+ end
142
+ end
143
+
144
+ if attributes.key?(:'bcc')
145
+ if (value = attributes[:'bcc']).is_a?(Array)
146
+ self.bcc = value
147
+ end
148
+ end
149
+
150
+ if attributes.key?(:'cc')
151
+ if (value = attributes[:'cc']).is_a?(Array)
152
+ self.cc = value
153
+ end
154
+ end
155
+
156
+ if attributes.key?(:'created_at')
157
+ self.created_at = attributes[:'created_at']
158
+ end
159
+
160
+ if attributes.key?(:'email_id')
161
+ self.email_id = attributes[:'email_id']
162
+ end
163
+
164
+ if attributes.key?(:'event_name')
165
+ self.event_name = attributes[:'event_name']
166
+ end
167
+
168
+ if attributes.key?(:'from')
169
+ self.from = attributes[:'from']
170
+ end
171
+
172
+ if attributes.key?(:'inbox_id')
173
+ self.inbox_id = attributes[:'inbox_id']
174
+ end
175
+
176
+ if attributes.key?(:'message_id')
177
+ self.message_id = attributes[:'message_id']
178
+ end
179
+
180
+ if attributes.key?(:'subject')
181
+ self.subject = attributes[:'subject']
182
+ end
183
+
184
+ if attributes.key?(:'to')
185
+ if (value = attributes[:'to']).is_a?(Array)
186
+ self.to = value
187
+ end
188
+ end
189
+
190
+ if attributes.key?(:'webhook_id')
191
+ self.webhook_id = attributes[:'webhook_id']
192
+ end
193
+
194
+ if attributes.key?(:'webhook_name')
195
+ self.webhook_name = attributes[:'webhook_name']
196
+ end
197
+ end
198
+
199
+ # Show invalid properties with the reasons. Usually used together with valid?
200
+ # @return Array for valid properties with the reasons
201
+ def list_invalid_properties
202
+ invalid_properties = Array.new
203
+ invalid_properties
204
+ end
205
+
206
+ # Check to see if the all the properties in the model are valid
207
+ # @return true if the model is valid
208
+ def valid?
209
+ event_name_validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED"])
210
+ return false unless event_name_validator.valid?(@event_name)
211
+ true
212
+ end
213
+
214
+ # Custom attribute writer method checking allowed values (enum).
215
+ # @param [Object] event_name Object to be assigned
216
+ def event_name=(event_name)
217
+ validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED"])
218
+ unless validator.valid?(event_name)
219
+ fail ArgumentError, "invalid value for \"event_name\", must be one of #{validator.allowable_values}."
220
+ end
221
+ @event_name = event_name
222
+ end
223
+
224
+ # Checks equality by comparing each attribute.
225
+ # @param [Object] Object to be compared
226
+ def ==(o)
227
+ return true if self.equal?(o)
228
+ self.class == o.class &&
229
+ attachment_meta_datas == o.attachment_meta_datas &&
230
+ bcc == o.bcc &&
231
+ cc == o.cc &&
232
+ created_at == o.created_at &&
233
+ email_id == o.email_id &&
234
+ event_name == o.event_name &&
235
+ from == o.from &&
236
+ inbox_id == o.inbox_id &&
237
+ message_id == o.message_id &&
238
+ subject == o.subject &&
239
+ to == o.to &&
240
+ webhook_id == o.webhook_id &&
241
+ webhook_name == o.webhook_name
242
+ end
243
+
244
+ # @see the `==` method
245
+ # @param [Object] Object to be compared
246
+ def eql?(o)
247
+ self == o
248
+ end
249
+
250
+ # Calculates hash code according to all attributes.
251
+ # @return [Integer] Hash code
252
+ def hash
253
+ [attachment_meta_datas, bcc, cc, created_at, email_id, event_name, from, inbox_id, message_id, subject, to, webhook_id, webhook_name].hash
254
+ end
255
+
256
+ # Builds the object from hash
257
+ # @param [Hash] attributes Model attributes in the form of hash
258
+ # @return [Object] Returns the model itself
259
+ def self.build_from_hash(attributes)
260
+ new.build_from_hash(attributes)
261
+ end
262
+
263
+ # Builds the object from hash
264
+ # @param [Hash] attributes Model attributes in the form of hash
265
+ # @return [Object] Returns the model itself
266
+ def build_from_hash(attributes)
267
+ return nil unless attributes.is_a?(Hash)
268
+ self.class.openapi_types.each_pair do |key, type|
269
+ if type =~ /\AArray<(.*)>/i
270
+ # check to ensure the input is an array given that the attribute
271
+ # is documented as an array but the input is not
272
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
273
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
274
+ end
275
+ elsif !attributes[self.class.attribute_map[key]].nil?
276
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
277
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
278
+ end
279
+
280
+ self
281
+ end
282
+
283
+ # Deserializes the data based on type
284
+ # @param string type Data type
285
+ # @param string value Value to be deserialized
286
+ # @return [Object] Deserialized data
287
+ def _deserialize(type, value)
288
+ case type.to_sym
289
+ when :DateTime
290
+ DateTime.parse(value)
291
+ when :Date
292
+ Date.parse(value)
293
+ when :String
294
+ value.to_s
295
+ when :Integer
296
+ value.to_i
297
+ when :Float
298
+ value.to_f
299
+ when :Boolean
300
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
301
+ true
302
+ else
303
+ false
304
+ end
305
+ when :Object
306
+ # generic object (usually a Hash), return directly
307
+ value
308
+ when /\AArray<(?<inner_type>.+)>\z/
309
+ inner_type = Regexp.last_match[:inner_type]
310
+ value.map { |v| _deserialize(inner_type, v) }
311
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
312
+ k_type = Regexp.last_match[:k_type]
313
+ v_type = Regexp.last_match[:v_type]
314
+ {}.tap do |hash|
315
+ value.each do |k, v|
316
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
317
+ end
318
+ end
319
+ else # model
320
+ MailSlurpClient.const_get(type).build_from_hash(value)
321
+ end
322
+ end
323
+
324
+ # Returns the string representation of the object
325
+ # @return [String] String presentation of the object
326
+ def to_s
327
+ to_hash.to_s
328
+ end
329
+
330
+ # to_body is an alias to to_hash (backward compatibility)
331
+ # @return [Hash] Returns the object in the form of hash
332
+ def to_body
333
+ to_hash
334
+ end
335
+
336
+ # Returns the object in the form of hash
337
+ # @return [Hash] Returns the object in the form of hash
338
+ def to_hash
339
+ hash = {}
340
+ self.class.attribute_map.each_pair do |attr, param|
341
+ value = self.send(attr)
342
+ if value.nil?
343
+ is_nullable = self.class.openapi_nullable.include?(attr)
344
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
345
+ end
346
+
347
+ hash[param] = _to_hash(value)
348
+ end
349
+ hash
350
+ end
351
+
352
+ # Outputs non-array value in the form of hash
353
+ # For object, use to_hash. Otherwise, just return the value
354
+ # @param [Object] value Any valid value
355
+ # @return [Hash] Returns the value in the form of hash
356
+ def _to_hash(value)
357
+ if value.is_a?(Array)
358
+ value.compact.map { |v| _to_hash(v) }
359
+ elsif value.is_a?(Hash)
360
+ {}.tap do |hash|
361
+ value.each { |k, v| hash[k] = _to_hash(v) }
362
+ end
363
+ elsif value.respond_to? :to_hash
364
+ value.to_hash
365
+ else
366
+ value
367
+ end
368
+ end
369
+ end
370
+ end
@@ -11,5 +11,5 @@ OpenAPI Generator version: 4.3.1
11
11
  =end
12
12
 
13
13
  module MailSlurpClient
14
- VERSION = '11.8.8'
14
+ VERSION = '11.8.13'
15
15
  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: 11.8.8
4
+ version: 11.8.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - mailslurp
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-26 00:00:00.000000000 Z
11
+ date: 2021-05-02 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.
@@ -130,6 +130,7 @@ files:
130
130
  - lib/mailslurp_client/models/verify_email_address_options.rb
131
131
  - lib/mailslurp_client/models/wait_for_conditions.rb
132
132
  - lib/mailslurp_client/models/webhook_dto.rb
133
+ - lib/mailslurp_client/models/webhook_payload.rb
133
134
  - lib/mailslurp_client/models/webhook_projection.rb
134
135
  - lib/mailslurp_client/models/webhook_test_request.rb
135
136
  - lib/mailslurp_client/models/webhook_test_response.rb