Class: AsposeEmailCloud::EmailDto

Inherits:
Object
  • Object
show all
Defined in:
lib/aspose-email-cloud/models/email_dto.rb

Overview

Email message representation.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(alternate_views: nil, attachments: nil, bcc: nil, body: nil, body_encoding: nil, body_type: nil, cc: nil, date: nil, delivery_notification_options: nil, from: nil, headers: nil, html_body: nil, html_body_text: nil, is_body_html: nil, is_draft: nil, is_encrypted: nil, is_signed: nil, linked_resources: nil, message_id: nil, original_is_tnef: nil, preferred_text_encoding: nil, priority: nil, read_receipt_to: nil, reply_to_list: nil, reverse_path: nil, sender: nil, sensitivity: nil, subject: nil, subject_encoding: nil, time_zone_offset: nil, to: nil, x_mailer: nil, epilogue: nil, preamble: nil) ⇒ EmailDto

Initializes the object

Parameters:

  • alternate_views (Array<AlternateView>) (defaults to: nil)

    Collection of alternate views of message.

  • attachments (Array<Attachment>) (defaults to: nil)

    Email message attachments.

  • bcc (Array<MailAddress>) (defaults to: nil)

    BCC recipients.

  • body (String) (defaults to: nil)

    Email message body as plain text.

  • body_encoding (String) (defaults to: nil)

    Body encoding.

  • body_type (String) (defaults to: nil)

    The content type of message body. Enum, available values: PlainText, Html, Rtf

  • cc (Array<MailAddress>) (defaults to: nil)

    CC recipients.

  • date (DateTime) (defaults to: nil)

    Message date.

  • delivery_notification_options (Array<String>) (defaults to: nil)

    Delivery notifications. Items: Email delivery notification options. Enum, available values: Delay, Never, None, OnFailure, OnSuccess

  • from (MailAddress) (defaults to: nil)

    From address.

  • headers (Hash<String, String>) (defaults to: nil)

    Document headers.

  • html_body (String) (defaults to: nil)

    HTML body.

  • html_body_text (String) (defaults to: nil)

    Html body as plain text. Read only.

  • is_body_html (BOOLEAN) (defaults to: nil)

    Indicates whether the message body is in Html.

  • is_draft (BOOLEAN) (defaults to: nil)

    Indicates whether or not a message has been sent.

  • is_encrypted (BOOLEAN) (defaults to: nil)

    Indicates whether the message is encrypted. Read only.

  • is_signed (BOOLEAN) (defaults to: nil)

    Indicates whether the message is signed. Read only.

  • linked_resources (Array<LinkedResource>) (defaults to: nil)

    Linked resources of message.

  • message_id (String) (defaults to: nil)

    Message id.

  • original_is_tnef (BOOLEAN) (defaults to: nil)

    Indicates whether original EML message is in TNEF format. Read only.

  • preferred_text_encoding (String) (defaults to: nil)

    Preferred encoding.

  • priority (String) (defaults to: nil)

    Email priority status. Enum, available values: High, Low, Normal

  • read_receipt_to (Array<MailAddress>) (defaults to: nil)

    Read receipt addresses.

  • reply_to_list (Array<MailAddress>) (defaults to: nil)

    The list of addresses to reply to for the mail message.

  • reverse_path (MailAddress) (defaults to: nil)

    ReversePath address.

  • sender (MailAddress) (defaults to: nil)

    Sender address.

  • sensitivity (String) (defaults to: nil)

    Specifies the sensitivity of a MailMessage. Enum, available values: None, Normal, Personal, Private, CompanyConfidential

  • subject (String) (defaults to: nil)

    Message subject.

  • subject_encoding (String) (defaults to: nil)

    Subject encoding.

  • time_zone_offset (Integer) (defaults to: nil)

    Coordinated Universal Time (UTC) offset for the message dates. This property defines the time zone difference, between the local time and UTC represented as count of ticks (10 000 per millisecond).

  • to (Array<MailAddress>) (defaults to: nil)

    The address collection that contains the recipients of message.

  • x_mailer (String) (defaults to: nil)

    The X-Mailer the software that created the e-mail message.

  • epilogue (String) (defaults to: nil)

    Gets or sets an epilogue text. It is located after the last boundary.

  • preamble (String) (defaults to: nil)

    Gets or sets a preamble text. It is located before the first boundary and generally includes an explanatory note to non-MIME conformant readers.



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
# File 'lib/aspose-email-cloud/models/email_dto.rb', line 248

