mailslurp_client 15.7.8 → 15.7.13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (187) hide show
  1. checksums.yaml +4 -4
  2. data/lib/mailslurp_client/api/alias_controller_api.rb +1 -1
  3. data/lib/mailslurp_client/api/attachment_controller_api.rb +1 -1
  4. data/lib/mailslurp_client/api/bounce_controller_api.rb +1 -1
  5. data/lib/mailslurp_client/api/bulk_actions_controller_api.rb +1 -1
  6. data/lib/mailslurp_client/api/common_actions_controller_api.rb +1 -1
  7. data/lib/mailslurp_client/api/contact_controller_api.rb +1 -1
  8. data/lib/mailslurp_client/api/domain_controller_api.rb +1 -1
  9. data/lib/mailslurp_client/api/email_controller_api.rb +1 -1
  10. data/lib/mailslurp_client/api/email_verification_controller_api.rb +1 -1
  11. data/lib/mailslurp_client/api/expired_controller_api.rb +1 -1
  12. data/lib/mailslurp_client/api/export_controller_api.rb +1 -1
  13. data/lib/mailslurp_client/api/form_controller_api.rb +1 -1
  14. data/lib/mailslurp_client/api/group_controller_api.rb +1 -1
  15. data/lib/mailslurp_client/api/inbox_controller_api.rb +61 -1
  16. data/lib/mailslurp_client/api/inbox_forwarder_controller_api.rb +1 -1
  17. data/lib/mailslurp_client/api/inbox_ruleset_controller_api.rb +1 -1
  18. data/lib/mailslurp_client/api/mail_server_controller_api.rb +1 -1
  19. data/lib/mailslurp_client/api/missed_email_controller_api.rb +1 -1
  20. data/lib/mailslurp_client/api/sent_emails_controller_api.rb +1 -1
  21. data/lib/mailslurp_client/api/template_controller_api.rb +1 -1
  22. data/lib/mailslurp_client/api/tracking_controller_api.rb +1 -1
  23. data/lib/mailslurp_client/api/wait_for_controller_api.rb +1 -1
  24. data/lib/mailslurp_client/api/webhook_controller_api.rb +300 -4
  25. data/lib/mailslurp_client/api_client.rb +1 -1
  26. data/lib/mailslurp_client/api_error.rb +1 -1
  27. data/lib/mailslurp_client/configuration.rb +1 -1
  28. data/lib/mailslurp_client/models/abstract_webhook_payload.rb +3 -3
  29. data/lib/mailslurp_client/models/alias_dto.rb +1 -1
  30. data/lib/mailslurp_client/models/alias_projection.rb +1 -1
  31. data/lib/mailslurp_client/models/attachment_entity.rb +1 -1
  32. data/lib/mailslurp_client/models/attachment_meta_data.rb +1 -1
  33. data/lib/mailslurp_client/models/attachment_projection.rb +1 -1
  34. data/lib/mailslurp_client/models/basic_auth_options.rb +1 -1
  35. data/lib/mailslurp_client/models/bounce_projection.rb +1 -1
  36. data/lib/mailslurp_client/models/bounce_recipient.rb +6 -1
  37. data/lib/mailslurp_client/models/bounced_email_dto.rb +1 -1
  38. data/lib/mailslurp_client/models/bounced_recipient_dto.rb +1 -1
  39. data/lib/mailslurp_client/models/bulk_send_email_options.rb +1 -1
  40. data/lib/mailslurp_client/models/condition_option.rb +1 -1
  41. data/lib/mailslurp_client/models/contact_dto.rb +1 -1
  42. data/lib/mailslurp_client/models/contact_projection.rb +1 -1
  43. data/lib/mailslurp_client/models/content_match_options.rb +1 -1
  44. data/lib/mailslurp_client/models/count_dto.rb +1 -1
  45. data/lib/mailslurp_client/models/create_alias_options.rb +1 -1
  46. data/lib/mailslurp_client/models/create_contact_options.rb +1 -1
  47. data/lib/mailslurp_client/models/create_domain_options.rb +1 -1
  48. data/lib/mailslurp_client/models/create_group_options.rb +1 -1
  49. data/lib/mailslurp_client/models/create_inbox_dto.rb +1 -1
  50. data/lib/mailslurp_client/models/create_inbox_forwarder_options.rb +1 -1
  51. data/lib/mailslurp_client/models/create_inbox_ruleset_options.rb +1 -1
  52. data/lib/mailslurp_client/models/create_template_options.rb +1 -1
  53. data/lib/mailslurp_client/models/create_tracking_pixel_options.rb +1 -1
  54. data/lib/mailslurp_client/models/create_webhook_options.rb +3 -3
  55. data/lib/mailslurp_client/models/describe_domain_options.rb +1 -1
  56. data/lib/mailslurp_client/models/describe_mail_server_domain_result.rb +1 -1
  57. data/lib/mailslurp_client/models/dns_lookup_options.rb +1 -1
  58. data/lib/mailslurp_client/models/dns_lookup_result.rb +1 -1
  59. data/lib/mailslurp_client/models/dns_lookup_results.rb +1 -1
  60. data/lib/mailslurp_client/models/domain_dto.rb +1 -1
  61. data/lib/mailslurp_client/models/domain_name_record.rb +1 -1
  62. data/lib/mailslurp_client/models/domain_preview.rb +1 -1
  63. data/lib/mailslurp_client/models/download_attachment_dto.rb +1 -1
  64. data/lib/mailslurp_client/models/email.rb +1 -1
  65. data/lib/mailslurp_client/models/email_analysis.rb +1 -1
  66. data/lib/mailslurp_client/models/email_content_match_result.rb +1 -1
  67. data/lib/mailslurp_client/models/email_links_result.rb +1 -1
  68. data/lib/mailslurp_client/models/email_preview.rb +1 -1
  69. data/lib/mailslurp_client/models/email_preview_urls.rb +1 -1
  70. data/lib/mailslurp_client/models/email_projection.rb +14 -14
  71. data/lib/mailslurp_client/models/email_recipients.rb +1 -1
  72. data/lib/mailslurp_client/models/email_text_lines_result.rb +1 -1
  73. data/lib/mailslurp_client/models/email_validation_request.rb +1 -1
  74. data/lib/mailslurp_client/models/email_verification_result.rb +1 -1
  75. data/lib/mailslurp_client/models/expiration_defaults.rb +1 -1
  76. data/lib/mailslurp_client/models/expired_inbox_dto.rb +1 -1
  77. data/lib/mailslurp_client/models/expired_inbox_record_projection.rb +1 -1
  78. data/lib/mailslurp_client/models/export_link.rb +1 -1
  79. data/lib/mailslurp_client/models/export_options.rb +1 -1
  80. data/lib/mailslurp_client/models/filter_bounced_recipients_options.rb +1 -1
  81. data/lib/mailslurp_client/models/filter_bounced_recipients_result.rb +1 -1
  82. data/lib/mailslurp_client/models/flush_expired_inboxes_result.rb +1 -1
  83. data/lib/mailslurp_client/models/forward_email_options.rb +1 -1
  84. data/lib/mailslurp_client/models/gravatar_url.rb +1 -1
  85. data/lib/mailslurp_client/models/group_contacts_dto.rb +1 -1
  86. data/lib/mailslurp_client/models/group_dto.rb +1 -1
  87. data/lib/mailslurp_client/models/group_projection.rb +1 -1
  88. data/lib/mailslurp_client/models/html_validation_result.rb +1 -1
  89. data/lib/mailslurp_client/models/imap_flag_operation_options.rb +1 -1
  90. data/lib/mailslurp_client/models/imap_smtp_access_details.rb +1 -1
  91. data/lib/mailslurp_client/models/inbox_by_email_address_result.rb +1 -1
  92. data/lib/mailslurp_client/models/inbox_dto.rb +2 -2
  93. data/lib/mailslurp_client/models/inbox_exists_dto.rb +1 -1
  94. data/lib/mailslurp_client/models/inbox_forwarder_dto.rb +1 -1
  95. data/lib/mailslurp_client/models/inbox_forwarder_test_options.rb +1 -1
  96. data/lib/mailslurp_client/models/inbox_forwarder_test_result.rb +1 -1
  97. data/lib/mailslurp_client/models/inbox_id_item.rb +1 -1
  98. data/lib/mailslurp_client/models/inbox_ids_result.rb +1 -1
  99. data/lib/mailslurp_client/models/inbox_preview.rb +1 -1
  100. data/lib/mailslurp_client/models/inbox_ruleset_dto.rb +1 -1
  101. data/lib/mailslurp_client/models/inbox_ruleset_test_options.rb +1 -1
  102. data/lib/mailslurp_client/models/inbox_ruleset_test_result.rb +1 -1
  103. data/lib/mailslurp_client/models/inline_object.rb +1 -1
  104. data/lib/mailslurp_client/models/ip_address_result.rb +1 -1
  105. data/lib/mailslurp_client/models/json_schema_dto.rb +1 -1
  106. data/lib/mailslurp_client/models/match_option.rb +1 -1
  107. data/lib/mailslurp_client/models/match_options.rb +1 -1
  108. data/lib/mailslurp_client/models/missed_email.rb +1 -1
  109. data/lib/mailslurp_client/models/missed_email_projection.rb +1 -1
  110. data/lib/mailslurp_client/models/name_server_record.rb +1 -1
  111. data/lib/mailslurp_client/models/organization_inbox_projection.rb +1 -1
  112. data/lib/mailslurp_client/models/page_alias.rb +1 -1
  113. data/lib/mailslurp_client/models/page_attachment_entity.rb +1 -1
  114. data/lib/mailslurp_client/models/page_bounced_email.rb +1 -1
  115. data/lib/mailslurp_client/models/page_bounced_recipients.rb +1 -1
  116. data/lib/mailslurp_client/models/page_contact_projection.rb +1 -1
  117. data/lib/mailslurp_client/models/page_email_preview.rb +1 -1
  118. data/lib/mailslurp_client/models/page_email_projection.rb +1 -1
  119. data/lib/mailslurp_client/models/page_email_validation_request.rb +1 -1
  120. data/lib/mailslurp_client/models/page_expired_inbox_record_projection.rb +1 -1
  121. data/lib/mailslurp_client/models/page_group_projection.rb +1 -1
  122. data/lib/mailslurp_client/models/page_inbox_forwarder_dto.rb +1 -1
  123. data/lib/mailslurp_client/models/page_inbox_projection.rb +1 -1
  124. data/lib/mailslurp_client/models/page_inbox_ruleset_dto.rb +1 -1
  125. data/lib/mailslurp_client/models/page_missed_email_projection.rb +1 -1
  126. data/lib/mailslurp_client/models/page_organization_inbox_projection.rb +1 -1
  127. data/lib/mailslurp_client/models/page_sent_email_projection.rb +1 -1
  128. data/lib/mailslurp_client/models/page_template_projection.rb +1 -1
  129. data/lib/mailslurp_client/models/page_thread_projection.rb +1 -1
  130. data/lib/mailslurp_client/models/page_tracking_pixel_projection.rb +1 -1
  131. data/lib/mailslurp_client/models/page_unknown_missed_email_projection.rb +1 -1
  132. data/lib/mailslurp_client/models/page_webhook_projection.rb +1 -1
  133. data/lib/mailslurp_client/models/page_webhook_result.rb +1 -1
  134. data/lib/mailslurp_client/models/pageable_object.rb +1 -1
  135. data/lib/mailslurp_client/models/raw_email_json.rb +1 -1
  136. data/lib/mailslurp_client/models/recipient.rb +1 -1
  137. data/lib/mailslurp_client/models/reply_to_alias_email_options.rb +1 -1
  138. data/lib/mailslurp_client/models/reply_to_email_options.rb +1 -1
  139. data/lib/mailslurp_client/models/send_email_options.rb +1 -1
  140. data/lib/mailslurp_client/models/send_smtp_envelope_options.rb +1 -1
  141. data/lib/mailslurp_client/models/sender.rb +1 -1
  142. data/lib/mailslurp_client/models/sent_email_dto.rb +1 -1
  143. data/lib/mailslurp_client/models/sent_email_projection.rb +16 -16
  144. data/lib/mailslurp_client/models/set_inbox_favourited_options.rb +1 -1
  145. data/lib/mailslurp_client/models/simple_send_email_options.rb +1 -1
  146. data/lib/mailslurp_client/models/sort.rb +1 -1
  147. data/lib/mailslurp_client/models/template_dto.rb +1 -1
  148. data/lib/mailslurp_client/models/template_projection.rb +1 -1
  149. data/lib/mailslurp_client/models/template_variable.rb +1 -1
  150. data/lib/mailslurp_client/models/test_new_inbox_forwarder_options.rb +1 -1
  151. data/lib/mailslurp_client/models/test_new_inbox_ruleset_options.rb +1 -1
  152. data/lib/mailslurp_client/models/thread_projection.rb +1 -1
  153. data/lib/mailslurp_client/models/tracking_pixel_dto.rb +1 -1
  154. data/lib/mailslurp_client/models/tracking_pixel_projection.rb +1 -1
  155. data/lib/mailslurp_client/models/unknown_missed_email_projection.rb +1 -1
  156. data/lib/mailslurp_client/models/unread_count.rb +1 -1
  157. data/lib/mailslurp_client/models/unseen_error_count_dto.rb +1 -1
  158. data/lib/mailslurp_client/models/update_alias_options.rb +1 -1
  159. data/lib/mailslurp_client/models/update_domain_options.rb +1 -1
  160. data/lib/mailslurp_client/models/update_group_contacts.rb +1 -1
  161. data/lib/mailslurp_client/models/update_inbox_options.rb +1 -1
  162. data/lib/mailslurp_client/models/upload_attachment_options.rb +1 -1
  163. data/lib/mailslurp_client/models/validate_email_address_list_options.rb +1 -1
  164. data/lib/mailslurp_client/models/validate_email_address_list_result.rb +1 -1
  165. data/lib/mailslurp_client/models/validation_dto.rb +1 -1
  166. data/lib/mailslurp_client/models/validation_message.rb +1 -1
  167. data/lib/mailslurp_client/models/verify_email_address_options.rb +1 -1
  168. data/lib/mailslurp_client/models/wait_for_conditions.rb +1 -1
  169. data/lib/mailslurp_client/models/webhook_bounce_payload.rb +339 -0
  170. data/lib/mailslurp_client/models/{get_or_create_saml_user_options.rb → webhook_bounce_recipient_payload.rb} +97 -29
  171. data/lib/mailslurp_client/models/webhook_dto.rb +4 -9
  172. data/lib/mailslurp_client/models/webhook_email_opened_payload.rb +3 -3
  173. data/lib/mailslurp_client/models/webhook_email_read_payload.rb +3 -3
  174. data/lib/mailslurp_client/models/webhook_new_attachment_payload.rb +3 -3
  175. data/lib/mailslurp_client/models/webhook_new_contact_payload.rb +3 -3
  176. data/lib/mailslurp_client/models/webhook_new_email_payload.rb +3 -3
  177. data/lib/mailslurp_client/models/webhook_projection.rb +3 -8
  178. data/lib/mailslurp_client/models/webhook_redrive_result.rb +1 -1
  179. data/lib/mailslurp_client/models/webhook_result_dto.rb +3 -8
  180. data/lib/mailslurp_client/models/webhook_test_request.rb +1 -1
  181. data/lib/mailslurp_client/models/webhook_test_response.rb +1 -1
  182. data/lib/mailslurp_client/models/webhook_test_result.rb +1 -1
  183. data/lib/mailslurp_client/version.rb +2 -2
  184. data/lib/mailslurp_client.rb +3 -4
  185. metadata +4 -5
  186. data/lib/mailslurp_client/api/api_internal_controller_api.rb +0 -89
  187. data/lib/mailslurp_client/models/user_dto.rb +0 -438
