mailslurp_client 15.9.0 → 15.12.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (88) hide show
  1. checksums.yaml +4 -4
  2. data/lib/mailslurp_client/api/api_user_controller_api.rb +74 -0
  3. data/lib/mailslurp_client/api/attachment_controller_api.rb +4 -4
  4. data/lib/mailslurp_client/api/email_controller_api.rb +68 -3
  5. data/lib/mailslurp_client/api/inbox_controller_api.rb +138 -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/template_controller_api.rb +124 -0
  11. data/lib/mailslurp_client/api/wait_for_controller_api.rb +64 -0
  12. data/lib/mailslurp_client/api/webhook_controller_api.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/bounce_projection.rb +31 -4
  18. data/lib/mailslurp_client/models/{bounce_recipient.rb → bounce_recipient_projection.rb} +35 -36
  19. data/lib/mailslurp_client/models/bounced_email_dto.rb +19 -1
  20. data/lib/mailslurp_client/models/bounced_recipient_dto.rb +37 -1
  21. data/lib/mailslurp_client/models/contact_projection.rb +18 -13
  22. data/lib/mailslurp_client/models/create_emergency_address_options.rb +324 -0
  23. data/lib/mailslurp_client/models/create_webhook_options.rb +2 -2
  24. data/lib/mailslurp_client/models/email_html_dto.rb +215 -0
  25. data/lib/mailslurp_client/models/email_preview.rb +5 -0
  26. data/lib/mailslurp_client/models/email_projection.rb +29 -19
  27. data/lib/mailslurp_client/models/emergency_address.rb +408 -0
  28. data/lib/mailslurp_client/models/emergency_address_dto.rb +273 -0
  29. data/lib/mailslurp_client/models/empty_response_dto.rb +206 -0
  30. data/lib/mailslurp_client/models/expired_inbox_record_projection.rb +15 -15
  31. data/lib/mailslurp_client/models/inbox_by_name_result.rb +221 -0
  32. data/lib/mailslurp_client/models/inbox_dto.rb +11 -1
  33. data/lib/mailslurp_client/models/inbox_preview.rb +5 -0
  34. data/lib/mailslurp_client/models/missed_email.rb +37 -1
  35. data/lib/mailslurp_client/models/organization_inbox_projection.rb +5 -0
  36. data/lib/mailslurp_client/models/page_alias.rb +22 -22
  37. data/lib/mailslurp_client/models/page_attachment_entity.rb +22 -22
  38. data/lib/mailslurp_client/models/page_bounced_email.rb +22 -22
  39. data/lib/mailslurp_client/models/page_bounced_recipients.rb +23 -23
  40. data/lib/mailslurp_client/models/page_contact_projection.rb +22 -22
  41. data/lib/mailslurp_client/models/page_email_preview.rb +22 -22
  42. data/lib/mailslurp_client/models/page_email_projection.rb +22 -22
  43. data/lib/mailslurp_client/models/page_email_validation_request.rb +22 -22
  44. data/lib/mailslurp_client/models/page_expired_inbox_record_projection.rb +22 -22
  45. data/lib/mailslurp_client/models/page_group_projection.rb +22 -22
  46. data/lib/mailslurp_client/models/page_inbox_forwarder_dto.rb +22 -22
  47. data/lib/mailslurp_client/models/page_inbox_projection.rb +22 -22
  48. data/lib/mailslurp_client/models/page_inbox_ruleset_dto.rb +22 -22
  49. data/lib/mailslurp_client/models/page_missed_email_projection.rb +22 -22
  50. data/lib/mailslurp_client/models/page_organization_inbox_projection.rb +22 -22
  51. data/lib/mailslurp_client/models/page_phone_number_projection.rb +308 -0
  52. data/lib/mailslurp_client/models/page_sent_email_projection.rb +16 -16
  53. data/lib/mailslurp_client/models/page_sent_email_with_queue_projection.rb +344 -0
  54. data/lib/mailslurp_client/models/page_sms_projection.rb +308 -0
  55. data/lib/mailslurp_client/models/page_template_projection.rb +22 -22
  56. data/lib/mailslurp_client/models/page_thread_projection.rb +22 -22
  57. data/lib/mailslurp_client/models/page_tracking_pixel_projection.rb +22 -22
  58. data/lib/mailslurp_client/models/page_unknown_missed_email_projection.rb +22 -22
  59. data/lib/mailslurp_client/models/page_webhook_projection.rb +22 -22
  60. data/lib/mailslurp_client/models/page_webhook_result.rb +22 -22
  61. data/lib/mailslurp_client/models/phone_number_dto.rb +347 -0
  62. data/lib/mailslurp_client/models/phone_number_projection.rb +302 -0
  63. data/lib/mailslurp_client/models/phone_plan_dto.rb +287 -0
  64. data/lib/mailslurp_client/models/send_with_queue_result.rb +318 -0
  65. data/lib/mailslurp_client/models/sent_email_projection.rb +18 -13
  66. data/lib/mailslurp_client/models/sms_match_option.rb +289 -0
  67. data/lib/mailslurp_client/models/sms_message.rb +318 -0
  68. data/lib/mailslurp_client/models/sms_preview.rb +267 -0
  69. data/lib/mailslurp_client/models/sms_projection.rb +282 -0
  70. data/lib/mailslurp_client/models/template_preview.rb +211 -0
  71. data/lib/mailslurp_client/models/template_projection.rb +18 -18
  72. data/lib/mailslurp_client/models/thread_projection.rb +36 -36
  73. data/lib/mailslurp_client/models/tracking_pixel_projection.rb +19 -19
  74. data/lib/mailslurp_client/models/user_info_dto.rb +334 -0
  75. data/lib/mailslurp_client/models/wait_for_sms_conditions.rb +371 -0
  76. data/lib/mailslurp_client/models/webhook_bounce_payload.rb +2 -2
  77. data/lib/mailslurp_client/models/webhook_bounce_recipient_payload.rb +2 -2
  78. data/lib/mailslurp_client/models/webhook_dto.rb +2 -2
  79. data/lib/mailslurp_client/models/webhook_email_opened_payload.rb +2 -2
  80. data/lib/mailslurp_client/models/webhook_email_read_payload.rb +2 -2
  81. data/lib/mailslurp_client/models/webhook_new_attachment_payload.rb +2 -2
  82. data/lib/mailslurp_client/models/webhook_new_contact_payload.rb +7 -2
  83. data/lib/mailslurp_client/models/webhook_new_email_payload.rb +2 -2
  84. data/lib/mailslurp_client/models/webhook_projection.rb +2 -2
  85. data/lib/mailslurp_client/models/webhook_result_dto.rb +7 -2
  86. data/lib/mailslurp_client/version.rb +1 -1
  87. data/lib/mailslurp_client.rb +24 -1
  88. metadata +26 -3