def initialize(
  alternate_views: nil,
  attachments: nil,
  bcc: nil,
  body: nil,
  body_encoding: nil,
  body_type: nil,
  cc: nil,
  date: nil,
  delivery_notification_options: nil,
  from: nil,
  headers: nil,
  html_body: nil,
  html_body_text: nil,
  is_body_html: nil,
  is_draft: nil,
  is_encrypted: nil,
  is_signed: nil,
  linked_resources: nil,
  message_id: nil,
  original_is_tnef: nil,
  preferred_text_encoding: nil,
  priority: nil,
  read_receipt_to: nil,
  reply_to_list: nil,
  reverse_path: nil,
  sender: nil,
  sensitivity: nil,
  subject: nil,
  subject_encoding: nil,
  time_zone_offset: nil,
  to: nil,
  x_mailer: nil,
  epilogue: nil,
  preamble: nil)
  self.alternate_views = alternate_views if alternate_views
  self.attachments = attachments if attachments
  self.bcc = bcc if bcc
  self.body = body if body
  self.body_encoding = body_encoding if body_encoding
  self.body_type = body_type if body_type
  self.cc = cc if cc
  self.date = date if date
  self.delivery_notification_options = delivery_notification_options if delivery_notification_options
  self.from = from if from
  self.headers = headers if headers
  self.html_body = html_body if html_body
  self.html_body_text = html_body_text if html_body_text
  self.is_body_html = is_body_html if is_body_html
  self.is_draft = is_draft if is_draft
  self.is_encrypted = is_encrypted if is_encrypted
  self.is_signed = is_signed if is_signed
  self.linked_resources = linked_resources if linked_resources
  self.message_id = message_id if message_id
  self.original_is_tnef = original_is_tnef if original_is_tnef
  self.preferred_text_encoding = preferred_text_encoding if preferred_text_encoding
  self.priority = priority if priority
  self.read_receipt_to = read_receipt_to if read_receipt_to
  self.reply_to_list = reply_to_list if reply_to_list
  self.reverse_path = reverse_path if reverse_path
  self.sender = sender if sender
  self.sensitivity = sensitivity if sensitivity
  self.subject = subject if subject
  self.subject_encoding = subject_encoding if subject_encoding
  self.time_zone_offset = time_zone_offset if time_zone_offset
  self.to = to if to
  self.x_mailer = x_mailer if x_mailer
  self.epilogue = epilogue if epilogue
  self.preamble = preamble if preamble
end

Instance Attribute Details

#alternate_viewsArray<AlternateView>

Collection of alternate views of message.

Returns:



33
34
35
# File 'lib/aspose-email-cloud/models/email_dto.rb', line 33

def alternate_views
  @alternate_views
end

#attachmentsArray<Attachment>

Email message attachments.

Returns:



36
37
38
# File 'lib/aspose-email-cloud/models/email_dto.rb', line 36

def attachments
  @attachments
end

#bccArray<MailAddress>

BCC recipients.

Returns:



39
40
41
# File 'lib/aspose-email-cloud/models/email_dto.rb', line 39

def bcc
  @bcc
end

#bodyString

Email message body as plain text.

Returns:

  • (String)


42
43
44
# File 'lib/aspose-email-cloud/models/email_dto.rb', line 42

def body
  @body
end

#body_encodingString

Body encoding.

Returns:

  • (String)


45
46
47
# File 'lib/aspose-email-cloud/models/email_dto.rb', line 45

def body_encoding
  @body_encoding
end

#body_typeString

The content type of message body. Enum, available values: PlainText, Html, Rtf

Returns:

  • (String)


48
49
50
# File 'lib/aspose-email-cloud/models/email_dto.rb', line 48

def body_type
  @body_type
end

#ccArray<MailAddress>

CC recipients.

Returns:



51
52
53
# File 'lib/aspose-email-cloud/models/email_dto.rb', line 51

def cc
  @cc
end

#dateDateTime

Message date.

Returns:

  • (DateTime)


54
55
56
# File 'lib/aspose-email-cloud/models/email_dto.rb', line 54

def date
  @date
end

#delivery_notification_optionsArray<String>

Delivery notifications. Items: Email delivery notification options. Enum, available values: Delay, Never, None, OnFailure, OnSuccess

Returns:

  • (Array<String>)


57
58
59
# File 'lib/aspose-email-cloud/models/email_dto.rb', line 57

def delivery_notification_options
  @delivery_notification_options
end