@@ -0,0 +1,339 @@
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://docs.mailslurp.com/) - [Examples](https://github.com/mailslurp/examples) repository
5
+
6
+ The version of the OpenAPI document: 6.5.2
7
+ Contact: contact@mailslurp.dev
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.3.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module MailSlurpClient
16
+ # BOUNCE webhook payload. Sent to your webhook url endpoint via HTTP POST when an email bounced or was rejected by a recipient. Save the recipients to a ban list on your server and avoid emailing them again. It is recommended you also listen to the BOUNCE_RECIPIENT payload.
17
+ class WebhookBouncePayload
18
+ # Idempotent message ID. Store this ID locally or in a database to prevent message duplication.
19
+ attr_accessor :message_id
20
+
21
+ # ID of webhook entity being triggered
22
+ attr_accessor :webhook_id
23
+
24
+ # Name of the event type webhook is being triggered for.
25
+ attr_accessor :event_name
26
+
27
+ # Name of the webhook being triggered
28
+ attr_accessor :webhook_name
29
+
30
+ # ID of the bounce email record. Use the ID with the bounce controller to view more information
31
+ attr_accessor :bounce_id
32
+
33
+ attr_accessor :sent_to_recipients
34
+
35
+ attr_accessor :sender
36
+
37
+ # Email addresses that resulted in a bounce or email being rejected. Please save these recipients and avoid emailing them in the future to maintain your reputation.
38
+ attr_accessor :bounce_recipients
39
+
40
+ class EnumAttributeValidator
41
+ attr_reader :datatype
42
+ attr_reader :allowable_values
43
+
44
+ def initialize(datatype, allowable_values)
45
+ @allowable_values = allowable_values.map do |value|
46
+ case datatype.to_s
47
+ when /Integer/i
48
+ value.to_i
49
+ when /Float/i
50
+ value.to_f
51
+ else
52
+ value
53
+ end
54
+ end
55
+ end
56
+
57
+ def valid?(value)
58
+ !value || allowable_values.include?(value)
59
+ end
60
+ end
61
+
62
+ # Attribute mapping from ruby-style variable name to JSON key.
63
+ def self.attribute_map
64
+ {
65
+ :'message_id' => :'messageId',
66
+ :'webhook_id' => :'webhookId',
67
+ :'event_name' => :'eventName',
68
+ :'webhook_name' => :'webhookName',
69
+ :'bounce_id' => :'bounceId',
70
+ :'sent_to_recipients' => :'sentToRecipients',
71
+ :'sender' => :'sender',
72
+ :'bounce_recipients' => :'bounceRecipients'
73
+ }
74
+ end
75
+
76
+ # Attribute type mapping.
77
+ def self.openapi_types
78
+ {
79
+ :'message_id' => :'String',
80
+ :'webhook_id' => :'String',
81
+ :'event_name' => :'String',
82
+ :'webhook_name' => :'String',
83
+ :'bounce_id' => :'String',
84
+ :'sent_to_recipients' => :'Array<String>',
85
+ :'sender' => :'String',
86
+ :'bounce_recipients' => :'Array<String>'
87
+ }
88
+ end
89
+
90
+ # List of attributes with nullable: true
91
+ def self.openapi_nullable
92
+ Set.new([
93
+ ])
94
+ end
95
+
96
+ # Initializes the object
97
+ # @param [Hash] attributes Model attributes in the form of hash
98
+ def initialize(attributes = {})
99
+ if (!attributes.is_a?(Hash))
100
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::WebhookBouncePayload` initialize method"
101
+ end
102
+
103
+ # check to see if the attribute exists and convert string to symbol for hash key
104
+ attributes = attributes.each_with_object({}) { |(k, v), h|
105
+ if (!self.class.attribute_map.key?(k.to_sym))
106
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::WebhookBouncePayload`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
107
+ end
108
+ h[k.to_sym] = v
109
+ }
110
+
111
+ if attributes.key?(:'message_id')
112
+ self.message_id = attributes[:'message_id']
113
+ end
114
+
115
+ if attributes.key?(:'webhook_id')
116
+ self.webhook_id = attributes[:'webhook_id']
117
+ end
118
+
119
+ if attributes.key?(:'event_name')
120
+ self.event_name = attributes[:'event_name']
121
+ end
122
+
123
+ if attributes.key?(:'webhook_name')
124
+ self.webhook_name = attributes[:'webhook_name']
125
+ end
126
+
127
+ if attributes.key?(:'bounce_id')
128
+ self.bounce_id = attributes[:'bounce_id']
129
+ end
130
+
131
+ if attributes.key?(:'sent_to_recipients')
132
+ if (value = attributes[:'sent_to_recipients']).is_a?(Array)
133
+ self.sent_to_recipients = value
134
+ end
135
+ end
136
+
137
+ if attributes.key?(:'sender')
138
+ self.sender = attributes[:'sender']
139
+ end
140
+
141
+ if attributes.key?(:'bounce_recipients')
142
+ if (value = attributes[:'bounce_recipients']).is_a?(Array)
143
+ self.bounce_recipients = value
144
+ end
145
+ end
146
+ end
147
+
148
+ # Show invalid properties with the reasons. Usually used together with valid?
149
+ # @return Array for valid properties with the reasons
150
+ def list_invalid_properties
151
+ invalid_properties = Array.new
152
+ if @message_id.nil?
153
+ invalid_properties.push('invalid value for "message_id", message_id cannot be nil.')
154
+ end
155
+
156
+ if @webhook_id.nil?
157
+ invalid_properties.push('invalid value for "webhook_id", webhook_id cannot be nil.')
158
+ end
159
+
160
+ if @event_name.nil?
161
+ invalid_properties.push('invalid value for "event_name", event_name cannot be nil.')
162
+ end
163
+
164
+ if @bounce_id.nil?
165
+ invalid_properties.push('invalid value for "bounce_id", bounce_id cannot be nil.')
166
+ end
167
+
168
+ if @sender.nil?
169
+ invalid_properties.push('invalid value for "sender", sender cannot be nil.')
170
+ end
171
+
172
+ invalid_properties
173
+ end
174
+
175
+ # Check to see if the all the properties in the model are valid
176
+ # @return true if the model is valid
177
+ def valid?
178
+ return false if @message_id.nil?
179
+ return false if @webhook_id.nil?
180
+ return false if @event_name.nil?
181
+ event_name_validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED", "EMAIL_READ", "BOUNCE", "BOUNCE_RECIPIENT"])
182
+ return false unless event_name_validator.valid?(@event_name)
183
+ return false if @bounce_id.nil?
184
+ return false if @sender.nil?
185
+ true
186
+ end
187
+
188
+ # Custom attribute writer method checking allowed values (enum).
189
+ # @param [Object] event_name Object to be assigned
190
+ def event_name=(event_name)
191
+ validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED", "EMAIL_READ", "BOUNCE", "BOUNCE_RECIPIENT"])
192
+ unless validator.valid?(event_name)
193
+ fail ArgumentError, "invalid value for \"event_name\", must be one of #{validator.allowable_values}."
194
+ end
195
+ @event_name = event_name
196
+ end
197
+
198
+ # Checks equality by comparing each attribute.
199
+ # @param [Object] Object to be compared
200
+ def ==(o)
201
+ return true if self.equal?(o)
202
+ self.class == o.class &&
203
+ message_id == o.message_id &&
204
+ webhook_id == o.webhook_id &&
205
+ event_name == o.event_name &&
206
+ webhook_name == o.webhook_name &&
207
+ bounce_id == o.bounce_id &&
208
+ sent_to_recipients == o.sent_to_recipients &&
209
+ sender == o.sender &&
210
+ bounce_recipients == o.bounce_recipients
211
+ end
212
+
213
+ # @see the `==` method
214
+ # @param [Object] Object to be compared
215
+ def eql?(o)
216
+ self == o
217
+ end
218
+
219
+ # Calculates hash code according to all attributes.
220
+ # @return [Integer] Hash code
221
+ def hash
222
+ [message_id, webhook_id, event_name, webhook_name, bounce_id, sent_to_recipients, sender, bounce_recipients].hash
223
+ end
224
+
225
+ # Builds the object from hash
226
+ # @param [Hash] attributes Model attributes in the form of hash
227
+ # @return [Object] Returns the model itself
228
+ def self.build_from_hash(attributes)
229
+ new.build_from_hash(attributes)
230
+ end
231
+
232
+ # Builds the object from hash
233
+ # @param [Hash] attributes Model attributes in the form of hash
234
+ # @return [Object] Returns the model itself
235
+ def build_from_hash(attributes)
236
+ return nil unless attributes.is_a?(Hash)
237
+ self.class.openapi_types.each_pair do |key, type|
238
+ if type =~ /\AArray<(.*)>/i
239
+ # check to ensure the input is an array given that the attribute
240
+ # is documented as an array but the input is not
241
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
242
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
243
+ end
244
+ elsif !attributes[self.class.attribute_map[key]].nil?
245
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
246
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
247
+ end
248
+
249
+ self
250
+ end
251
+
252
+ # Deserializes the data based on type
253
+ # @param string type Data type
254
+ # @param string value Value to be deserialized
255
+ # @return [Object] Deserialized data
256
+ def _deserialize(type, value)
257
+ case type.to_sym
258
+ when :DateTime
259
+ DateTime.parse(value)
260
+ when :Date
261
+ Date.parse(value)
262
+ when :String
263
+ value.to_s
264
+ when :Integer
265
+ value.to_i
266
+ when :Float
267
+ value.to_f
268
+ when :Boolean
269
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
270
+ true
271
+ else
272
+ false
273
+ end
274
+ when :Object
275
+ # generic object (usually a Hash), return directly
276
+ value
277
+ when /\AArray<(?<inner_type>.+)>\z/
278
+ inner_type = Regexp.last_match[:inner_type]
279
+ value.map { |v| _deserialize(inner_type, v) }
280
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
281
+ k_type = Regexp.last_match[:k_type]
282
+ v_type = Regexp.last_match[:v_type]
283
+ {}.tap do |hash|
284
+ value.each do |k, v|
285
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
286
+ end
287
+ end
288
+ else # model
289
+ MailSlurpClient.const_get(type).build_from_hash(value)
290
+ end
291
+ end
292
+
293
+ # Returns the string representation of the object
294
+ # @return [String] String presentation of the object
295
+ def to_s
296
+ to_hash.to_s
297
+ end
298
+
299
+ # to_body is an alias to to_hash (backward compatibility)
300
+ # @return [Hash] Returns the object in the form of hash
301
+ def to_body
302
+ to_hash
303
+ end
304
+
305
+ # Returns the object in the form of hash
306
+ # @return [Hash] Returns the object in the form of hash
307
+ def to_hash
308
+ hash = {}
309
+ self.class.attribute_map.each_pair do |attr, param|
310
+ value = self.send(attr)
311
+ if value.nil?
312
+ is_nullable = self.class.openapi_nullable.include?(attr)
313
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
314
+ end
315
+
316
+ hash[param] = _to_hash(value)
317
+ end
318
+ hash
319
+ end
320
+
321
+ # Outputs non-array value in the form of hash
322
+ # For object, use to_hash. Otherwise, just return the value
323
+ # @param [Object] value Any valid value
324
+ # @return [Hash] Returns the value in the form of hash
325
+ def _to_hash(value)
326
+ if value.is_a?(Array)
327
+ value.compact.map { |v| _to_hash(v) }
328
+ elsif value.is_a?(Hash)
329
+ {}.tap do |hash|
330
+ value.each { |k, v| hash[k] = _to_hash(v) }
331
+ end
332
+ elsif value.respond_to? :to_hash
333
+ value.to_hash
334
+ else
335
+ value
336
+ end
337
+ end
338
+ end
339
+ end
@@ -1,7 +1,7 @@
1
1
  =begin
