mailslurp_client 15.17.16 → 15.17.21

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/lib/mailslurp_client/api/inbox_controller_api.rb +183 -0
  3. data/lib/mailslurp_client/api/sms_controller_api.rb +132 -0
  4. data/lib/mailslurp_client/api/tools_controller_api.rb +518 -0
  5. data/lib/mailslurp_client/models/alias_projection.rb +15 -15
  6. data/lib/mailslurp_client/models/attachment_projection.rb +16 -16
  7. data/lib/mailslurp_client/models/bounce_projection.rb +10 -10
  8. data/lib/mailslurp_client/models/connector_projection.rb +15 -15
  9. data/lib/mailslurp_client/models/generate_bimi_record_options.rb +282 -0
  10. data/lib/mailslurp_client/models/generate_bimi_record_results.rb +288 -0
  11. data/lib/mailslurp_client/models/generate_dmarc_record_options.rb +454 -0
  12. data/lib/mailslurp_client/models/generate_dmarc_record_results.rb +288 -0
  13. data/lib/mailslurp_client/models/generate_mta_sts_record_options.rb +329 -0
  14. data/lib/mailslurp_client/models/generate_mta_sts_record_results.rb +316 -0
  15. data/lib/mailslurp_client/models/generate_tls_reporting_record_options.rb +298 -0
  16. data/lib/mailslurp_client/models/generate_tls_reporting_record_results.rb +288 -0
  17. data/lib/mailslurp_client/models/inbox_forwarder_event_projection.rb +11 -11
  18. data/lib/mailslurp_client/models/inbox_replier_event_projection.rb +11 -11
  19. data/lib/mailslurp_client/models/lookup_bimi_domain_options.rb +211 -0
  20. data/lib/mailslurp_client/models/lookup_bimi_domain_results.rb +273 -0
  21. data/lib/mailslurp_client/models/lookup_dmarc_domain_options.rb +211 -0
  22. data/lib/mailslurp_client/models/lookup_dmarc_domain_results.rb +273 -0
  23. data/lib/mailslurp_client/models/lookup_mta_sts_domain_options.rb +211 -0
  24. data/lib/mailslurp_client/models/lookup_mta_sts_domain_results.rb +315 -0
  25. data/lib/mailslurp_client/models/lookup_tls_reporting_domain_options.rb +211 -0
  26. data/lib/mailslurp_client/models/lookup_tls_reporting_domain_results.rb +273 -0
  27. data/lib/mailslurp_client/models/reply_for_sms.rb +206 -0
  28. data/lib/mailslurp_client/models/sent_email_projection.rb +15 -15
  29. data/lib/mailslurp_client/models/sent_sms_dto.rb +351 -0
  30. data/lib/mailslurp_client/models/sms_reply_options.rb +211 -0
  31. data/lib/mailslurp_client/models/thread_projection.rb +16 -16
  32. data/lib/mailslurp_client/models/tracking_pixel_projection.rb +10 -10
  33. data/lib/mailslurp_client/version.rb +1 -1
  34. data/lib/mailslurp_client.rb +20 -0
  35. metadata +22 -2
