mailslurp_client 15.8.1 → 15.11.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (79) hide show
  1. checksums.yaml +4 -4
  2. data/lib/mailslurp_client/api/attachment_controller_api.rb +4 -4
  3. data/lib/mailslurp_client/api/email_controller_api.rb +68 -3
  4. data/lib/mailslurp_client/api/form_controller_api.rb +2 -2
  5. data/lib/mailslurp_client/api/inbox_controller_api.rb +75 -0
  6. data/lib/mailslurp_client/api/missed_email_controller_api.rb +56 -0
  7. data/lib/mailslurp_client/api/phone_controller_api.rb +487 -0
  8. data/lib/mailslurp_client/api/sent_emails_controller_api.rb +73 -0
  9. data/lib/mailslurp_client/api/sms_controller_api.rb +286 -0
  10. data/lib/mailslurp_client/api/wait_for_controller_api.rb +64 -0
  11. data/lib/mailslurp_client/api/webhook_controller_api.rb +2 -2
  12. data/lib/mailslurp_client/configuration.rb +2 -2
  13. data/lib/mailslurp_client/models/abstract_webhook_payload.rb +2 -2
  14. data/lib/mailslurp_client/models/alias_projection.rb +31 -31
  15. data/lib/mailslurp_client/models/attachment_entity.rb +10 -1
  16. data/lib/mailslurp_client/models/attachment_projection.rb +14 -14
  17. data/lib/mailslurp_client/models/contact_projection.rb +18 -13
  18. data/lib/mailslurp_client/models/create_emergency_address_options.rb +324 -0
  19. data/lib/mailslurp_client/models/create_webhook_options.rb +3 -3
  20. data/lib/mailslurp_client/models/email_html_dto.rb +215 -0
  21. data/lib/mailslurp_client/models/email_preview.rb +5 -0
  22. data/lib/mailslurp_client/models/email_projection.rb +20 -10
  23. data/lib/mailslurp_client/models/emergency_address.rb +408 -0
  24. data/lib/mailslurp_client/models/emergency_address_dto.rb +273 -0
  25. data/lib/mailslurp_client/models/empty_response_dto.rb +206 -0
  26. data/lib/mailslurp_client/models/expired_inbox_record_projection.rb +15 -15
  27. data/lib/mailslurp_client/models/inbox_preview.rb +5 -0
  28. data/lib/mailslurp_client/models/missed_email.rb +37 -1
  29. data/lib/mailslurp_client/models/organization_inbox_projection.rb +5 -0
  30. data/lib/mailslurp_client/models/page_alias.rb +19 -19
  31. data/lib/mailslurp_client/models/page_attachment_entity.rb +19 -19
  32. data/lib/mailslurp_client/models/page_bounced_email.rb +19 -19
  33. data/lib/mailslurp_client/models/page_bounced_recipients.rb +19 -19
  34. data/lib/mailslurp_client/models/page_contact_projection.rb +19 -19
  35. data/lib/mailslurp_client/models/page_email_preview.rb +19 -19
  36. data/lib/mailslurp_client/models/page_email_projection.rb +19 -19
  37. data/lib/mailslurp_client/models/page_email_validation_request.rb +19 -19
  38. data/lib/mailslurp_client/models/page_expired_inbox_record_projection.rb +19 -19
  39. data/lib/mailslurp_client/models/page_group_projection.rb +19 -19
  40. data/lib/mailslurp_client/models/page_inbox_forwarder_dto.rb +19 -19
  41. data/lib/mailslurp_client/models/page_inbox_projection.rb +19 -19
  42. data/lib/mailslurp_client/models/page_inbox_ruleset_dto.rb +19 -19
  43. data/lib/mailslurp_client/models/page_missed_email_projection.rb +19 -19
  44. data/lib/mailslurp_client/models/page_organization_inbox_projection.rb +19 -19
  45. data/lib/mailslurp_client/models/page_phone_number_projection.rb +308 -0
  46. data/lib/mailslurp_client/models/page_sent_email_with_queue_projection.rb +344 -0
  47. data/lib/mailslurp_client/models/page_sms_projection.rb +308 -0
  48. data/lib/mailslurp_client/models/page_template_projection.rb +19 -19
  49. data/lib/mailslurp_client/models/page_thread_projection.rb +19 -19
  50. data/lib/mailslurp_client/models/page_tracking_pixel_projection.rb +19 -19
  51. data/lib/mailslurp_client/models/page_unknown_missed_email_projection.rb +19 -19
  52. data/lib/mailslurp_client/models/page_webhook_projection.rb +19 -19
  53. data/lib/mailslurp_client/models/page_webhook_result.rb +19 -19
  54. data/lib/mailslurp_client/models/phone_number_dto.rb +347 -0
  55. data/lib/mailslurp_client/models/phone_number_projection.rb +302 -0
  56. data/lib/mailslurp_client/models/phone_plan_dto.rb +287 -0
  57. data/lib/mailslurp_client/models/send_with_queue_result.rb +318 -0
  58. data/lib/mailslurp_client/models/sent_email_projection.rb +32 -27
  59. data/lib/mailslurp_client/models/sms_match_option.rb +289 -0
  60. data/lib/mailslurp_client/models/sms_message.rb +318 -0
  61. data/lib/mailslurp_client/models/sms_preview.rb +267 -0
  62. data/lib/mailslurp_client/models/sms_projection.rb +282 -0
  63. data/lib/mailslurp_client/models/template_projection.rb +18 -18
  64. data/lib/mailslurp_client/models/thread_projection.rb +36 -36
  65. data/lib/mailslurp_client/models/tracking_pixel_projection.rb +10 -10
  66. data/lib/mailslurp_client/models/wait_for_sms_conditions.rb +371 -0
  67. data/lib/mailslurp_client/models/webhook_bounce_payload.rb +2 -2
  68. data/lib/mailslurp_client/models/webhook_bounce_recipient_payload.rb +2 -2
  69. data/lib/mailslurp_client/models/webhook_dto.rb +3 -3
  70. data/lib/mailslurp_client/models/webhook_email_opened_payload.rb +2 -2
  71. data/lib/mailslurp_client/models/webhook_email_read_payload.rb +2 -2
  72. data/lib/mailslurp_client/models/webhook_new_attachment_payload.rb +2 -2
  73. data/lib/mailslurp_client/models/webhook_new_contact_payload.rb +7 -2
  74. data/lib/mailslurp_client/models/webhook_new_email_payload.rb +2 -2
  75. data/lib/mailslurp_client/models/webhook_projection.rb +2 -2
  76. data/lib/mailslurp_client/models/webhook_result_dto.rb +7 -2
  77. data/lib/mailslurp_client/version.rb +1 -1
  78. data/lib/mailslurp_client.rb +19 -0
  79. metadata +21 -2
