mailslurp_client 11.9.7 → 11.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (118) hide show
  1. checksums.yaml +4 -4
  2. data/lib/mailslurp_client.rb +4 -2
  3. data/lib/mailslurp_client/api/alias_controller_api.rb +1 -1
  4. data/lib/mailslurp_client/api/attachment_controller_api.rb +130 -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 +7 -7
  10. data/lib/mailslurp_client/api/expired_controller_api.rb +1 -1
  11. data/lib/mailslurp_client/api/form_controller_api.rb +1 -1
  12. data/lib/mailslurp_client/api/group_controller_api.rb +1 -1
  13. data/lib/mailslurp_client/api/inbox_controller_api.rb +61 -1
  14. data/lib/mailslurp_client/api/mail_server_controller_api.rb +1 -1
  15. data/lib/mailslurp_client/api/missed_email_controller_api.rb +1 -1
  16. data/lib/mailslurp_client/api/sent_emails_controller_api.rb +1 -1
  17. data/lib/mailslurp_client/api/template_controller_api.rb +1 -1
  18. data/lib/mailslurp_client/api/wait_for_controller_api.rb +1 -1
  19. data/lib/mailslurp_client/api/webhook_controller_api.rb +13 -6
  20. data/lib/mailslurp_client/api_client.rb +1 -1
  21. data/lib/mailslurp_client/api_error.rb +1 -1
  22. data/lib/mailslurp_client/configuration.rb +1 -1
  23. data/lib/mailslurp_client/models/{webhook_payload.rb → abstract_webhook_payload.rb} +22 -110
  24. data/lib/mailslurp_client/models/alias_dto.rb +1 -1
  25. data/lib/mailslurp_client/models/alias_projection.rb +1 -1
  26. data/lib/mailslurp_client/models/attachment_entity.rb +289 -0
  27. data/lib/mailslurp_client/models/attachment_meta_data.rb +1 -1
  28. data/lib/mailslurp_client/models/basic_auth_options.rb +1 -1
  29. data/lib/mailslurp_client/models/bulk_send_email_options.rb +1 -1
  30. data/lib/mailslurp_client/models/contact_dto.rb +11 -2
  31. data/lib/mailslurp_client/models/contact_projection.rb +1 -1
  32. data/lib/mailslurp_client/models/content_match_options.rb +1 -1
  33. data/lib/mailslurp_client/models/create_alias_options.rb +1 -1
  34. data/lib/mailslurp_client/models/create_contact_options.rb +1 -1
  35. data/lib/mailslurp_client/models/create_domain_options.rb +1 -1
  36. data/lib/mailslurp_client/models/create_group_options.rb +1 -1
  37. data/lib/mailslurp_client/models/create_inbox_dto.rb +1 -1
  38. data/lib/mailslurp_client/models/create_template_options.rb +1 -1
  39. data/lib/mailslurp_client/models/create_webhook_options.rb +46 -2
  40. data/lib/mailslurp_client/models/describe_domain_options.rb +1 -1
  41. data/lib/mailslurp_client/models/describe_mail_server_domain_result.rb +1 -1
  42. data/lib/mailslurp_client/models/dns_lookup_options.rb +1 -1
  43. data/lib/mailslurp_client/models/dns_lookup_result.rb +1 -1
  44. data/lib/mailslurp_client/models/dns_lookup_results.rb +1 -1
  45. data/lib/mailslurp_client/models/domain_dto.rb +1 -1
  46. data/lib/mailslurp_client/models/domain_name_record.rb +1 -1
  47. data/lib/mailslurp_client/models/domain_preview.rb +1 -1
  48. data/lib/mailslurp_client/models/download_attachment_dto.rb +1 -1
  49. data/lib/mailslurp_client/models/email.rb +1 -1
  50. data/lib/mailslurp_client/models/email_analysis.rb +1 -1
  51. data/lib/mailslurp_client/models/email_content_match_result.rb +1 -1
  52. data/lib/mailslurp_client/models/email_preview.rb +1 -1
  53. data/lib/mailslurp_client/models/email_projection.rb +1 -1
  54. data/lib/mailslurp_client/models/email_text_lines_result.rb +1 -1
  55. data/lib/mailslurp_client/models/email_verification_result.rb +1 -1
  56. data/lib/mailslurp_client/models/expiration_defaults.rb +1 -1
  57. data/lib/mailslurp_client/models/expired_inbox_dto.rb +1 -1
  58. data/lib/mailslurp_client/models/expired_inbox_record_projection.rb +1 -1
  59. data/lib/mailslurp_client/models/forward_email_options.rb +1 -1
  60. data/lib/mailslurp_client/models/group_contacts_dto.rb +1 -1
  61. data/lib/mailslurp_client/models/group_dto.rb +1 -1
  62. data/lib/mailslurp_client/models/group_projection.rb +1 -1
  63. data/lib/mailslurp_client/models/html_validation_result.rb +1 -1
  64. data/lib/mailslurp_client/models/inbox.rb +1 -1
  65. data/lib/mailslurp_client/models/inbox_projection.rb +1 -1
  66. data/lib/mailslurp_client/models/ip_address_result.rb +1 -1
  67. data/lib/mailslurp_client/models/match_option.rb +1 -1
  68. data/lib/mailslurp_client/models/match_options.rb +1 -1
  69. data/lib/mailslurp_client/models/missed_email.rb +1 -1
  70. data/lib/mailslurp_client/models/missed_email_projection.rb +1 -1
  71. data/lib/mailslurp_client/models/model_alias.rb +1 -1
  72. data/lib/mailslurp_client/models/name_server_record.rb +1 -1
  73. data/lib/mailslurp_client/models/organization_inbox_projection.rb +1 -1
  74. data/lib/mailslurp_client/models/page_alias.rb +1 -1
  75. data/lib/mailslurp_client/models/page_attachment_entity.rb +299 -0
  76. data/lib/mailslurp_client/models/page_contact_projection.rb +1 -1
  77. data/lib/mailslurp_client/models/page_email_preview.rb +1 -1
  78. data/lib/mailslurp_client/models/page_email_projection.rb +1 -1
  79. data/lib/mailslurp_client/models/page_expired_inbox_record_projection.rb +1 -1
  80. data/lib/mailslurp_client/models/page_group_projection.rb +1 -1
  81. data/lib/mailslurp_client/models/page_inbox_projection.rb +1 -1
  82. data/lib/mailslurp_client/models/page_missed_email_projection.rb +1 -1
  83. data/lib/mailslurp_client/models/page_organization_inbox_projection.rb +1 -1
  84. data/lib/mailslurp_client/models/page_sent_email_projection.rb +1 -1
  85. data/lib/mailslurp_client/models/page_template_projection.rb +1 -1
  86. data/lib/mailslurp_client/models/page_thread_projection.rb +1 -1
  87. data/lib/mailslurp_client/models/page_webhook_projection.rb +1 -1
  88. data/lib/mailslurp_client/models/pageable.rb +1 -1
  89. data/lib/mailslurp_client/models/raw_email_json.rb +1 -1
  90. data/lib/mailslurp_client/models/reply_to_alias_email_options.rb +1 -1
  91. data/lib/mailslurp_client/models/reply_to_email_options.rb +1 -1
  92. data/lib/mailslurp_client/models/send_email_options.rb +1 -1
  93. data/lib/mailslurp_client/models/sent_email_dto.rb +1 -1
  94. data/lib/mailslurp_client/models/sent_email_projection.rb +1 -1
  95. data/lib/mailslurp_client/models/set_inbox_favourited_options.rb +1 -1
  96. data/lib/mailslurp_client/models/simple_send_email_options.rb +1 -1
  97. data/lib/mailslurp_client/models/sort.rb +1 -1
  98. data/lib/mailslurp_client/models/template_dto.rb +1 -1
  99. data/lib/mailslurp_client/models/template_projection.rb +1 -1
  100. data/lib/mailslurp_client/models/template_variable.rb +1 -1
  101. data/lib/mailslurp_client/models/thread_projection.rb +1 -1
  102. data/lib/mailslurp_client/models/unread_count.rb +1 -1
  103. data/lib/mailslurp_client/models/update_alias_options.rb +1 -1
  104. data/lib/mailslurp_client/models/update_domain_options.rb +1 -1
  105. data/lib/mailslurp_client/models/update_group_contacts.rb +1 -1
  106. data/lib/mailslurp_client/models/update_inbox_options.rb +1 -1
  107. data/lib/mailslurp_client/models/upload_attachment_options.rb +1 -1
  108. data/lib/mailslurp_client/models/validation_dto.rb +1 -1
  109. data/lib/mailslurp_client/models/validation_message.rb +1 -1
  110. data/lib/mailslurp_client/models/verify_email_address_options.rb +1 -1
  111. data/lib/mailslurp_client/models/wait_for_conditions.rb +1 -1
  112. data/lib/mailslurp_client/models/webhook_dto.rb +23 -2
  113. data/lib/mailslurp_client/models/webhook_projection.rb +1 -1
  114. data/lib/mailslurp_client/models/webhook_test_request.rb +1 -1
  115. data/lib/mailslurp_client/models/webhook_test_response.rb +1 -1
  116. data/lib/mailslurp_client/models/webhook_test_result.rb +1 -1
  117. data/lib/mailslurp_client/version.rb +2 -2
  118. metadata +5 -3
