Class: MailSlurpClient::SentEmailDto

Inherits:
Object
  • Object
show all
Defined in:
lib/mailslurp_client/models/sent_email_dto.rb

Overview

Sent email details

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ SentEmailDto

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
# File 'lib/mailslurp_client/models/sent_email_dto.rb', line 217

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `MailSlurpClient::SentEmailDto` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!self.class.attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `MailSlurpClient::SentEmailDto`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  if attributes.key?(:'id')
    self.id = attributes[:'id']
  end

  if attributes.key?(:'user_id')
    self.user_id = attributes[:'user_id']
  end

  if attributes.key?(:'inbox_id')
    self.inbox_id = attributes[:'inbox_id']
  end

  if attributes.key?(:'domain_id')
    self.domain_id = attributes[:'domain_id']
  end

  if attributes.key?(:'to')
    if (value = attributes[:'to']).is_a?(Array)
      self.to = value
    end
  end

  if attributes.key?(:'from')
    self.from = attributes[:'from']
  end

  if attributes.key?(:'sender')
    self.sender = attributes[:'sender']
  end

  if attributes.key?(:'recipients')
    self.recipients = attributes[:'recipients']
  end

  if attributes.key?(:'reply_to')
    self.reply_to = attributes[:'reply_to']
  end

  if attributes.key?(:'cc')
    if (value = attributes[:'cc']).is_a?(Array)
      self.cc = value
    end
  end

  if attributes.key?(:'bcc')
    if (value = attributes[:'bcc']).is_a?(Array)
      self.bcc = value
    end
  end

  if attributes.key?(:'attachments')
    if (value = attributes[:'attachments']).is_a?(Array)
      self.attachments = value
    end
  end

  if attributes.key?(:'subject')
    self.subject = attributes[:'subject']
  end

  if attributes.key?(:'body_md5_hash')
    self.body_md5_hash = attributes[:'body_md5_hash']
  end

  if attributes.key?(:'body')
    self.body = attributes[:'body']
  end

  if attributes.key?(:'to_contacts')
    if (value = attributes[:'to_contacts']).is_a?(Array)
      self.to_contacts = value
    end
  end

  if attributes.key?(:'to_group')
    self.to_group = attributes[:'to_group']
  end

  if attributes.key?(:'charset')
    self.charset = attributes[:'charset']
  end

  if attributes.key?(:'is_html')
    self.is_html = attributes[:'is_html']
  end

  if attributes.key?(:'sent_at')
    self.sent_at = attributes[:'sent_at']
  end

  if attributes.key?(:'created_at')
    self.created_at = attributes[:'created_at']
  end

  if attributes.key?(:'pixel_ids')
    if (value = attributes[:'pixel_ids']).is_a?(Array)
      self.pixel_ids = value
    end
  end

  if attributes.key?(:'message_id')
    self.message_id = attributes[:'message_id']
  end

  if attributes.key?(:'message_ids')
    if (value = attributes[:'message_ids']).is_a?(Array)
      self.message_ids = value
    end
  end

  if attributes.key?(:'virtual_send')
    self.virtual_send = attributes[:'virtual_send']
  end

  if attributes.key?(:'template_id')
    self.template_id = attributes[:'template_id']
  end

  if attributes.key?(:'template_variables')
    if (value = attributes[:'template_variables']).is_a?(Hash)
      self.template_variables = value
    end
  end

  if attributes.key?(:'headers')
    if (value = attributes[:'headers']).is_a?(Hash)
      self.headers = value
    end
  end

  if attributes.key?(:'thread_id')
    self.thread_id = attributes[:'thread_id']
  end

  if attributes.key?(:'body_excerpt')
    self.body_excerpt = attributes[:'body_excerpt']
  end

  if attributes.key?(:'text_excerpt')
    self.text_excerpt = attributes[:'text_excerpt']
  end

  if attributes.key?(:'in_reply_to')
    self.in_reply_to = attributes[:'in_reply_to']
  end

  if attributes.key?(:'favourite')
    self.favourite = attributes[:'favourite']
  end

  if attributes.key?(:'html')
    self.html = attributes[:'html']
  end
end

Instance Attribute Details

#attachmentsObject

Array of IDs of attachments that were sent with this email



47
48
49
# File 'lib/mailslurp_client/models/sent_email_dto.rb', line 47

def attachments
  @attachments
end

#bccObject

Returns the value of attribute bcc.



44
45
46
# File 'lib/mailslurp_client/models/sent_email_dto.rb', line 44

def bcc
  @bcc
end

#bodyObject

Sent email body



