mailslurp_client 15.13.0 → 15.13.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,304 @@
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 WaitForSingleSmsOptions
17
+ attr_accessor :phone_number_id
18
+
19
+ attr_accessor :timeout
20
+
21
+ attr_accessor :unread_only
22
+
23
+ attr_accessor :before
24
+
25
+ attr_accessor :since
26
+
27
+ attr_accessor :sort_direction
28
+
29
+ attr_accessor :delay
30
+
31
+ class EnumAttributeValidator
32
+ attr_reader :datatype
33
+ attr_reader :allowable_values
34
+
35
+ def initialize(datatype, allowable_values)
36
+ @allowable_values = allowable_values.map do |value|
37
+ case datatype.to_s
38
+ when /Integer/i
39
+ value.to_i
40
+ when /Float/i
41
+ value.to_f
42
+ else
43
+ value
44
+ end
45
+ end
46
+ end
47
+
48
+ def valid?(value)
49
+ !value || allowable_values.include?(value)
50
+ end
51
+ end
52
+
53
+ # Attribute mapping from ruby-style variable name to JSON key.
54
+ def self.attribute_map
55
+ {
56
+ :'phone_number_id' => :'phoneNumberId',
57
+ :'timeout' => :'timeout',
58
+ :'unread_only' => :'unreadOnly',
59
+ :'before' => :'before',
60
+ :'since' => :'since',
61
+ :'sort_direction' => :'sortDirection',
62
+ :'delay' => :'delay'
63
+ }
64
+ end
65
+
66
+ # Attribute type mapping.
67
+ def self.openapi_types
68
+ {
69
+ :'phone_number_id' => :'String',
70
+ :'timeout' => :'Integer',
71
+ :'unread_only' => :'Boolean',
72
+ :'before' => :'DateTime',
73
+ :'since' => :'DateTime',
74
+ :'sort_direction' => :'String',
75
+ :'delay' => :'Integer'
76
+ }
77
+ end
78
+
79
+ # List of attributes with nullable: true
80
+ def self.openapi_nullable
81
+ Set.new([
82
+ ])
83
+ end
84
+
85
+ # Initializes the object
86
+ # @param [Hash] attributes Model attributes in the form of hash
87
+ def initialize(attributes = {})
88
+ if (!attributes.is_a?(Hash))
89
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::WaitForSingleSmsOptions` initialize method"
90
+ end
91
+
92
+ # check to see if the attribute exists and convert string to symbol for hash key
93
+ attributes = attributes.each_with_object({}) { |(k, v), h|
94
+ if (!self.class.attribute_map.key?(k.to_sym))
95
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::WaitForSingleSmsOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
96
+ end
97
+ h[k.to_sym] = v
98
+ }
99
+
100
+ if attributes.key?(:'phone_number_id')
101
+ self.phone_number_id = attributes[:'phone_number_id']
102
+ end
103
+
104
+ if attributes.key?(:'timeout')
105
+ self.timeout = attributes[:'timeout']
106
+ end
107
+
108
+ if attributes.key?(:'unread_only')
109
+ self.unread_only = attributes[:'unread_only']
110
+ end
111
+
112
+ if attributes.key?(:'before')
113
+ self.before = attributes[:'before']
114
+ end
115
+
116
+ if attributes.key?(:'since')
117
+ self.since = attributes[:'since']
118
+ end
119
+
120
+ if attributes.key?(:'sort_direction')
121
+ self.sort_direction = attributes[:'sort_direction']
122
+ end
123
+
124
+ if attributes.key?(:'delay')
125
+ self.delay = attributes[:'delay']
126
+ end
127
+ end
128
+
129
+ # Show invalid properties with the reasons. Usually used together with valid?
130
+ # @return Array for valid properties with the reasons
131
+ def list_invalid_properties
132
+ invalid_properties = Array.new
133
+ if @phone_number_id.nil?
134
+ invalid_properties.push('invalid value for "phone_number_id", phone_number_id cannot be nil.')
135
+ end
136
+
137
+ if @timeout.nil?
138
+ invalid_properties.push('invalid value for "timeout", timeout cannot be nil.')
139
+ end
140
+
141
+ invalid_properties
142
+ end
143
+
144
+ # Check to see if the all the properties in the model are valid
145
+ # @return true if the model is valid
146
+ def valid?
147
+ return false if @phone_number_id.nil?
148
+ return false if @timeout.nil?
149
+ sort_direction_validator = EnumAttributeValidator.new('String', ["ASC", "DESC"])
150
+ return false unless sort_direction_validator.valid?(@sort_direction)
151
+ true
152
+ end
153
+
154
+ # Custom attribute writer method checking allowed values (enum).
155
+ # @param [Object] sort_direction Object to be assigned
156
+ def sort_direction=(sort_direction)
157
+ validator = EnumAttributeValidator.new('String', ["ASC", "DESC"])
158
+ unless validator.valid?(sort_direction)
159
+ fail ArgumentError, "invalid value for \"sort_direction\", must be one of #{validator.allowable_values}."
160
+ end
161
+ @sort_direction = sort_direction
162
+ end
163
+
164
+ # Checks equality by comparing each attribute.
165
+ # @param [Object] Object to be compared
166
+ def ==(o)
167
+ return true if self.equal?(o)
168
+ self.class == o.class &&
169
+ phone_number_id == o.phone_number_id &&
170
+ timeout == o.timeout &&
171
+ unread_only == o.unread_only &&
172
+ before == o.before &&
173
+ since == o.since &&
174
+ sort_direction == o.sort_direction &&
175
+ delay == o.delay
176
+ end
177
+
178
+ # @see the `==` method
179
+ # @param [Object] Object to be compared
180
+ def eql?(o)
181
+ self == o
182
+ end
183
+
184
+ # Calculates hash code according to all attributes.
185
+ # @return [Integer] Hash code
186
+ def hash
187
+ [phone_number_id, timeout, unread_only, before, since, sort_direction, delay].hash
188
+ end
189
+
190
+ # Builds the object from hash
191
+ # @param [Hash] attributes Model attributes in the form of hash
192
+ # @return [Object] Returns the model itself
193
+ def self.build_from_hash(attributes)
194
+ new.build_from_hash(attributes)
195
+ end
196
+
197
+ # Builds the object from hash
198
+ # @param [Hash] attributes Model attributes in the form of hash
199
+ # @return [Object] Returns the model itself
200
+ def build_from_hash(attributes)
201
+ return nil unless attributes.is_a?(Hash)
202
+ self.class.openapi_types.each_pair do |key, type|
203
+ if type =~ /\AArray<(.*)>/i
204
+ # check to ensure the input is an array given that the attribute
205
+ # is documented as an array but the input is not
206
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
207
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
208
+ end
209
+ elsif !attributes[self.class.attribute_map[key]].nil?
210
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
211
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
212
+ end
213
+
214
+ self
215
+ end
216
+
217
+ # Deserializes the data based on type
218
+ # @param string type Data type
219
+ # @param string value Value to be deserialized
220
+ # @return [Object] Deserialized data
221
+ def _deserialize(type, value)
222
+ case type.to_sym
223
+ when :DateTime
224
+ DateTime.parse(value)
225
+ when :Date
226
+ Date.parse(value)
227
+ when :String
228
+ value.to_s
229
+ when :Integer
230
+ value.to_i
231
+ when :Float
232
+ value.to_f
233
+ when :Boolean
234
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
235
+ true
236
+ else
237
+ false
238
+ end
239
+ when :Object
240
+ # generic object (usually a Hash), return directly
241
+ value
242
+ when /\AArray<(?<inner_type>.+)>\z/
243
+ inner_type = Regexp.last_match[:inner_type]
244
+ value.map { |v| _deserialize(inner_type, v) }
245
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
246
+ k_type = Regexp.last_match[:k_type]
247
+ v_type = Regexp.last_match[:v_type]
248
+ {}.tap do |hash|
249
+ value.each do |k, v|
250
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
251
+ end
252
+ end
253
+ else # model
254
+ MailSlurpClient.const_get(type).build_from_hash(value)
255
+ end
256
+ end
257
+
258
+ # Returns the string representation of the object
259
+ # @return [String] String presentation of the object
260
+ def to_s
261
+ to_hash.to_s
262
+ end
263
+
264
+ # to_body is an alias to to_hash (backward compatibility)
265
+ # @return [Hash] Returns the object in the form of hash
266
+ def to_body
267
+ to_hash
268
+ end
269
+
270
+ # Returns the object in the form of hash
271
+ # @return [Hash] Returns the object in the form of hash
272
+ def to_hash
273
+ hash = {}
274
+ self.class.attribute_map.each_pair do |attr, param|
275
+ value = self.send(attr)
276
+ if value.nil?
277
+ is_nullable = self.class.openapi_nullable.include?(attr)
278
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
279
+ end
280
+
281
+ hash[param] = _to_hash(value)
282
+ end
283
+ hash
284
+ end
285
+
286
+ # Outputs non-array value in the form of hash
287
+ # For object, use to_hash. Otherwise, just return the value
288
+ # @param [Object] value Any valid value
289
+ # @return [Hash] Returns the value in the form of hash
290
+ def _to_hash(value)
291
+ if value.is_a?(Array)
292
+ value.compact.map { |v| _to_hash(v) }
293
+ elsif value.is_a?(Hash)
294
+ {}.tap do |hash|
295
+ value.each { |k, v| hash[k] = _to_hash(v) }
296
+ end
297
+ elsif value.respond_to? :to_hash
298
+ value.to_hash
299
+ else
300
+ value
301
+ end
302
+ end
303
+ end
304
+ end
@@ -11,5 +11,5 @@ OpenAPI Generator version: 4.3.1
11
11
  =end
12
12
 
13
13
  module MailSlurpClient
14
- VERSION = '15.13.0'
14
+ VERSION = '15.13.3'
15
15
  end
@@ -153,8 +153,8 @@ require 'mailslurp_client/models/sent_email_dto'
153
153
  require 'mailslurp_client/models/sent_email_projection'
154
154
  require 'mailslurp_client/models/set_inbox_favourited_options'
155
155
  require 'mailslurp_client/models/simple_send_email_options'
156
+ require 'mailslurp_client/models/sms_dto'
156
157
  require 'mailslurp_client/models/sms_match_option'
157
- require 'mailslurp_client/models/sms_message'
158
158
  require 'mailslurp_client/models/sms_preview'
159
159
  require 'mailslurp_client/models/sms_projection'
160
160
  require 'mailslurp_client/models/sort'
@@ -164,6 +164,7 @@ require 'mailslurp_client/models/template_projection'
164
164
  require 'mailslurp_client/models/template_variable'
165
165
  require 'mailslurp_client/models/test_new_inbox_forwarder_options'
166
166
  require 'mailslurp_client/models/test_new_inbox_ruleset_options'
167
+ require 'mailslurp_client/models/test_phone_number_options'
167
168
  require 'mailslurp_client/models/thread_projection'
168
169
  require 'mailslurp_client/models/tracking_pixel_dto'
169
170
  require 'mailslurp_client/models/tracking_pixel_projection'
@@ -184,6 +185,7 @@ require 'mailslurp_client/models/verify_email_address_options'
184
185
  require 'mailslurp_client/models/verify_webhook_signature_options'
185
186
  require 'mailslurp_client/models/verify_webhook_signature_results'
186
187
  require 'mailslurp_client/models/wait_for_conditions'
188
+ require 'mailslurp_client/models/wait_for_single_sms_options'
187
189
  require 'mailslurp_client/models/wait_for_sms_conditions'
188
190
  require 'mailslurp_client/models/webhook_bounce_payload'
189
191
  require 'mailslurp_client/models/webhook_bounce_recipient_payload'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mailslurp_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 15.13.0
4
+ version: 15.13.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - mailslurp
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-07-23 00:00:00.000000000 Z
11
+ date: 2022-08-04 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Create emails addresses in Ruby then send and receive real emails and
14
14
  attachments. See https://www.mailslurp.com/ruby/ for full Ruby documentation. Get
@@ -188,8 +188,8 @@ files:
188
188
  - lib/mailslurp_client/models/sent_email_projection.rb
189
189
  - lib/mailslurp_client/models/set_inbox_favourited_options.rb
190
190
  - lib/mailslurp_client/models/simple_send_email_options.rb
191
+ - lib/mailslurp_client/models/sms_dto.rb
191
192
  - lib/mailslurp_client/models/sms_match_option.rb
192
- - lib/mailslurp_client/models/sms_message.rb
193
193
  - lib/mailslurp_client/models/sms_preview.rb
194
194
  - lib/mailslurp_client/models/sms_projection.rb
195
195
  - lib/mailslurp_client/models/sort.rb
@@ -199,6 +199,7 @@ files:
199
199
  - lib/mailslurp_client/models/template_variable.rb
200
200
  - lib/mailslurp_client/models/test_new_inbox_forwarder_options.rb
201
201
  - lib/mailslurp_client/models/test_new_inbox_ruleset_options.rb
202
+ - lib/mailslurp_client/models/test_phone_number_options.rb
202
203
  - lib/mailslurp_client/models/thread_projection.rb
203
204
  - lib/mailslurp_client/models/tracking_pixel_dto.rb
204
205
  - lib/mailslurp_client/models/tracking_pixel_projection.rb
@@ -219,6 +220,7 @@ files:
219
220
  - lib/mailslurp_client/models/verify_webhook_signature_options.rb
220
221
  - lib/mailslurp_client/models/verify_webhook_signature_results.rb
221
222
  - lib/mailslurp_client/models/wait_for_conditions.rb
223
+ - lib/mailslurp_client/models/wait_for_single_sms_options.rb
222
224
  - lib/mailslurp_client/models/wait_for_sms_conditions.rb
223
225
  - lib/mailslurp_client/models/webhook_bounce_payload.rb
224
226
  - lib/mailslurp_client/models/webhook_bounce_recipient_payload.rb