@@ -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://www.mailslurp.com/docs/) - [Examples](https://github.com/mailslurp/examples) repository
5
5
 
6
6
  The version of the OpenAPI document: 6.5.2
7
7
 
@@ -222,26 +222,33 @@ module MailSlurpClient
222
222
  return data, status_code, headers
223
223
  end
224
224
 
225
- # Get test webhook payload example
225
+ # Get test webhook payload example. Response content depends on eventName passed. Uses `EMAIL_RECEIVED` as default.
226
226
  # @param [Hash] opts the optional parameters
227
- # @return [WebhookPayload]
227
+ # @option opts [String] :event_name eventName
228
+ # @return [AbstractWebhookPayload]
228
229
  def get_test_webhook_payload(opts = {})
229
230
  data, _status_code, _headers = get_test_webhook_payload_with_http_info(opts)
230
231
  data
231
232
  end
232
233
 
233
- # Get test webhook payload example
234
+ # Get test webhook payload example. Response content depends on eventName passed. Uses `EMAIL_RECEIVED` as default.
234
235
  # @param [Hash] opts the optional parameters
235
- # @return [Array<(WebhookPayload, Integer, Hash)>] WebhookPayload data, response status code and response headers
236
+ # @option opts [String] :event_name eventName
237
+ # @return [Array<(AbstractWebhookPayload, Integer, Hash)>] AbstractWebhookPayload data, response status code and response headers
236
238
  def get_test_webhook_payload_with_http_info(opts = {})