55
56
57
# File 'lib/mailslurp_client/models/sent_email_dto.rb', line 55

def body
  @body
end

#body_excerptObject

An excerpt of the body of the email message for quick preview. Takes HTML content part if exists falls back to TEXT content part if not



88
89
90
# File 'lib/mailslurp_client/models/sent_email_dto.rb', line 88

def body_excerpt
  @body_excerpt
end

#body_md5_hashObject

MD5 Hash



52
53
54
# File 'lib/mailslurp_client/models/sent_email_dto.rb', line 52

def body_md5_hash
  @body_md5_hash
end

#ccObject

Returns the value of attribute cc.



42
43
44
# File 'lib/mailslurp_client/models/sent_email_dto.rb', line 42

def cc
  @cc
end

#charsetObject

Returns the value of attribute charset.



61
62
63
# File 'lib/mailslurp_client/models/sent_email_dto.rb', line 61

def charset
  @charset
end

#created_atObject

Returns the value of attribute created_at.



67
68
69
# File 'lib/mailslurp_client/models/sent_email_dto.rb', line 67

def created_at
  @created_at
end

#domain_idObject

Domain ID



28
29
30
# File 'lib/mailslurp_client/models/sent_email_dto.rb', line 28

def domain_id
  @domain_id
end

#favouriteObject

Is email favourited



97
98
99
# File 'lib/mailslurp_client/models/sent_email_dto.rb', line 97

def favourite
  @favourite
end

#fromObject

Sent from address



34
35
36
# File 'lib/mailslurp_client/models/sent_email_dto.rb', line 34

def from
  @from
end

#headersObject

Returns the value of attribute headers.



82
83
84
# File 'lib/mailslurp_client/models/sent_email_dto.rb', line 82

def headers
  @headers
end

#htmlObject

Returns the value of attribute html.



99
100
101
# File 'lib/mailslurp_client/models/sent_email_dto.rb', line 99

def html
  @html
end

#idObject

ID of sent email



19
20
21
# File 'lib/mailslurp_client/models/sent_email_dto.rb', line 19

def id
  @id
end

#in_reply_toObject

Parsed value of In-Reply-To header. A Message-ID in a thread.



94
95
96
# File 'lib/mailslurp_client/models/sent_email_dto.rb', line 94

def in_reply_to
  @in_reply_to
end

#inbox_idObject

Inbox ID email was sent from



25
26
27
# File 'lib/mailslurp_client/models/sent_email_dto.rb', line 25

def inbox_id
  @inbox_id
end

#is_htmlObject

Returns the value of attribute is_html.



63
64
65
# File 'lib/mailslurp_client/models/sent_email_dto.rb', line 63

def is_html
  @is_html
end

#message_idObject

RFC 5322 Message-ID header value without angle brackets.



72
73
74
# File 'lib/mailslurp_client/models/sent_email_dto.rb', line 72

def message_id
  @message_id
end

#message_idsObject

Returns the value of attribute message_ids.



74
75
76
# File 'lib/mailslurp_client/models/sent_email_dto.rb', line 74

def message_ids
  @message_ids
end

#pixel_idsObject

Returns the value of attribute pixel_ids.



69
70
71
# File 'lib/mailslurp_client/models/sent_email_dto.rb', line 69

def pixel_ids
  @pixel_ids
end

#recipientsObject

Returns the value of attribute recipients.



38
39
40
# File 'lib/mailslurp_client/models/sent_email_dto.rb', line 38

def recipients
  @recipients
end

#reply_toObject

Returns the value of attribute reply_to.



40
41
42
# File 'lib/mailslurp_client/models/sent_email_dto.rb', line 40

def reply_to
  @reply_to
end

#senderObject

Returns the value of attribute sender.



36
37
38
# File 'lib/mailslurp_client/models/sent_email_dto.rb', line 36

def sender
  @sender
end

#sent_atObject

Returns the value of attribute sent_at.



65
66
67
# File 'lib/mailslurp_client/models/sent_email_dto.rb', line 65

def sent_at
  @sent_at
end

#subjectObject

Returns the value of attribute subject.



49
50
51
# File 'lib/mailslurp_client/models/sent_email_dto.rb', line 49

def subject
  @subject
end

#template_idObject

Returns the value of attribute template_id.



78
79
80
# File 'lib/mailslurp_client/models/sent_email_dto.rb', line 78

def template_id
  @template_id
end

#template_variablesObject

Returns the value of attribute template_variables.



80
81
82
# File 'lib/mailslurp_client/models/sent_email_dto.rb', line 80

def template_variables
  @template_variables