2
2
  #MailSlurp API
3
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
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://docs.mailslurp.com/) - [Examples](https://github.com/mailslurp/examples) repository
5
5
 
6
6
  The version of the OpenAPI document: 6.5.2
7
7
  Contact: contact@mailslurp.dev
@@ -13,28 +13,64 @@ OpenAPI Generator version: 4.3.1
13
13
  require 'date'
14
14
 
15
15
  module MailSlurpClient
16
- class GetOrCreateSamlUserOptions
17
- attr_accessor :issuer
16
+ # BOUNCE_RECIPIENT webhook payload. Sent to your webhook url endpoint via HTTP POST when an email caused a bounce to occur for a recipient. Save the recipient to a ban list of your server and avoid email them again.
17
+ class WebhookBounceRecipientPayload
18
+ # Idempotent message ID. Store this ID locally or in a database to prevent message duplication.
19
+ attr_accessor :message_id
18
20
 
19
- attr_accessor :name_id
21
+ # ID of webhook entity being triggered
22
+ attr_accessor :webhook_id
20
23
 
21
- attr_accessor :name_id_format
24
+ # Name of the event type webhook is being triggered for.
25
+ attr_accessor :event_name
26
+
27
+ # Name of the webhook being triggered
28
+ attr_accessor :webhook_name
29
+
30
+ # Email address that caused a bounce. Make note of the address and try not to message it again to preserve your reputation.
31
+ attr_accessor :recipient
32
+
33
+ class EnumAttributeValidator
34
+ attr_reader :datatype
35
+ attr_reader :allowable_values
36
+
37
+ def initialize(datatype, allowable_values)
38
+ @allowable_values = allowable_values.map do |value|
39
+ case datatype.to_s
40
+ when /Integer/i
41
+ value.to_i
42
+ when /Float/i
43
+ value.to_f
44
+ else
45
+ value
46
+ end
47
+ end
48
+ end
49
+
50
+ def valid?(value)
51
+ !value || allowable_values.include?(value)
52
+ end
53
+ end
22
54
 