@@ -23,6 +23,8 @@ module MailSlurpClient
23
23
 
24
24
  attr_accessor :subject
25
25
 
26
+ attr_accessor :created_at
27
+
26
28
  attr_accessor :attachments
27
29
 
28
30
  attr_accessor :inbox_id
@@ -33,8 +35,6 @@ module MailSlurpClient
33
35
 
34
36
  attr_accessor :cc
35
37
 
36
- attr_accessor :created_at
37
-
38
38
  attr_accessor :body_md5_hash
39
39
 
40
40
  attr_accessor :virtual_send
@@ -46,12 +46,12 @@ module MailSlurpClient
46
46
  :'from' => :'from',
47
47
  :'user_id' => :'userId',
48
48
  :'subject' => :'subject',
49
+ :'created_at' => :'createdAt',
49
50
  :'attachments' => :'attachments',
50
51
  :'inbox_id' => :'inboxId',
51
52
  :'to' => :'to',
52
53
  :'bcc' => :'bcc',
53
54
  :'cc' => :'cc',
54
- :'created_at' => :'createdAt',
55
55
  :'body_md5_hash' => :'bodyMD5Hash',
56
56
  :'virtual_send' => :'virtualSend'
57
57
  }
@@ -64,12 +64,12 @@ module MailSlurpClient
64
64
  :'from' => :'String',
65
65
  :'user_id' => :'String',
66
66
  :'subject' => :'String',
67
+ :'created_at' => :'DateTime',
67
68
  :'attachments' => :'Array<String>',
68
69
  :'inbox_id' => :'String',
69
70
  :'to' => :'Array<String>',
70
71
  :'bcc' => :'Array<String>',