@@ -0,0 +1,215 @@
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
+ class EmailHtmlDto
17
+ attr_accessor :subject
18
+
19
+ attr_accessor :body
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'subject' => :'subject',
25
+ :'body' => :'body'
26
+ }
27
+ end
28
+
29
+ # Attribute type mapping.
30
+ def self.openapi_types
31
+ {
32
+ :'subject' => :'String',
33
+ :'body' => :'String'
34
+ }
35
+ end
36
+
37
+ # List of attributes with nullable: true
38
+ def self.openapi_nullable
39
+ Set.new([
40
+ ])
41
+ end
42
+
43
+ # Initializes the object
44
+ # @param [Hash] attributes Model attributes in the form of hash
45
+ def initialize(attributes = {})
46
+ if (!attributes.is_a?(Hash))
47
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::EmailHtmlDto` initialize method"
48
+ end
49
+
50
+ # check to see if the attribute exists and convert string to symbol for hash key
51
+ attributes = attributes.each_with_object({}) { |(k, v), h|
52
+ if (!self.class.attribute_map.key?(k.to_sym))
53
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::EmailHtmlDto`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
54
+ end
55
+ h[k.to_sym] = v
56
+ }
57
+
58
+ if attributes.key?(:'subject')
59
+ self.subject = attributes[:'subject']
60
+ end
61
+
62
+ if attributes.key?(:'body')
63
+ self.body = attributes[:'body']
64
+ end
65
+ end
66
+
67
+ # Show invalid properties with the reasons. Usually used together with valid?
68
+ # @return Array for valid properties with the reasons
69
+ def list_invalid_properties
70
+ invalid_properties = Array.new
71
+ invalid_properties
72
+ end
73
+
74
+ # Check to see if the all the properties in the model are valid
75
+ # @return true if the model is valid
76
+ def valid?
77
+ true
78
+ end
79
+
80
+ # Checks equality by comparing each attribute.
81
+ # @param [Object] Object to be compared
82
+ def ==(o)
83
+ return true if self.equal?(o)
84
+ self.class == o.class &&
85
+ subject == o.subject &&
86
+ body == o.body
87
+ end
88
+
89
+ # @see the `==` method
90
+ # @param [Object] Object to be compared
91
+ def eql?(o)
92
+ self == o
93
+ end
94
+
95
+ # Calculates hash code according to all attributes.
96
+ # @return [Integer] Hash code
97
+ def hash
98
+ [subject, body].hash
99
+ end
100
+
101
+ # Builds the object from hash
102
+ # @param [Hash] attributes Model attributes in the form of hash
103
+ # @return [Object] Returns the model itself
104
+ def self.build_from_hash(attributes)
105
+ new.build_from_hash(attributes)
106
+ end
107
+
108
+ # Builds the object from hash
109
+ # @param [Hash] attributes Model attributes in the form of hash
110
+ # @return [Object] Returns the model itself
111
+ def build_from_hash(attributes)
112
+ return nil unless attributes.is_a?(Hash)
113
+ self.class.openapi_types.each_pair do |key, type|
114
+ if type =~ /\AArray<(.*)>/i
115
+ # check to ensure the input is an array given that the attribute
116
+ # is documented as an array but the input is not
117
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
118
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
119
+ end
120
+ elsif !attributes[self.class.attribute_map[key]].nil?
121
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
122
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
123
+ end
124
+
125
+ self
126
+ end
127
+
128
+ # Deserializes the data based on type
129
+ # @param string type Data type
130
+ # @param string value Value to be deserialized
131
+ # @return [Object] Deserialized data
132
+ def _deserialize(type, value)
133
+ case type.to_sym
134
+ when :DateTime
135
+ DateTime.parse(value)
136
+ when :Date
137
+ Date.parse(value)
138
+ when :String
139
+ value.to_s
140
+ when :Integer
141
+ value.to_i
142
+ when :Float
143
+ value.to_f
144
+ when :Boolean
145
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
146
+ true
147
+ else
148
+ false
149
+ end
150
+ when :Object
151
+ # generic object (usually a Hash), return directly
152
+ value
153
+ when /\AArray<(?<inner_type>.+)>\z/
154
+ inner_type = Regexp.last_match[:inner_type]
155
+ value.map { |v| _deserialize(inner_type, v) }
156
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
157
+ k_type = Regexp.last_match[:k_type]
158
+ v_type = Regexp.last_match[:v_type]
159
+ {}.tap do |hash|
160
+ value.each do |k, v|
161
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
162
+ end
163
+ end
164
+ else # model
165
+ MailSlurpClient.const_get(type).build_from_hash(value)
166
+ end
167
+ end
168
+
169
+ # Returns the string representation of the object
170
+ # @return [String] String presentation of the object
171
+ def to_s
172
+ to_hash.to_s
173
+ end
174
+
175
+ # to_body is an alias to to_hash (backward compatibility)
176
+ # @return [Hash] Returns the object in the form of hash
177
+ def to_body
178
+ to_hash
179
+ end
180
+
181
+ # Returns the object in the form of hash
182
+ # @return [Hash] Returns the object in the form of hash
183
+ def to_hash
184
+ hash = {}
185
+ self.class.attribute_map.each_pair do |attr, param|
186
+ value = self.send(attr)
187
+ if value.nil?
188
+ is_nullable = self.class.openapi_nullable.include?(attr)
189
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
190
+ end
191
+
192
+ hash[param] = _to_hash(value)
193
+ end
194
+ hash
195
+ end
196
+
197
+ # Outputs non-array value in the form of hash
198
+ # For object, use to_hash. Otherwise, just return the value
199
+ # @param [Object] value Any valid value
200
+ # @return [Hash] Returns the value in the form of hash
201
+ def _to_hash(value)
202
+ if value.is_a?(Array)
203
+ value.compact.map { |v| _to_hash(v) }
204
+ elsif value.is_a?(Hash)
205
+ {}.tap do |hash|
206
+ value.each { |k, v| hash[k] = _to_hash(v) }
207
+ end
208
+ elsif value.respond_to? :to_hash
209
+ value.to_hash
210
+ else
211
+ value
212
+ end
213
+ end
214
+ end
215
+ end
@@ -154,6 +154,10 @@ module MailSlurpClient
154
154
  invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