#epilogueString

Gets or sets an epilogue text. It is located after the last boundary.

Returns:

  • (String)


129
130
131
# File 'lib/aspose-email-cloud/models/email_dto.rb', line 129

def epilogue
  @epilogue
end

#fromMailAddress

From address.

Returns:



60
61
62
# File 'lib/aspose-email-cloud/models/email_dto.rb', line 60

def from
  @from
end

#headersHash<String, String>

Document headers.

Returns:

  • (Hash<String, String>)


63
64
65
# File 'lib/aspose-email-cloud/models/email_dto.rb', line 63

def headers
  @headers
end

#html_bodyString

HTML body.

Returns:

  • (String)


66
67
68
# File 'lib/aspose-email-cloud/models/email_dto.rb', line 66

def html_body
  @html_body
end

#html_body_textString

Html body as plain text. Read only.

Returns:

  • (String)


69
70
71
# File 'lib/aspose-email-cloud/models/email_dto.rb', line 69

def html_body_text
  @html_body_text
end

#is_body_htmlBOOLEAN

Indicates whether the message body is in Html.

Returns:

  • (BOOLEAN)


72
73
74
# File 'lib/aspose-email-cloud/models/email_dto.rb', line 72

def is_body_html
  @is_body_html
end

#is_draftBOOLEAN

Indicates whether or not a message has been sent.

Returns:

  • (BOOLEAN)


75
76
77
# File 'lib/aspose-email-cloud/models/email_dto.rb', line 75

def is_draft
  @is_draft
end

#is_encryptedBOOLEAN

Indicates whether the message is encrypted. Read only.

Returns:

  • (BOOLEAN)


78
79
80
# File 'lib/aspose-email-cloud/models/email_dto.rb', line 78

def is_encrypted
  @is_encrypted
end

#is_signedBOOLEAN

Indicates whether the message is signed. Read only.

Returns:

  • (BOOLEAN)


81
82
83
# File 'lib/aspose-email-cloud/models/email_dto.rb', line 81

def is_signed
  @is_signed
end

#linked_resourcesArray<LinkedResource>

Linked resources of message.

Returns:



84
85
86
# File 'lib/aspose-email-cloud/models/email_dto.rb', line 84

def linked_resources
  @linked_resources
end

#message_idString

Message id.

Returns:

  • (String)


87
88
89
# File 'lib/aspose-email-cloud/models/email_dto.rb', line 87

def message_id
  @message_id
end

#original_is_tnefBOOLEAN

Indicates whether original EML message is in TNEF format. Read only.

Returns:

  • (BOOLEAN)


90
91
92
# File 'lib/aspose-email-cloud/models/email_dto.rb', line 90

def original_is_tnef
  @original_is_tnef
end

#preambleString

Gets or sets a preamble text. It is located before the first boundary and generally includes an explanatory note to non-MIME conformant readers.

Returns:

  • (String)


132
133
134
# File 'lib/aspose-email-cloud/models/email_dto.rb', line 132

def preamble
  @preamble
end

#preferred_text_encodingString

Preferred encoding.

Returns:

  • (String)


93
94
95
# File 'lib/aspose-email-cloud/models/email_dto.rb', line 93

def preferred_text_encoding
  @preferred_text_encoding
end

#priorityString

Email priority status. Enum, available values: High, Low, Normal

Returns:

  • (String)


96
97
98
# File 'lib/aspose-email-cloud/models/email_dto.rb', line 96

def priority
  @priority
end

#read_receipt_toArray<MailAddress>

Read receipt addresses.

Returns:



99
100
101
# File 'lib/aspose-email-cloud/models/email_dto.rb', line 99

def read_receipt_to
  @read_receipt_to
end

#reply_to_listArray<MailAddress>

The list of addresses to reply to for the mail message.

Returns:



102
103
104
# File 'lib/aspose-email-cloud/models/email_dto.rb', line 102

def reply_to_list
  @reply_to_list
end

#reverse_pathMailAddress

ReversePath address.

Returns:



105
106
107
# File 'lib/aspose-email-cloud/models/email_dto.rb', line 105

def reverse_path
  @reverse_path
end

#senderMailAddress

Sender address.

Returns:



108
109
110
# File 'lib/aspose-email-cloud/models/email_dto.rb', line 108

def sender
  @sender
end

#sensitivityString

Specifies the sensitivity of a MailMessage. Enum, available values: None, Normal, Personal, Private, CompanyConfidential

Returns:

  • (String)