71
72
  :'cc' => :'Array<String>',
72
- :'created_at' => :'DateTime',
73
73
  :'body_md5_hash' => :'String',
74
74
  :'virtual_send' => :'Boolean'
75
75
  }
@@ -112,6 +112,10 @@ module MailSlurpClient
112
112
  self.subject = attributes[:'subject']
113
113
  end
114
114
 
115
+ if attributes.key?(:'created_at')
116
+ self.created_at = attributes[:'created_at']
117
+ end
118
+
115
119
  if attributes.key?(:'attachments')
116
120
  if (value = attributes[:'attachments']).is_a?(Array)
117
121
  self.attachments = 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?(:'body_md5_hash')
148
148
  self.body_md5_hash = attributes[:'body_md5_hash']
149
149
  end
@@ -165,6 +165,10 @@ module MailSlurpClient
165
165
  invalid_properties.push('invalid value for "user_id", user_id cannot be nil.')
166
166
  end
167
167
 
168
+ if @created_at.nil?
169
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
170
+ end
171
+
168
172
  if @attachments.nil?
169
173
  invalid_properties.push('invalid value for "attachments", attachments cannot be nil.')
170
174
  end
@@ -185,8 +189,8 @@ module MailSlurpClient
185
189
  invalid_properties.push('invalid value for "cc", cc cannot be nil.')
186
190
  end
187
191
 
188
- if @created_at.nil?
189
- invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
192
+ if @virtual_send.nil?
193
+ invalid_properties.push('invalid value for "virtual_send", virtual_send cannot be nil.')
190
194
  end
191
195
 
192
196
  invalid_properties
@@ -197,12 +201,13 @@ module MailSlurpClient
197
201
  def valid?
198
202
  return false if @id.nil?
199
203
  return false if @user_id.nil?
204
+ return false if @created_at.nil?
200
205
  return false if @attachments.nil?
201
206
  return false if @inbox_id.nil?
202
207
  return false if @to.nil?
203
208
  return false if @bcc.nil?
204
209
  return false if @cc.nil?
205
- return false if @created_at.nil?
210
+ return false if @virtual_send.nil?
206
211
  true
207
212
  end
208
213
 
@@ -215,12 +220,12 @@ module MailSlurpClient
215
220
  from == o.from &&
216
221
  user_id == o.user_id &&
217
222
  subject == o.subject &&
223
+ created_at == o.created_at &&
218
224
  attachments == o.attachments &&
219
225
  inbox_id == o.inbox_id &&
220
226
  to == o.to &&
221
227
  bcc == o.bcc &&
222
228
  cc == o.cc &&
223
- created_at == o.created_at &&
224
229
  body_md5_hash == o.body_md5_hash &&
225
230
  virtual_send == o.virtual_send
226
231
  end
@@ -234,7 +239,7 @@ module MailSlurpClient
234
239
  # Calculates hash code according to all attributes.
235
240
  # @return [Integer] Hash code
236
241
  def hash
237
- [id, from, user_id, subject, attachments, inbox_id, to, bcc, cc, created_at, body_md5_hash, virtual_send].hash
242
+ [id, from, user_id, subject, created_at, attachments, inbox_id, to, bcc, cc, body_md5_hash, virtual_send].hash
238
243
  end
239
244
 
240
245
  # Builds the object from hash