155
155
  end
156
156
 
157
+ if @read.nil?
158
+ invalid_properties.push('invalid value for "read", read cannot be nil.')
159
+ end
160
+
157
161
  invalid_properties
158
162
  end
159
163
 
@@ -163,6 +167,7 @@ module MailSlurpClient
163
167
  return false if @id.nil?
164
168
  return false if @to.nil?
165
169
  return false if @created_at.nil?
170
+ return false if @read.nil?
166
171
  true
167
172
  end
168
173
 
@@ -27,12 +27,12 @@ module MailSlurpClient
27
27
 
28
28
  attr_accessor :to
29
29
 
30
+ attr_accessor :created_at
31
+
30
32
  attr_accessor :bcc
31
33
 
32
34
  attr_accessor :cc
33
35
 
34
- attr_accessor :created_at
35
-
36
36
  attr_accessor :team_access
37
37
 
38
38
  attr_accessor :read
@@ -50,9 +50,9 @@ module MailSlurpClient
50
50
  :'inbox_id' => :'inboxId',
51
51
  :'attachments' => :'attachments',
52
52
  :'to' => :'to',
53
+ :'created_at' => :'createdAt',
53
54
  :'bcc' => :'bcc',
54
55
  :'cc' => :'cc',
55
- :'created_at' => :'createdAt',
56
56
  :'team_access' => :'teamAccess',