111
112
113
# File 'lib/aspose-email-cloud/models/email_dto.rb', line 111

def sensitivity
  @sensitivity
end

#subjectString

Message subject.

Returns:

  • (String)


114
115
116
# File 'lib/aspose-email-cloud/models/email_dto.rb', line 114

def subject
  @subject
end

#subject_encodingString

Subject encoding.

Returns:

  • (String)


117
118
119
# File 'lib/aspose-email-cloud/models/email_dto.rb', line 117

def subject_encoding
  @subject_encoding
end

#time_zone_offsetInteger

Coordinated Universal Time (UTC) offset for the message dates. This property defines the time zone difference, between the local time and UTC represented as count of ticks (10 000 per millisecond).

Returns:

  • (Integer)


120
121
122
# File 'lib/aspose-email-cloud/models/email_dto.rb', line 120

def time_zone_offset
  @time_zone_offset
end

#toArray<MailAddress>

The address collection that contains the recipients of message.

Returns:



123
124
125
# File 'lib/aspose-email-cloud/models/email_dto.rb', line 123

def to
  @to
end

#x_mailerString

The X-Mailer the software that created the e-mail message.

Returns:

  • (String)


126
127
128
# File 'lib/aspose-email-cloud/models/email_dto.rb', line 126

def x_mailer
  @x_mailer
end

Class Method Details

.attribute_mapObject

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



134
135
136
137
138
139
140
141
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
# File 'lib/aspose-email-cloud/models/email_dto.rb', line 134

def self.attribute_map
  {
    :'alternate_views' => :'alternateViews',
    :'attachments' => :'attachments',
    :'bcc' => :'bcc',
    :'body' => :'body',
    :'body_encoding' => :'bodyEncoding',
    :'body_type' => :'bodyType',
    :'cc' => :'cc',
    :'date' => :'date',
    :'delivery_notification_options' => :'deliveryNotificationOptions',
    :'from' => :'from',
    :'headers' => :'headers',
    :'html_body' => :'htmlBody',
    :'html_body_text' => :'htmlBodyText',
    :'is_body_html' => :'isBodyHtml',
    :'is_draft' => :'isDraft',
    :'is_encrypted' => :'isEncrypted',
    :'is_signed' => :'isSigned',
    :'linked_resources' => :'linkedResources',
    :'message_id' => :'messageId',
    :'original_is_tnef' => :'originalIsTnef',
    :'preferred_text_encoding' => :'preferredTextEncoding',
    :'priority' => :'priority',
    :'read_receipt_to' => :'readReceiptTo',
    :'reply_to_list' => :'replyToList',
    :'reverse_path' => :'reversePath',
    :'sender' => :'sender',
    :'sensitivity' => :'sensitivity',
    :'subject' => :'subject',
    :'subject_encoding' => :'subjectEncoding',
    :'time_zone_offset' => :'timeZoneOffset',
    :'to' => :'to',
    :'x_mailer' => :'xMailer',
    :'epilogue' => :'epilogue',
    :'preamble' => :'preamble'
  }
end

.swagger_typesObject

Attribute type mapping.



174
175
176
177
178
179
180
181
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
# File 'lib/aspose-email-cloud/models/email_dto.rb', line 174