23
55
  # Attribute mapping from ruby-style variable name to JSON key.
24
56
  def self.attribute_map
25
57
  {
26
- :'issuer' => :'issuer',
27
- :'name_id' => :'nameId',
28
- :'name_id_format' => :'nameIdFormat'
58
+ :'message_id' => :'messageId',
59
+ :'webhook_id' => :'webhookId',
60
+ :'event_name' => :'eventName',
61
+ :'webhook_name' => :'webhookName',
62
+ :'recipient' => :'recipient'
29
63
  }
30
64
  end
31
65
 
32
66
  # Attribute type mapping.
33
67
  def self.openapi_types
34
68
  {
35
- :'issuer' => :'String',
36
- :'name_id' => :'String',
37
- :'name_id_format' => :'String'
69
+ :'message_id' => :'String',
70
+ :'webhook_id' => :'String',
71
+ :'event_name' => :'String',
72
+ :'webhook_name' => :'String',
73
+ :'recipient' => :'String'
38
74
  }
39
75
  end
40
76
 
@@ -48,27 +84,35 @@ module MailSlurpClient
48
84
  # @param [Hash] attributes Model attributes in the form of hash
49
85
  def initialize(attributes = {})
50
86
  if (!attributes.is_a?(Hash))
51
- fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::GetOrCreateSamlUserOptions` initialize method"
87
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::WebhookBounceRecipientPayload` initialize method"
52
88
  end
