mailslurp_client 15.12.17 → 15.13.2

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