def self.swagger_types
  {
    :'alternate_views' => :'Array<AlternateView>',
    :'attachments' => :'Array<Attachment>',
    :'bcc' => :'Array<MailAddress>',
    :'body' => :'String',
    :'body_encoding' => :'String',
    :'body_type' => :'String',
    :'cc' => :'Array<MailAddress>',
    :'date' => :'DateTime',
    :'delivery_notification_options' => :'Array<String>',
    :'from' => :'MailAddress',
    :'headers' => :'Hash<String, String>',
    :'html_body' => :'String',
    :'html_body_text' => :'String',
    :'is_body_html' => :'BOOLEAN',
    :'is_draft' => :'BOOLEAN',
    :'is_encrypted' => :'BOOLEAN',
    :'is_signed' => :'BOOLEAN',
    :'linked_resources' => :'Array<LinkedResource>',
    :'message_id' => :'String',
    :'original_is_tnef' => :'BOOLEAN',
    :'preferred_text_encoding' => :'String',
    :'priority' => :'String',
    :'read_receipt_to' => :'Array<MailAddress>',
    :'reply_to_list' => :'Array<MailAddress>',
    :'reverse_path' => :'MailAddress',
    :'sender' => :'MailAddress',
    :'sensitivity' => :'String',
    :'subject' => :'String',
    :'subject_encoding' => :'String',
    :'time_zone_offset' => :'Integer',
    :'to' => :'Array<MailAddress>',
    :'x_mailer' => :'String',
    :'epilogue' => :'String',
    :'preamble' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
# File 'lib/aspose-email-cloud/models/email_dto.rb', line 379

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      alternate_views == o.alternate_views &&
      attachments == o.attachments &&
      bcc == o.bcc &&
      body == o.body &&
      body_encoding == o.body_encoding &&
      body_type == o.body_type &&
      cc == o.cc &&
      date == o.date &&
      delivery_notification_options == o.delivery_notification_options &&
      from == o.from &&
      headers == o.headers &&
      html_body == o.html_body &&
      html_body_text == o.html_body_text &&
      is_body_html == o.is_body_html &&
      is_draft == o.is_draft &&
      is_encrypted == o.is_encrypted &&
      is_signed == o.is_signed &&
      linked_resources == o.linked_resources &&
      message_id == o.message_id &&
      original_is_tnef == o.original_is_tnef &&
      preferred_text_encoding == o.preferred_text_encoding &&
      priority == o.priority &&
      read_receipt_to == o.read_receipt_to &&
      reply_to_list == o.reply_to_list &&
      reverse_path == o.reverse_path &&
      sender == o.sender &&
      sensitivity == o.sensitivity &&
      subject == o.subject &&
      subject_encoding == o.subject_encoding &&
      time_zone_offset == o.time_zone_offset &&
      to == o.to &&
      x_mailer == o.x_mailer &&
      epilogue == o.epilogue &&
      preamble == o.preamble
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



456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
# File 'lib/aspose-email-cloud/models/email_dto.rb', line 456

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
    sub_type = value[:type] || value[:discriminator] || type
    if AsposeEmailCloud.const_defined?(sub_type)
      type = sub_type
    end
    temp_model = AsposeEmailCloud.const_get(type).new
    temp_model.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



526
527
528
529
530
531
532
533
534
535
536
537
538
# File 'lib/aspose-email-cloud/models/email_dto.rb', line 526

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



433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
# File 'lib/aspose-email-cloud/models/email_dto.rb', line 433

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.swagger_types.each_pair do |key, type|
    attribute_key = self.class.attribute_map[key]
    attribute_key = (attribute_key[0, 1].downcase + attribute_key[1..-1]).to_sym
    if type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the the attribute
      # is documented as an array but the input is not
      if attributes[attribute_key].is_a?(Array)
        self.send("#{key}=", attributes[attribute_key].map { |v| _deserialize($1, v) })
      end
    elsif !attributes[attribute_key].nil?
      self.send("#{key}=", _deserialize(type, attributes[attribute_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


420
421
422
# File 'lib/aspose-email-cloud/models/email_dto.rb', line 420

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



426
427
428
# File 'lib/aspose-email-cloud/models/email_dto.rb', line 426

def hash
  [alternate_views, attachments, bcc, body, body_encoding, body_type, cc, date, delivery_notification_options, from, headers, html_body, html_body_text, is_body_html, is_draft, is_encrypted, is_signed, linked_resources, message_id, original_is_tnef, preferred_text_encoding, priority, read_receipt_to, reply_to_list, reverse_path, sender, sensitivity, subject, subject_encoding, time_zone_offset, to, x_mailer, epilogue, preamble].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



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
# File 'lib/aspose-email-cloud/models/email_dto.rb', line 321

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

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

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

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

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

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

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

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

  if @sensitivity.nil?
    invalid_properties.push('invalid value for "sensitivity", sensitivity 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



506
507
508
# File 'lib/aspose-email-cloud/models/email_dto.rb', line 506

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



512
513
514
515
516
517
518
519
520
# File 'lib/aspose-email-cloud/models/email_dto.rb', line 512

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    next if value.nil?
    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



500
501
502
# File 'lib/aspose-email-cloud/models/email_dto.rb', line 500

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



364
365
366
367
368
369
370
371
372
373
374
375
# File 'lib/aspose-email-cloud/models/email_dto.rb', line 364

def valid?
  return false if @body_type.nil?
  return false if @date.nil?
  return false if @is_body_html.nil?
  return false if @is_draft.nil?
  return false if @is_encrypted.nil?
  return false if @is_signed.nil?
  return false if @original_is_tnef.nil?
  return false if @priority.nil?
  return false if @sensitivity.nil?
  true
end