237
239
  if @api_client.config.debugging
238
240
  @api_client.config.logger.debug 'Calling API: WebhookControllerApi.get_test_webhook_payload ...'
239
241
  end
242
+ allowable_values = ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT"]
243
+ if @api_client.config.client_side_validation && opts[:'event_name'] && !allowable_values.include?(opts[:'event_name'])
244
+ fail ArgumentError, "invalid value for \"event_name\", must be one of #{allowable_values}"
245
+ end
240
246
  # resource path
241
247
  local_var_path = '/webhooks/test'
242
248
 
243
249
  # query parameters
244
250
  query_params = opts[:query_params] || {}
251
+ query_params[:'eventName'] = opts[:'event_name'] if !opts[:'event_name'].nil?
245
252
 
246
253
  # header parameters
247
254
  header_params = opts[:header_params] || {}
@@ -255,7 +262,7 @@ module MailSlurpClient
255
262
  post_body = opts[:body]
256
263
 
257
264
  # return_type
258
- return_type = opts[:return_type] || 'WebhookPayload'
265
+ return_type = opts[:return_type] || 'AbstractWebhookPayload'
259
266
 
260
267
  # auth_names
261
268
  auth_names = opts[:auth_names] || ['API_KEY']
@@ -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://www.mailslurp.com/docs/) - [Examples](https://github.com/mailslurp/examples) repository
5
5
 