57
57
  :'read' => :'read',
58
58
  :'body_md5_hash' => :'bodyMD5Hash',
@@ -69,9 +69,9 @@ module MailSlurpClient
69
69
  :'inbox_id' => :'String',
70
70
  :'attachments' => :'Array<String>',
71
71
  :'to' => :'Array<String>',
72
+ :'created_at' => :'DateTime',
72
73
  :'bcc' => :'Array<String>',
73
74
  :'cc' => :'Array<String>',
74
- :'created_at' => :'DateTime',
75
75
  :'team_access' => :'Boolean',
76
76
  :'read' => :'Boolean',
77
77
  :'body_md5_hash' => :'String',
@@ -128,6 +128,10 @@ module MailSlurpClient
128
128
  end
129
129
  end
130
130
 
131
+ if attributes.key?(:'created_at')
132
+ self.created_at = attributes[:'created_at']
133
+ end
134
+
131
135
  if attributes.key?(:'bcc')
132
136
  if (value = attributes[:'bcc']).is_a?(Array)
133
137
  self.bcc = value
@@ -140,10 +144,6 @@ module MailSlurpClient
140
144
  end
141
145
  end
142
146
 
143
- if attributes.key?(:'created_at')
144
- self.created_at = attributes[:'created_at']
145
- end
146
-
147
147
  if attributes.key?(:'team_access')
148
148
  self.team_access = attributes[:'team_access']
149
149
  end
@@ -181,6 +181,14 @@ module MailSlurpClient
181
181
  invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
182
182
  end
183
183
 
184
+ if @team_access.nil?
185
+ invalid_properties.push('invalid value for "team_access", team_access cannot be nil.')
186
+ end
187
+
188
+ if @read.nil?
189
+ invalid_properties.push('invalid value for "read", read cannot be nil.')
190
+ end
191
+
184
192
  invalid_properties
185
193
  end
186
194
 
@@ -191,6 +199,8 @@ module MailSlurpClient
191
199
  return false if @inbox_id.nil?
192
200
  return false if @to.nil?
193
201
  return false if @created_at.nil?
202
+ return false if @team_access.nil?
203
+ return false if @read.nil?
194
204
  true
195
205
  end
196
206
 
@@ -205,9 +215,9 @@ module MailSlurpClient
205
215
  inbox_id == o.inbox_id &&
206
216
  attachments == o.attachments &&
207
217
  to == o.to &&
218
+ created_at == o.created_at &&
208
219
  bcc == o.bcc &&
209
220
  cc == o.cc &&
210
- created_at == o.created_at &&
211
221
  team_access == o.team_access &&
212
222
  read == o.read &&
213
223
  body_md5_hash == o.body_md5_hash &&
@@ -223,7 +233,7 @@ module MailSlurpClient
223
233
  # Calculates hash code according to all attributes.
224
234
  # @return [Integer] Hash code
225
235
  def hash
226
- [id, from, subject, inbox_id, attachments, to, bcc, cc, created_at, team_access, read, body_md5_hash, body_excerpt].hash
236
+ [id, from, subject, inbox_id, attachments, to, created_at, bcc, cc, team_access, read, body_md5_hash, body_excerpt].hash
227
237
  end
228
238
 
229
239
  # Builds the object from hash