end

#text_excerptObject

An excerpt of the body of the email message for quick preview. Takes TEXT content part if exists



91
92
93
# File 'lib/mailslurp_client/models/sent_email_dto.rb', line 91

def text_excerpt
  @text_excerpt
end

#thread_idObject

MailSlurp thread ID for email chain that enables lookup for In-Reply-To and References fields.



85
86
87
# File 'lib/mailslurp_client/models/sent_email_dto.rb', line 85

def thread_id
  @thread_id
end

#toObject

Recipients email was sent to



31
32
33
# File 'lib/mailslurp_client/models/sent_email_dto.rb', line 31

def to
  @to
end

#to_contactsObject

Returns the value of attribute to_contacts.



57
58
59
# File 'lib/mailslurp_client/models/sent_email_dto.rb', line 57

def to_contacts
  @to_contacts
end

#to_groupObject

Returns the value of attribute to_group.



59
60
61
# File 'lib/mailslurp_client/models/sent_email_dto.rb', line 59

def to_group
  @to_group
end

#user_idObject

User ID



22
23
24
# File 'lib/mailslurp_client/models/sent_email_dto.rb', line 22

def user_id
  @user_id
end

#virtual_sendObject

Returns the value of attribute virtual_send.



76
77
78
# File 'lib/mailslurp_client/models/sent_email_dto.rb', line 76

def virtual_send
  @virtual_send
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# File 'lib/mailslurp_client/models/sent_email_dto.rb', line 102

def self.attribute_map
  {
    :'id' => :'id',
    :'user_id' => :'userId',
    :'inbox_id' => :'inboxId',
    :'domain_id' => :'domainId',
    :'to' => :'to',
    :'from' => :'from',
    :'sender' => :'sender',
    :'recipients' => :'recipients',
    :'reply_to' => :'replyTo',
    :'cc' => :'cc',
    :'bcc' => :'bcc',
    :'attachments' => :'attachments',
    :'subject' => :'subject',
    :'body_md5_hash' => :'bodyMD5Hash',
    :'body' => :'body',
    :'to_contacts' => :'toContacts',
    :'to_group' => :'toGroup',
    :'charset' => :'charset',
    :'is_html' => :'isHTML',
    :'sent_at' => :'sentAt',
    :'created_at' => :'createdAt',
    :'pixel_ids' => :'pixelIds',
    :'message_id' => :'messageId',
    :'message_ids' => :'messageIds',
    :'virtual_send' => :'virtualSend',
    :'template_id' => :'templateId',
    :'template_variables' => :'templateVariables',
    :'headers' => :'headers',
    :'thread_id' => :'threadId',
    :'body_excerpt' => :'bodyExcerpt',
    :'text_excerpt' => :'textExcerpt',
    :'in_reply_to' => :'inReplyTo',
    :'favourite' => :'favourite',
    :'html' => :'html'
  }
end

.build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



479
480
481
# File 'lib/mailslurp_client/models/sent_email_dto.rb', line 479

def self.build_from_hash(attributes)
  new.build_from_hash(attributes)
end

.openapi_nullableObject

List of attributes with nullable: true



182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
# File 'lib/mailslurp_client/models/sent_email_dto.rb', line 182

def self.openapi_nullable
  Set.new([
    :'domain_id',
    :'to',
    :'from',
    :'sender',
    :'recipients',
    :'reply_to',
    :'cc',
    :'bcc',
    :'attachments',
    :'subject',
    :'body_md5_hash',
    :'body',
    :'to_contacts',
    :'to_group',
    :'charset',
    :'is_html',
    :'pixel_ids',
    :'message_id',
    :'message_ids',
    :'virtual_send',
    :'template_id',
    :'template_variables',
    :'headers',
    :'thread_id',
    :'body_excerpt',
    :'text_excerpt',
    :'in_reply_to',
    :'favourite',
  ])
end

.openapi_typesObject

Attribute type mapping.



142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
# File 'lib/mailslurp_client/models/sent_email_dto.rb', line 142