6
6
  The version of the OpenAPI document: 6.5.2
7
7
 
@@ -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://www.mailslurp.com/docs/) - [Examples](https://github.com/mailslurp/examples) repository
5
5
 
6
6
  The version of the OpenAPI document: 6.5.2
7
7
 
@@ -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://www.mailslurp.com/docs/) - [Examples](https://github.com/mailslurp/examples) repository
5
5
 
6
6
  The version of the OpenAPI document: 6.5.2
7
7
 
@@ -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://www.mailslurp.com/docs/) - [Examples](https://github.com/mailslurp/examples) repository
5
5
 
6
6
  The version of the OpenAPI document: 6.5.2
7
7
 
@@ -13,45 +13,13 @@ OpenAPI Generator version: 4.3.1
13
13
  require 'date'
14
14
 
15
15
  module MailSlurpClient
16
- # MailSlurp webhook payload schema is available at https://api.mailslurp.com/schemas/webhook-payload. 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
16
+ class AbstractWebhookPayload
34
17
  attr_accessor :event_name
35
18
 
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
19
  attr_accessor :message_id
44
20
 
45
- # The subject line of the email message
46
- attr_accessor :subject
47
-
48
- # List of `To` recipients that email was addressed to
49
- attr_accessor :to
50
-
51
- # ID of webhook entity being triggered
52
21
  attr_accessor :webhook_id
53
22
 
54
- # Name of the webhook being triggered
55
23
  attr_accessor :webhook_name
56
24
 
57
25
  class EnumAttributeValidator
@@ -79,17 +47,8 @@ module MailSlurpClient
79
47
  # Attribute mapping from ruby-style variable name to JSON key.
80
48
  def self.attribute_map
81
49
  {
82
- :'attachment_meta_datas' => :'attachmentMetaDatas',
83
- :'bcc' => :'bcc',
84
- :'cc' => :'cc',
85
- :'created_at' => :'createdAt',
86
- :'email_id' => :'emailId',
87
50
  :'event_name' => :'eventName',
88
- :'from' => :'from',
89
- :'inbox_id' => :'inboxId',
90
51
  :'message_id' => :'messageId',
91
- :'subject' => :'subject',
92
- :'to' => :'to',
93
52
  :'webhook_id' => :'webhookId',
94
53
  :'webhook_name' => :'webhookName'
95
54
  }
@@ -98,17 +57,8 @@ module MailSlurpClient
98
57
  # Attribute type mapping.
99
58
  def self.openapi_types
100
59
  {
101
- :'attachment_meta_datas' => :'Array<AttachmentMetaData>',
102
- :'bcc' => :'Array<String>',
103
- :'cc' => :'Array<String>',
104
- :'created_at' => :'DateTime',
105
- :'email_id' => :'String',
106
60
  :'event_name' => :'String',
107
- :'from' => :'String',
108
- :'inbox_id' => :'String',
109
61
  :'message_id' => :'String',
110
- :'subject' => :'String',
111
- :'to' => :'Array<String>',
112
62
  :'webhook_id' => :'String',
113
63
  :'webhook_name' => :'String'
114
64
  }
@@ -124,69 +74,25 @@ module MailSlurpClient
124
74
  # @param [Hash] attributes Model attributes in the form of hash
125
75
  def initialize(attributes = {})
126
76
  if (!attributes.is_a?(Hash))
127
- fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::WebhookPayload` initialize method"
77
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::AbstractWebhookPayload` initialize method"
128
78
  end
129
79
 
130
80
  # check to see if the attribute exists and convert string to symbol for hash key