@@ -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://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
+ # Options for matching SMS messages in a phone number. Each match option object contains a `field`, `should` and `value` property. Together they form logical conditions such as `BODY` should `CONTAIN` value.
17
+ class SmsMatchOption
18
+ # Fields of an SMS object that can be used to filter results
19
+ attr_accessor :field
20
+
21
+ # How the value of the email field specified should be compared to the value given in the match options.
22
+ attr_accessor :should
23
+
24
+ # The value you wish to compare with the value of the field specified using the `should` value passed. For example `BODY` should `CONTAIN` a value passed.
25
+ attr_accessor :value
26
+
27
+ class EnumAttributeValidator
28
+ attr_reader :datatype
29
+ attr_reader :allowable_values
30
+
31
+ def initialize(datatype, allowable_values)
32
+ @allowable_values = allowable_values.map do |value|
33
+ case datatype.to_s
34
+ when /Integer/i
35
+ value.to_i
36
+ when /Float/i
37
+ value.to_f
38
+ else
39
+ value
40
+ end
41
+ end
42
+ end
43
+
44
+ def valid?(value)
45
+ !value || allowable_values.include?(value)
46
+ end
47
+ end
48
+
49
+ # Attribute mapping from ruby-style variable name to JSON key.
50
+ def self.attribute_map
51
+ {
52
+ :'field' => :'field',
53
+ :'should' => :'should',
54
+ :'value' => :'value'
55
+ }
56
+ end
57
+
58
+ # Attribute type mapping.
59
+ def self.openapi_types
60
+ {
61
+ :'field' => :'String',
62
+ :'should' => :'String',
63
+ :'value' => :'String'
64
+ }
65
+ end
66
+
67
+ # List of attributes with nullable: true
68
+ def self.openapi_nullable
69
+ Set.new([
70
+ ])
71
+ end
72
+
73
+ # Initializes the object
74
+ # @param [Hash] attributes Model attributes in the form of hash
75
+ def initialize(attributes = {})
76
+ if (!attributes.is_a?(Hash))
77
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::SmsMatchOption` initialize method"
78
+ end
79
+
80
+ # check to see if the attribute exists and convert string to symbol for hash key
81
+ attributes = attributes.each_with_object({}) { |(k, v), h|
82
+ if (!self.class.attribute_map.key?(k.to_sym))
83
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::SmsMatchOption`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
84
+ end
85
+ h[k.to_sym] = v
86
+ }
87
+
88
+ if attributes.key?(:'field')
89
+ self.field = attributes[:'field']
90
+ end
91
+
92
+ if attributes.key?(:'should')
93
+ self.should = attributes[:'should']
94
+ end
95
+
96
+ if attributes.key?(:'value')
97
+ self.value = attributes[:'value']
98
+ end
99
+ end
100
+
101
+ # Show invalid properties with the reasons. Usually used together with valid?
102
+ # @return Array for valid properties with the reasons
103
+ def list_invalid_properties
104
+ invalid_properties = Array.new
105
+ if @field.nil?
106
+ invalid_properties.push('invalid value for "field", field cannot be nil.')
107
+ end
108
+
109
+ if @should.nil?
110
+ invalid_properties.push('invalid value for "should", should cannot be nil.')
111
+ end
112
+
113
+ if @value.nil?
114
+ invalid_properties.push('invalid value for "value", value cannot be nil.')
115
+ end
116
+
117
+ invalid_properties
118
+ end
119
+
120
+ # Check to see if the all the properties in the model are valid
121
+ # @return true if the model is valid
122
+ def valid?
123
+ return false if @field.nil?
124
+ field_validator = EnumAttributeValidator.new('String', ["BODY", "FROM"])
125
+ return false unless field_validator.valid?(@field)
126
+ return false if @should.nil?
127
+ should_validator = EnumAttributeValidator.new('String', ["CONTAIN", "EQUAL"])
128
+ return false unless should_validator.valid?(@should)
129
+ return false if @value.nil?
130
+ true
131
+ end
132
+
133
+ # Custom attribute writer method checking allowed values (enum).
134
+ # @param [Object] field Object to be assigned
135
+ def field=(field)
136
+ validator = EnumAttributeValidator.new('String', ["BODY", "FROM"])
137
+ unless validator.valid?(field)
138
+ fail ArgumentError, "invalid value for \"field\", must be one of #{validator.allowable_values}."
139
+ end
140
+ @field = field
141
+ end
142
+
143
+ # Custom attribute writer method checking allowed values (enum).
144
+ # @param [Object] should Object to be assigned
145
+ def should=(should)
146
+ validator = EnumAttributeValidator.new('String', ["CONTAIN", "EQUAL"])
147
+ unless validator.valid?(should)
148
+ fail ArgumentError, "invalid value for \"should\", must be one of #{validator.allowable_values}."
149
+ end
150
+ @should = should
151
+ end
152
+
153
+ # Checks equality by comparing each attribute.
154
+ # @param [Object] Object to be compared
155
+ def ==(o)
156
+ return true if self.equal?(o)
157
+ self.class == o.class &&
158
+ field == o.field &&
159
+ should == o.should &&
160
+ value == o.value
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
+ [field, should, value].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