53
89
 
54
90
  # check to see if the attribute exists and convert string to symbol for hash key
55
91
  attributes = attributes.each_with_object({}) { |(k, v), h|
56
92
  if (!self.class.attribute_map.key?(k.to_sym))
57
- fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::GetOrCreateSamlUserOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
93
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::WebhookBounceRecipientPayload`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
58
94
  end
59
95
  h[k.to_sym] = v
60
96
  }
61
97
 
62
- if attributes.key?(:'issuer')
63
- self.issuer = attributes[:'issuer']
98
+ if attributes.key?(:'message_id')
99
+ self.message_id = attributes[:'message_id']
64
100
  end
65
101
 
66
- if attributes.key?(:'name_id')
67
- self.name_id = attributes[:'name_id']
102
+ if attributes.key?(:'webhook_id')
103
+ self.webhook_id = attributes[:'webhook_id']
68
104
  end
69
105
 
70
- if attributes.key?(:'name_id_format')
71
- self.name_id_format = attributes[:'name_id_format']
106
+ if attributes.key?(:'event_name')
107
+ self.event_name = attributes[:'event_name']
108
+ end
109
+
110
+ if attributes.key?(:'webhook_name')
111
+ self.webhook_name = attributes[:'webhook_name']
112
+ end
113
+
114
+ if attributes.key?(:'recipient')
115
+ self.recipient = attributes[:'recipient']
72
116
  end
73
117
  end
74
118
 
@@ -76,12 +120,20 @@ module MailSlurpClient
76
120
  # @return Array for valid properties with the reasons
77
121
  def list_invalid_properties
78
122
  invalid_properties = Array.new
79
- if @issuer.nil?
80
- invalid_properties.push('invalid value for "issuer", issuer cannot be nil.')
123
+ if @message_id.nil?
124
+ invalid_properties.push('invalid value for "message_id", message_id cannot be nil.')
125
+ end
126
+
127
+ if @webhook_id.nil?
128
+ invalid_properties.push('invalid value for "webhook_id", webhook_id cannot be nil.')
81
129
  end
82
130
 
83
- if @name_id.nil?
84
- invalid_properties.push('invalid value for "name_id", name_id cannot be nil.')
131
+ if @event_name.nil?
132
+ invalid_properties.push('invalid value for "event_name", event_name cannot be nil.')
133
+ end
134
+
135
+ if @recipient.nil?
136
+ invalid_properties.push('invalid value for "recipient", recipient cannot be nil.')
85
137
  end
86
138
 
87
139
  invalid_properties
@@ -90,19 +142,35 @@ module MailSlurpClient
90
142
  # Check to see if the all the properties in the model are valid
91
143
  # @return true if the model is valid
92
144
  def valid?
93
- return false if @issuer.nil?
94
- return false if @name_id.nil?
145
+ return false if @message_id.nil?
146
+ return false if @webhook_id.nil?
147
+ return false if @event_name.nil?
148
+ event_name_validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED", "EMAIL_READ", "BOUNCE", "BOUNCE_RECIPIENT"])
149
+ return false unless event_name_validator.valid?(@event_name)
150
+ return false if @recipient.nil?
95
151
  true
96
152
  end
97
153
 
154
+ # Custom attribute writer method checking allowed values (enum).
155
+ # @param [Object] event_name Object to be assigned
156
+ def event_name=(event_name)
157
+ validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED", "EMAIL_READ", "BOUNCE", "BOUNCE_RECIPIENT"])
158
+ unless validator.valid?(event_name)
159
+ fail ArgumentError, "invalid value for \"event_name\", must be one of #{validator.allowable_values}."
160
+ end
161
+ @event_name = event_name
162
+ end
163
+
98
164
  # Checks equality by comparing each attribute.
99
165
  # @param [Object] Object to be compared
100
166
  def ==(o)
101
167
  return true if self.equal?(o)
102
168
  self.class == o.class &&
103
- issuer == o.issuer &&
104
- name_id == o.name_id &&
105
- name_id_format == o.name_id_format
169
+ message_id == o.message_id &&
170
+ webhook_id == o.webhook_id &&
171
+ event_name == o.event_name &&
172
+ webhook_name == o.webhook_name &&
173
+ recipient == o.recipient
106
174
  end
107
175
 
108
176
  # @see the `==` method
@@ -114,7 +182,7 @@ module MailSlurpClient
114
182
  # Calculates hash code according to all attributes.
115
183
  # @return [Integer] Hash code
116
184
  def hash
117
- [issuer, name_id, name_id_format].hash
185
+ [message_id, webhook_id, event_name, webhook_name, recipient].hash
118
186
  end
119
187
 
120
188
  # Builds the object from hash
@@ -1,7 +1,7 @@
1
1
  =begin
2
2
  #MailSlurp API
3
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
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://docs.mailslurp.com/) - [Examples](https://github.com/mailslurp/examples) repository
5
5
 
6
6
  The version of the OpenAPI document: 6.5.2
7
7
  Contact: contact@mailslurp.dev
@@ -27,7 +27,7 @@ module MailSlurpClient
27
27
  # Name of the webhook
28
28
  attr_accessor :name
29
29
 
30
- # The inbox that the Webhook will be triggered by
30
+ # The inbox that the Webhook will be triggered by. If null then webhook triggered at account level
31
31
  attr_accessor :inbox_id
32
32
 
33
33
  # URL of your server that the webhook will be sent to. The schema of the JSON that is sent is described by the payloadJsonSchema.
@@ -184,10 +184,6 @@ module MailSlurpClient
184
184
  invalid_properties.push('invalid value for "basic_auth", basic_auth cannot be nil.')
185
185
  end
186
186
 
187
- if @inbox_id.nil?
188
- invalid_properties.push('invalid value for "inbox_id", inbox_id cannot be nil.')
189
- end
190
-
191
187
  if @url.nil?
192
188
  invalid_properties.push('invalid value for "url", url cannot be nil.')
193
189
  end
@@ -217,7 +213,6 @@ module MailSlurpClient
217
213
  return false if @id.nil?
218
214
  return false if @user_id.nil?
219
215
  return false if @basic_auth.nil?
220
- return false if @inbox_id.nil?
221
216
  return false if @url.nil?
222
217
  return false if @method.nil?
223
218
  method_validator = EnumAttributeValidator.new('String', ["GET", "HEAD", "POST", "PUT", "PATCH", "DELETE", "OPTIONS", "TRACE"])
@@ -225,7 +220,7 @@ module MailSlurpClient
225
220
  return false if @payload_json_schema.nil?
226
221
  return false if @created_at.nil?
227
222
  return false if @updated_at.nil?
228
- event_name_validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED", "EMAIL_READ"])
223
+ event_name_validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED", "EMAIL_READ", "BOUNCE", "BOUNCE_RECIPIENT"])
229
224
  return false unless event_name_validator.valid?(@event_name)
230
225
  true
231
226
  end
@@ -243,7 +238,7 @@ module MailSlurpClient
243
238
  # Custom attribute writer method checking allowed values (enum).
244
239
  # @param [Object] event_name Object to be assigned
245
240
  def event_name=(event_name)
246
- validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED", "EMAIL_READ"])
241
+ validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED", "EMAIL_READ", "BOUNCE", "BOUNCE_RECIPIENT"])
247
242
  unless validator.valid?(event_name)
248
243
  fail ArgumentError, "invalid value for \"event_name\", must be one of #{validator.allowable_values}."
249
244
  end
@@ -1,7 +1,7 @@
1
1
  =begin
2
2
  #MailSlurp API
3
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
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://docs.mailslurp.com/) - [Examples](https://github.com/mailslurp/examples) repository
5
5
 
6
6
  The version of the OpenAPI document: 6.5.2
7
7
  Contact: contact@mailslurp.dev
@@ -197,7 +197,7 @@ module MailSlurpClient
197
197
  return false if @message_id.nil?
198
198
  return false if @webhook_id.nil?
199
199
  return false if @event_name.nil?
200
- event_name_validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED", "EMAIL_READ"])
200
+ event_name_validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED", "EMAIL_READ", "BOUNCE", "BOUNCE_RECIPIENT"])
201
201
  return false unless event_name_validator.valid?(@event_name)
202
202
  return false if @inbox_id.nil?
203
203
  return false if @pixel_id.nil?
@@ -210,7 +210,7 @@ module MailSlurpClient
210
210
  # Custom attribute writer method checking allowed values (enum).
211
211
  # @param [Object] event_name Object to be assigned
212
212
  def event_name=(event_name)
213
- validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED", "EMAIL_READ"])
213
+ validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED", "EMAIL_READ", "BOUNCE", "BOUNCE_RECIPIENT"])
214
214
  unless validator.valid?(event_name)
215
215
  fail ArgumentError, "invalid value for \"event_name\", must be one of #{validator.allowable_values}."
216
216
  end
@@ -1,7 +1,7 @@
1
1
  =begin
2
2
  #MailSlurp API
3
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
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://docs.mailslurp.com/) - [Examples](https://github.com/mailslurp/examples) repository
5
5
 
6
6
  The version of the OpenAPI document: 6.5.2
7
7
  Contact: contact@mailslurp.dev
@@ -184,7 +184,7 @@ module MailSlurpClient
184
184
  return false if @message_id.nil?
185
185
  return false if @webhook_id.nil?
186
186
  return false if @event_name.nil?
187
- event_name_validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED", "EMAIL_READ"])
187
+ event_name_validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED", "EMAIL_READ", "BOUNCE", "BOUNCE_RECIPIENT"])
188
188
  return false unless event_name_validator.valid?(@event_name)
189
189
  return false if @email_id.nil?
190
190
  return false if @inbox_id.nil?
@@ -196,7 +196,7 @@ module MailSlurpClient
196
196
  # Custom attribute writer method checking allowed values (enum).
197
197
  # @param [Object] event_name Object to be assigned
198
198
  def event_name=(event_name)
199
- validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED", "EMAIL_READ"])
199
+ validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED", "EMAIL_READ", "BOUNCE", "BOUNCE_RECIPIENT"])
200
200
  unless validator.valid?(event_name)
201
201
  fail ArgumentError, "invalid value for \"event_name\", must be one of #{validator.allowable_values}."
202
202
  end