131
81
  attributes = attributes.each_with_object({}) { |(k, v), h|
132
82
  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
83
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::AbstractWebhookPayload`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
134
84
  end
135
85
  h[k.to_sym] = v
136
86
  }
137
87
 
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
88
  if attributes.key?(:'event_name')
165
89
  self.event_name = attributes[:'event_name']
166
90
  end
167
91
 
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
92
  if attributes.key?(:'message_id')
177
93
  self.message_id = attributes[:'message_id']
178
94
  end
179
95
 
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
96
  if attributes.key?(:'webhook_id')
191
97
  self.webhook_id = attributes[:'webhook_id']
192
98
  end
@@ -200,21 +106,36 @@ module MailSlurpClient
200
106
  # @return Array for valid properties with the reasons
201
107
  def list_invalid_properties
202
108
  invalid_properties = Array.new
109
+ if @event_name.nil?
110
+ invalid_properties.push('invalid value for "event_name", event_name cannot be nil.')
111
+ end
112
+
113
+ if @message_id.nil?
114
+ invalid_properties.push('invalid value for "message_id", message_id cannot be nil.')
115
+ end
116
+
117
+ if @webhook_id.nil?
118
+ invalid_properties.push('invalid value for "webhook_id", webhook_id cannot be nil.')
119
+ end
120
+
203
121
  invalid_properties
204
122
  end
205
123
 
206
124
  # Check to see if the all the properties in the model are valid
207
125
  # @return true if the model is valid
208
126
  def valid?
209
- event_name_validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED"])
127
+ return false if @event_name.nil?
128
+ event_name_validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT"])
210
129
  return false unless event_name_validator.valid?(@event_name)
130
+ return false if @message_id.nil?
131
+ return false if @webhook_id.nil?
211
132
  true
212
133
  end
213
134
 
214
135
  # Custom attribute writer method checking allowed values (enum).
215
136
  # @param [Object] event_name Object to be assigned
216
137
  def event_name=(event_name)
217
- validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED"])
138
+ validator = EnumAttributeValidator.new('String', ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT"])
218
139
  unless validator.valid?(event_name)
219
140
  fail ArgumentError, "invalid value for \"event_name\", must be one of #{validator.allowable_values}."
220
141
  end
@@ -226,17 +147,8 @@ module MailSlurpClient
226
147
  def ==(o)
227
148
  return true if self.equal?(o)
228
149
  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
150
  event_name == o.event_name &&
235
- from == o.from &&
236
- inbox_id == o.inbox_id &&
237
151
  message_id == o.message_id &&
238
- subject == o.subject &&
239
- to == o.to &&
240
152
  webhook_id == o.webhook_id &&
241
153
  webhook_name == o.webhook_name
242
154
  end
@@ -250,7 +162,7 @@ module MailSlurpClient
250
162
  # Calculates hash code according to all attributes.
251
163
  # @return [Integer] Hash code
252
164
  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
165
+ [event_name, message_id, webhook_id, webhook_name].hash
254
166
  end
255
167
 
256
168
  # 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://www.mailslurp.com/docs/) - [Examples](https://github.com/mailslurp/examples) repository
5
5
 
6
6
  The version of the OpenAPI document: 6.5.2
7
7
 
@@ -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://www.mailslurp.com/docs/) - [Examples](https://github.com/mailslurp/examples) repository
5
5
 
6
6
  The version of the OpenAPI document: 6.5.2
7
7
 
@@ -0,0 +1,289 @@
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 AttachmentEntity
17
+ attr_accessor :attachment_id
18
+
19
+ attr_accessor :content_length
20
+
21
+ attr_accessor :content_type
22
+
23
+ attr_accessor :created_at
24
+
25
+ attr_accessor :id
26
+
27
+ attr_accessor :name
28
+
29
+ attr_accessor :updated_at
30
+
31
+ attr_accessor :user_id
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ def self.attribute_map
35
+ {
36
+ :'attachment_id' => :'attachmentId',
37
+ :'content_length' => :'contentLength',
38
+ :'content_type' => :'contentType',
39
+ :'created_at' => :'createdAt',
40
+ :'id' => :'id',
41
+ :'name' => :'name',
42
+ :'updated_at' => :'updatedAt',
43
+ :'user_id' => :'userId'
44
+ }
45
+ end
46
+
47
+ # Attribute type mapping.
48
+ def self.openapi_types
49
+ {
50
+ :'attachment_id' => :'String',
51
+ :'content_length' => :'Integer',
52
+ :'content_type' => :'String',
53
+ :'created_at' => :'DateTime',
54
+ :'id' => :'String',
55
+ :'name' => :'String',
56
+ :'updated_at' => :'DateTime',
57
+ :'user_id' => :'String'
58
+ }
59
+ end
60
+
61
+ # List of attributes with nullable: true
62
+ def self.openapi_nullable
63
+ Set.new([
64
+ ])
65
+ end
66
+
67
+ # Initializes the object
68
+ # @param [Hash] attributes Model attributes in the form of hash
69
+ def initialize(attributes = {})
70
+ if (!attributes.is_a?(Hash))
71
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::AttachmentEntity` initialize method"
72
+ end
73
+
74
+ # check to see if the attribute exists and convert string to symbol for hash key
75
+ attributes = attributes.each_with_object({}) { |(k, v), h|
76
+ if (!self.class.attribute_map.key?(k.to_sym))
77
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::AttachmentEntity`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
78
+ end
79
+ h[k.to_sym] = v
80
+ }
81
+
82
+ if attributes.key?(:'attachment_id')
83
+ self.attachment_id = attributes[:'attachment_id']
84
+ end
85
+
86
+ if attributes.key?(:'content_length')
87
+ self.content_length = attributes[:'content_length']
88
+ end
89
+
90
+ if attributes.key?(:'content_type')
91
+ self.content_type = attributes[:'content_type']
92
+ end
93
+
94
+ if attributes.key?(:'created_at')
95
+ self.created_at = attributes[:'created_at']
96
+ end
97
+
98
+ if attributes.key?(:'id')
99
+ self.id = attributes[:'id']
100
+ end
101
+
102
+ if attributes.key?(:'name')
103
+ self.name = attributes[:'name']
104
+ end
105
+
106
+ if attributes.key?(:'updated_at')
107
+ self.updated_at = attributes[:'updated_at']
108
+ end
109
+
110
+ if attributes.key?(:'user_id')
111
+ self.user_id = attributes[:'user_id']
112
+ end
113
+ end
114
+
115
+ # Show invalid properties with the reasons. Usually used together with valid?
116
+ # @return Array for valid properties with the reasons
117
+ def list_invalid_properties
118
+ invalid_properties = Array.new
119
+ if @attachment_id.nil?
120
+ invalid_properties.push('invalid value for "attachment_id", attachment_id cannot be nil.')
121
+ end
122
+
123
+ if @created_at.nil?
124
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
125
+ end
126
+
127
+ if @updated_at.nil?
128
+ invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
129
+ end
130
+
131
+ if @user_id.nil?
132
+ invalid_properties.push('invalid value for "user_id", user_id cannot be nil.')
133
+ end
134
+
135
+ invalid_properties
136
+ end
137
+
138
+ # Check to see if the all the properties in the model are valid
139
+ # @return true if the model is valid
140
+ def valid?
141
+ return false if @attachment_id.nil?
142
+ return false if @created_at.nil?
143
+ return false if @updated_at.nil?
144
+ return false if @user_id.nil?
145
+ true
146
+ end
147
+
148
+ # Checks equality by comparing each attribute.
149
+ # @param [Object] Object to be compared
150
+ def ==(o)
151
+ return true if self.equal?(o)
152
+ self.class == o.class &&
153
+ attachment_id == o.attachment_id &&
154
+ content_length == o.content_length &&
155
+ content_type == o.content_type &&
156
+ created_at == o.created_at &&
157
+ id == o.id &&
158
+ name == o.name &&
159
+ updated_at == o.updated_at &&
160
+ user_id == o.user_id
161
+ end
162
+
163
+ # @see the `==` method
164
+ # @param [Object] Object to be compared
165
+ def eql?(o)
166
+ self == o
167
+ end
168
+
169
+ # Calculates hash code according to all attributes.
170
+ # @return [Integer] Hash code
171
+ def hash
172
+ [attachment_id, content_length, content_type, created_at, id, name, updated_at, user_id].hash
173
+ end
174
+
175
+ # Builds the object from hash
176
+ # @param [Hash] attributes Model attributes in the form of hash
177
+ # @return [Object] Returns the model itself
178
+ def self.build_from_hash(attributes)
179
+ new.build_from_hash(attributes)
180
+ end
181
+
182
+ # Builds the object from hash
183
+ # @param [Hash] attributes Model attributes in the form of hash
184
+ # @return [Object] Returns the model itself
185
+ def build_from_hash(attributes)
186
+ return nil unless attributes.is_a?(Hash)
187
+ self.class.openapi_types.each_pair do |key, type|
188
+ if type =~ /\AArray<(.*)>/i
189
+ # check to ensure the input is an array given that the attribute
190
+ # is documented as an array but the input is not
191
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
192
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
193
+ end
194
+ elsif !attributes[self.class.attribute_map[key]].nil?
195
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
196
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
197
+ end
198
+
199
+ self
200
+ end
201
+
202
+ # Deserializes the data based on type
203
+ # @param string type Data type
204
+ # @param string value Value to be deserialized
205
+ # @return [Object] Deserialized data
206
+ def _deserialize(type, value)
207
+ case type.to_sym
208
+ when :DateTime
209
+ DateTime.parse(value)
210
+ when :Date
211
+ Date.parse(value)
212
+ when :String
213
+ value.to_s
214
+ when :Integer
215
+ value.to_i
216
+ when :Float
217
+ value.to_f
218
+ when :Boolean
219
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
220
+ true
221
+ else
222
+ false
223
+ end
224
+ when :Object
225
+ # generic object (usually a Hash), return directly
226
+ value
227
+ when /\AArray<(?<inner_type>.+)>\z/
228
+ inner_type = Regexp.last_match[:inner_type]
229
+ value.map { |v| _deserialize(inner_type, v) }
230
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
231
+ k_type = Regexp.last_match[:k_type]
232
+ v_type = Regexp.last_match[:v_type]
233
+ {}.tap do |hash|
234
+ value.each do |k, v|
235
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
236
+ end
237
+ end
238
+ else # model
239
+ MailSlurpClient.const_get(type).build_from_hash(value)
240
+ end
241
+ end
242
+
243
+ # Returns the string representation of the object
244
+ # @return [String] String presentation of the object
245
+ def to_s
246
+ to_hash.to_s
247
+ end
248
+
249
+ # to_body is an alias to to_hash (backward compatibility)
250
+ # @return [Hash] Returns the object in the form of hash
251
+ def to_body
252
+ to_hash
253
+ end
254
+
255
+ # Returns the object in the form of hash
256
+ # @return [Hash] Returns the object in the form of hash
257
+ def to_hash
258
+ hash = {}
259
+ self.class.attribute_map.each_pair do |attr, param|
260
+ value = self.send(attr)
261
+ if value.nil?
262
+ is_nullable = self.class.openapi_nullable.include?(attr)
263
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
264
+ end
265
+
266
+ hash[param] = _to_hash(value)
267
+ end
268
+ hash
269
+ end
270
+
271
+ # Outputs non-array value in the form of hash
272
+ # For object, use to_hash. Otherwise, just return the value
273
+ # @param [Object] value Any valid value
274
+ # @return [Hash] Returns the value in the form of hash
275
+ def _to_hash(value)
276
+ if value.is_a?(Array)
277
+ value.compact.map { |v| _to_hash(v) }
278
+ elsif value.is_a?(Hash)
279
+ {}.tap do |hash|
280
+ value.each { |k, v| hash[k] = _to_hash(v) }
281
+ end
282
+ elsif value.respond_to? :to_hash
283
+ value.to_hash
284
+ else
285
+ value
286
+ end
287
+ end
288
+ end
289
+ end