@@ -0,0 +1,454 @@
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 GenerateDmarcRecordOptions
17
+ attr_accessor :domain
18
+
19
+ attr_accessor :version
20
+
21
+ attr_accessor :policy
22
+
23
+ attr_accessor :subdomain_policy
24
+
25
+ attr_accessor :report_email_address
26
+
27
+ attr_accessor :forensic_email_address
28
+
29
+ attr_accessor :percentage
30
+
31
+ attr_accessor :report_format
32
+
33
+ attr_accessor :seconds_between_reports
34
+
35
+ attr_accessor :adkim
36
+
37
+ attr_accessor :aspf
38
+
39
+ attr_accessor :fo
40
+
41
+ class EnumAttributeValidator
42
+ attr_reader :datatype
43
+ attr_reader :allowable_values
44
+
45
+ def initialize(datatype, allowable_values)
46
+ @allowable_values = allowable_values.map do |value|
47
+ case datatype.to_s
48
+ when /Integer/i
49
+ value.to_i
50
+ when /Float/i
51
+ value.to_f
52
+ else
53
+ value
54
+ end
55
+ end
56
+ end
57
+
58
+ def valid?(value)
59
+ !value || allowable_values.include?(value)
60
+ end
61
+ end
62
+
63
+ # Attribute mapping from ruby-style variable name to JSON key.
64
+ def self.attribute_map
65
+ {
66
+ :'domain' => :'domain',
67
+ :'version' => :'version',
68
+ :'policy' => :'policy',
69
+ :'subdomain_policy' => :'subdomainPolicy',
70
+ :'report_email_address' => :'reportEmailAddress',
71
+ :'forensic_email_address' => :'forensicEmailAddress',
72
+ :'percentage' => :'percentage',
73
+ :'report_format' => :'reportFormat',
74
+ :'seconds_between_reports' => :'secondsBetweenReports',
75
+ :'adkim' => :'adkim',
76
+ :'aspf' => :'aspf',
77
+ :'fo' => :'fo'
78
+ }
79
+ end
80
+
81
+ # Attribute type mapping.
82
+ def self.openapi_types
83
+ {
84
+ :'domain' => :'String',
85
+ :'version' => :'String',
86
+ :'policy' => :'String',
87
+ :'subdomain_policy' => :'String',
88
+ :'report_email_address' => :'Array<String>',
89
+ :'forensic_email_address' => :'Array<String>',
90
+ :'percentage' => :'Integer',
91
+ :'report_format' => :'String',
92
+ :'seconds_between_reports' => :'Integer',
93
+ :'adkim' => :'String',
94
+ :'aspf' => :'String',
95
+ :'fo' => :'String'
96
+ }
97
+ end
98
+
99
+ # List of attributes with nullable: true
100
+ def self.openapi_nullable
101
+ Set.new([
102
+ ])
103
+ end
104
+
105
+ # Initializes the object
106
+ # @param [Hash] attributes Model attributes in the form of hash
107
+ def initialize(attributes = {})
108
+ if (!attributes.is_a?(Hash))
109
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::GenerateDmarcRecordOptions` initialize method"
110
+ end
111
+
112
+ # check to see if the attribute exists and convert string to symbol for hash key
113
+ attributes = attributes.each_with_object({}) { |(k, v), h|
114
+ if (!self.class.attribute_map.key?(k.to_sym))
115
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::GenerateDmarcRecordOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
116
+ end
117
+ h[k.to_sym] = v
118
+ }
119
+
120
+ if attributes.key?(:'domain')
121
+ self.domain = attributes[:'domain']
122
+ end
123
+
124
+ if attributes.key?(:'version')
125
+ self.version = attributes[:'version']
126
+ end
127
+
128
+ if attributes.key?(:'policy')
129
+ self.policy = attributes[:'policy']
130
+ end
131
+
132
+ if attributes.key?(:'subdomain_policy')
133
+ self.subdomain_policy = attributes[:'subdomain_policy']
134
+ end
135
+
136
+ if attributes.key?(:'report_email_address')
137
+ if (value = attributes[:'report_email_address']).is_a?(Array)
138
+ self.report_email_address = value
139
+ end
140
+ end
141
+
142
+ if attributes.key?(:'forensic_email_address')
143
+ if (value = attributes[:'forensic_email_address']).is_a?(Array)
144
+ self.forensic_email_address = value
145
+ end
146
+ end
147
+
148
+ if attributes.key?(:'percentage')
149
+ self.percentage = attributes[:'percentage']
150
+ end
151
+
152
+ if attributes.key?(:'report_format')
153
+ self.report_format = attributes[:'report_format']
154
+ end
155
+
156
+ if attributes.key?(:'seconds_between_reports')
157
+ self.seconds_between_reports = attributes[:'seconds_between_reports']
158
+ end
159
+
160
+ if attributes.key?(:'adkim')
161
+ self.adkim = attributes[:'adkim']
162
+ end
163
+
164
+ if attributes.key?(:'aspf')
165
+ self.aspf = attributes[:'aspf']
166
+ end
167
+
168
+ if attributes.key?(:'fo')
169
+ self.fo = attributes[:'fo']
170
+ end
171
+ end
172
+
173
+ # Show invalid properties with the reasons. Usually used together with valid?
174
+ # @return Array for valid properties with the reasons
175
+ def list_invalid_properties
176
+ invalid_properties = Array.new
177
+ if @domain.nil?
178
+ invalid_properties.push('invalid value for "domain", domain cannot be nil.')
179
+ end
180
+
181
+ if @version.nil?
182
+ invalid_properties.push('invalid value for "version", version cannot be nil.')
183
+ end
184
+
185
+ if @policy.nil?
186
+ invalid_properties.push('invalid value for "policy", policy cannot be nil.')
187
+ end
188
+
189
+ if !@percentage.nil? && @percentage > 100
190
+ invalid_properties.push('invalid value for "percentage", must be smaller than or equal to 100.')
191
+ end
192
+
193
+ if !@percentage.nil? && @percentage < 1
194
+ invalid_properties.push('invalid value for "percentage", must be greater than or equal to 1.')
195
+ end
196
+
197
+ invalid_properties
198
+ end
199
+
200
+ # Check to see if the all the properties in the model are valid
201
+ # @return true if the model is valid
202
+ def valid?
203
+ return false if @domain.nil?
204
+ return false if @version.nil?
205
+ version_validator = EnumAttributeValidator.new('String', ["DMARC1"])
206
+ return false unless version_validator.valid?(@version)
207
+ return false if @policy.nil?
208
+ policy_validator = EnumAttributeValidator.new('String', ["NONE", "QUARANTINE", "REJECT"])
209
+ return false unless policy_validator.valid?(@policy)
210
+ subdomain_policy_validator = EnumAttributeValidator.new('String', ["NONE", "QUARANTINE", "REJECT"])
211
+ return false unless subdomain_policy_validator.valid?(@subdomain_policy)
212
+ return false if !@percentage.nil? && @percentage > 100
213
+ return false if !@percentage.nil? && @percentage < 1
214
+ report_format_validator = EnumAttributeValidator.new('String', ["AFRF"])
215
+ return false unless report_format_validator.valid?(@report_format)
216
+ adkim_validator = EnumAttributeValidator.new('String', ["STRICT", "RELAXED"])
217
+ return false unless adkim_validator.valid?(@adkim)
218
+ aspf_validator = EnumAttributeValidator.new('String', ["STRICT", "RELAXED"])
219
+ return false unless aspf_validator.valid?(@aspf)
220
+ fo_validator = EnumAttributeValidator.new('String', ["FO_0", "FO_1", "FO_D", "FO_S"])
221
+ return false unless fo_validator.valid?(@fo)
222
+ true
223
+ end
224
+
225
+ # Custom attribute writer method checking allowed values (enum).
226
+ # @param [Object] version Object to be assigned
227
+ def version=(version)
228
+ validator = EnumAttributeValidator.new('String', ["DMARC1"])
229
+ unless validator.valid?(version)
230
+ fail ArgumentError, "invalid value for \"version\", must be one of #{validator.allowable_values}."
231
+ end
232
+ @version = version
233
+ end
234
+
235
+ # Custom attribute writer method checking allowed values (enum).
236
+ # @param [Object] policy Object to be assigned
237
+ def policy=(policy)
238
+ validator = EnumAttributeValidator.new('String', ["NONE", "QUARANTINE", "REJECT"])
239
+ unless validator.valid?(policy)
240
+ fail ArgumentError, "invalid value for \"policy\", must be one of #{validator.allowable_values}."
241
+ end
242
+ @policy = policy
243
+ end
244
+
245
+ # Custom attribute writer method checking allowed values (enum).
246
+ # @param [Object] subdomain_policy Object to be assigned
247
+ def subdomain_policy=(subdomain_policy)
248
+ validator = EnumAttributeValidator.new('String', ["NONE", "QUARANTINE", "REJECT"])
249
+ unless validator.valid?(subdomain_policy)
250
+ fail ArgumentError, "invalid value for \"subdomain_policy\", must be one of #{validator.allowable_values}."
251
+ end
252
+ @subdomain_policy = subdomain_policy
253
+ end
254
+
255
+ # Custom attribute writer method with validation
256
+ # @param [Object] percentage Value to be assigned
257
+ def percentage=(percentage)
258
+ if !percentage.nil? && percentage > 100
259
+ fail ArgumentError, 'invalid value for "percentage", must be smaller than or equal to 100.'
260
+ end
261
+
262
+ if !percentage.nil? && percentage < 1
263
+ fail ArgumentError, 'invalid value for "percentage", must be greater than or equal to 1.'
264
+ end
265
+
266
+ @percentage = percentage
267
+ end
268
+
269
+ # Custom attribute writer method checking allowed values (enum).
270
+ # @param [Object] report_format Object to be assigned
271
+ def report_format=(report_format)
272
+ validator = EnumAttributeValidator.new('String', ["AFRF"])
273
+ unless validator.valid?(report_format)
274
+ fail ArgumentError, "invalid value for \"report_format\", must be one of #{validator.allowable_values}."
275
+ end
276
+ @report_format = report_format
277
+ end
278
+
279
+ # Custom attribute writer method checking allowed values (enum).
280
+ # @param [Object] adkim Object to be assigned
281
+ def adkim=(adkim)
282
+ validator = EnumAttributeValidator.new('String', ["STRICT", "RELAXED"])
283
+ unless validator.valid?(adkim)
284
+ fail ArgumentError, "invalid value for \"adkim\", must be one of #{validator.allowable_values}."
285
+ end
286
+ @adkim = adkim
287
+ end
288
+
289
+ # Custom attribute writer method checking allowed values (enum).
290
+ # @param [Object] aspf Object to be assigned
291
+ def aspf=(aspf)
292
+ validator = EnumAttributeValidator.new('String', ["STRICT", "RELAXED"])
293
+ unless validator.valid?(aspf)
294
+ fail ArgumentError, "invalid value for \"aspf\", must be one of #{validator.allowable_values}."
295
+ end
296
+ @aspf = aspf
297
+ end
298
+
299
+ # Custom attribute writer method checking allowed values (enum).
300
+ # @param [Object] fo Object to be assigned
301
+ def fo=(fo)
302
+ validator = EnumAttributeValidator.new('String', ["FO_0", "FO_1", "FO_D", "FO_S"])
303
+ unless validator.valid?(fo)
304
+ fail ArgumentError, "invalid value for \"fo\", must be one of #{validator.allowable_values}."
305
+ end
306
+ @fo = fo
307
+ end
308
+
309
+ # Checks equality by comparing each attribute.
310
+ # @param [Object] Object to be compared
311
+ def ==(o)
312
+ return true if self.equal?(o)
313
+ self.class == o.class &&
314
+ domain == o.domain &&
315
+ version == o.version &&
316
+ policy == o.policy &&
317
+ subdomain_policy == o.subdomain_policy &&
318
+ report_email_address == o.report_email_address &&
319
+ forensic_email_address == o.forensic_email_address &&
320
+ percentage == o.percentage &&
321
+ report_format == o.report_format &&
322
+ seconds_between_reports == o.seconds_between_reports &&
323
+ adkim == o.adkim &&
324
+ aspf == o.aspf &&
325
+ fo == o.fo
326
+ end
327
+
328
+ # @see the `==` method
329
+ # @param [Object] Object to be compared
330
+ def eql?(o)
331
+ self == o
332
+ end
333
+
334
+ # Calculates hash code according to all attributes.
335
+ # @return [Integer] Hash code
336
+ def hash
337
+ [domain, version, policy, subdomain_policy, report_email_address, forensic_email_address, percentage, report_format, seconds_between_reports, adkim, aspf, fo].hash
338
+ end
339
+
340
+ # Builds the object from hash
341
+ # @param [Hash] attributes Model attributes in the form of hash
342
+ # @return [Object] Returns the model itself
343
+ def self.build_from_hash(attributes)
344
+ new.build_from_hash(attributes)
345
+ end
346
+
347
+ # Builds the object from hash
348
+ # @param [Hash] attributes Model attributes in the form of hash
349
+ # @return [Object] Returns the model itself
350
+ def build_from_hash(attributes)
351
+ return nil unless attributes.is_a?(Hash)
352
+ self.class.openapi_types.each_pair do |key, type|
353
+ if type =~ /\AArray<(.*)>/i
354
+ # check to ensure the input is an array given that the attribute
355
+ # is documented as an array but the input is not
356
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
357
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
358
+ end
359
+ elsif !attributes[self.class.attribute_map[key]].nil?
360
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
361
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
362
+ end
363
+
364
+ self
365
+ end
366
+
367
+ # Deserializes the data based on type
368
+ # @param string type Data type
369
+ # @param string value Value to be deserialized
370
+ # @return [Object] Deserialized data
371
+ def _deserialize(type, value)
372
+ case type.to_sym
373
+ when :DateTime
374
+ DateTime.parse(value)
375
+ when :Date
376
+ Date.parse(value)
377
+ when :String
378
+ value.to_s
379
+ when :Integer
380
+ value.to_i
381
+ when :Float
382
+ value.to_f
383
+ when :Boolean
384
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
385
+ true
386
+ else
387
+ false
388
+ end
389
+ when :Object
390
+ # generic object (usually a Hash), return directly
391
+ value
392
+ when /\AArray<(?<inner_type>.+)>\z/
393
+ inner_type = Regexp.last_match[:inner_type]
394
+ value.map { |v| _deserialize(inner_type, v) }
395
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
396
+ k_type = Regexp.last_match[:k_type]
397
+ v_type = Regexp.last_match[:v_type]
398
+ {}.tap do |hash|
399
+ value.each do |k, v|
400
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
401
+ end
402
+ end
403
+ else # model
404
+ MailSlurpClient.const_get(type).build_from_hash(value)
405
+ end
406
+ end
407
+
408
+ # Returns the string representation of the object
409
+ # @return [String] String presentation of the object
410
+ def to_s
411
+ to_hash.to_s
412
+ end
413
+
414
+ # to_body is an alias to to_hash (backward compatibility)
415
+ # @return [Hash] Returns the object in the form of hash
416
+ def to_body
417
+ to_hash
418
+ end
419
+
420
+ # Returns the object in the form of hash
421
+ # @return [Hash] Returns the object in the form of hash
422
+ def to_hash
423
+ hash = {}
424
+ self.class.attribute_map.each_pair do |attr, param|
425
+ value = self.send(attr)
426
+ if value.nil?
427
+ is_nullable = self.class.openapi_nullable.include?(attr)
428
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
429
+ end
430
+
431
+ hash[param] = _to_hash(value)
432
+ end
433
+ hash
434
+ end
435
+
436
+ # Outputs non-array value in the form of hash
437
+ # For object, use to_hash. Otherwise, just return the value
438
+ # @param [Object] value Any valid value
439
+ # @return [Hash] Returns the value in the form of hash
440
+ def _to_hash(value)
441
+ if value.is_a?(Array)
442
+ value.compact.map { |v| _to_hash(v) }
443
+ elsif value.is_a?(Hash)
444
+ {}.tap do |hash|
445
+ value.each { |k, v| hash[k] = _to_hash(v) }
446
+ end
447
+ elsif value.respond_to? :to_hash
448
+ value.to_hash
449
+ else
450
+ value
451
+ end
452
+ end
453
+ end
454
+ end