def self.openapi_types
  {
    :'id' => :'String',
    :'user_id' => :'String',
    :'inbox_id' => :'String',
    :'domain_id' => :'String',
    :'to' => :'Array<String>',
    :'from' => :'String',
    :'sender' => :'Sender',
    :'recipients' => :'EmailRecipients',
    :'reply_to' => :'String',
    :'cc' => :'Array<String>',
    :'bcc' => :'Array<String>',
    :'attachments' => :'Array<String>',
    :'subject' => :'String',
    :'body_md5_hash' => :'String',
    :'body' => :'String',
    :'to_contacts' => :'Array<String>',
    :'to_group' => :'String',
    :'charset' => :'String',
    :'is_html' => :'Boolean',
    :'sent_at' => :'DateTime',
    :'created_at' => :'DateTime',
    :'pixel_ids' => :'Array<String>',
    :'message_id' => :'String',
    :'message_ids' => :'Array<String>',
    :'virtual_send' => :'Boolean',
    :'template_id' => :'String',
    :'template_variables' => :'Hash<String, Object>',
    :'headers' => :'Hash<String, String>',
    :'thread_id' => :'String',
    :'body_excerpt' => :'String',
    :'text_excerpt' => :'String',
    :'in_reply_to' => :'String',
    :'favourite' => :'Boolean',
    :'html' => :'Boolean'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
# File 'lib/mailslurp_client/models/sent_email_dto.rb', line 425

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      id == o.id &&
      user_id == o.user_id &&
      inbox_id == o.inbox_id &&
      domain_id == o.domain_id &&
      to == o.to &&
      from == o.from &&
      sender == o.sender &&
      recipients == o.recipients &&
      reply_to == o.reply_to &&
      cc == o.cc &&
      bcc == o.bcc &&
      attachments == o.attachments &&
      subject == o.subject &&
      body_md5_hash == o.body_md5_hash &&
      body == o.body &&
      to_contacts == o.to_contacts &&
      to_group == o.to_group &&
      charset == o.charset &&
      is_html == o.is_html &&
      sent_at == o.sent_at &&
      created_at == o.created_at &&
      pixel_ids == o.pixel_ids &&
      message_id == o.message_id &&
      message_ids == o.message_ids &&
      virtual_send == o.virtual_send &&
      template_id == o.template_id &&
      template_variables == o.template_variables &&
      headers == o.headers &&
      thread_id == o.thread_id &&
      body_excerpt == o.body_excerpt &&
      text_excerpt == o.text_excerpt &&
      in_reply_to == o.in_reply_to &&
      favourite == o.favourite &&
      html == o.html
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
# File 'lib/mailslurp_client/models/sent_email_dto.rb', line 507

def _deserialize(type, value)
  case type.to_sym
  when :DateTime
    DateTime.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :Boolean
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    MailSlurpClient.const_get(type).build_from_hash(value)
  end
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



576
577
578
579
580
581
582
583
584
585
586
587
588
# File 'lib/mailslurp_client/models/sent_email_dto.rb', line 576

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
# File 'lib/mailslurp_client/models/sent_email_dto.rb', line 486

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.openapi_types.each_pair do |key, type|
    if type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
    end # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


466
467
468
# File 'lib/mailslurp_client/models/sent_email_dto.rb', line 466

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



472
473
474
# File 'lib/mailslurp_client/models/sent_email_dto.rb', line 472

def hash
  [id, user_id, inbox_id, domain_id, to, from, sender, recipients, reply_to, cc, bcc, attachments, subject, body_md5_hash, body, to_contacts, to_group, charset, is_html, sent_at, created_at, pixel_ids, message_id, message_ids, virtual_send, template_id, template_variables, headers, thread_id, body_excerpt, text_excerpt, in_reply_to, favourite, html].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
# File 'lib/mailslurp_client/models/sent_email_dto.rb', line 387

def list_invalid_properties
  invalid_properties = Array.new
  if @id.nil?
    invalid_properties.push('invalid value for "id", id cannot be nil.')
  end

  if @user_id.nil?
    invalid_properties.push('invalid value for "user_id", user_id cannot be nil.')
  end

  if @inbox_id.nil?
    invalid_properties.push('invalid value for "inbox_id", inbox_id cannot be nil.')
  end

  if @sent_at.nil?
    invalid_properties.push('invalid value for "sent_at", sent_at cannot be nil.')
  end

  if @created_at.nil?
    invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
  end

  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



552
553
554
# File 'lib/mailslurp_client/models/sent_email_dto.rb', line 552

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



558
559
560
561
562
563
564
565
566
567
568
569
570
# File 'lib/mailslurp_client/models/sent_email_dto.rb', line 558

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = self.class.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end
    
    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



546
547
548
# File 'lib/mailslurp_client/models/sent_email_dto.rb', line 546

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



414
415
416
417
418
419
420
421
# File 'lib/mailslurp_client/models/sent_email_dto.rb', line 414

def valid?
  return false if @id.nil?
  return false if @user_id.nil?
  return false if @inbox_id.nil?
  return false if @sent_at.nil?
  return false if @created_at.nil?
  true
end