Class: Zm::Client::Message
- Inherits:
-
Base::Object
- Object
- Base::Object
- Zm::Client::Message
- Defined in:
- lib/zm/client/message/message.rb,
lib/zm/client/message/message_flags.rb,
lib/zm/client/message/message_recipients.rb,
lib/zm/client/message/attachments_collection.rb
Overview
class message for account
Defined Under Namespace
Classes: Attachment, AttachmentsCollection, Body, FlagsCollection, Recipient, Recipients
Instance Attribute Summary collapse
-
#attachments ⇒ Object
readonly
Returns the value of attribute attachments.
-
#autoSendTime ⇒ Object
Returns the value of attribute autoSendTime.
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#d ⇒ Object
Returns the value of attribute d.
-
#f ⇒ Object
Returns the value of attribute f.
-
#fr ⇒ Object
Returns the value of attribute fr.
-
#idnt ⇒ Object
Returns the value of attribute idnt.
-
#mid ⇒ Object
Returns the value of attribute mid.
-
#recipients ⇒ Object
readonly
Returns the value of attribute recipients.
-
#s ⇒ Object
(also: #size)
Returns the value of attribute s.
-
#su ⇒ Object
Returns the value of attribute su.
-
#subject ⇒ Object
Returns the value of attribute subject.
-
#tn ⇒ Object
Returns the value of attribute tn.
Attributes included from MailboxItemConcern
Attributes inherited from Base::Object
Instance Method Summary collapse
- #build_create ⇒ Object
- #build_modify ⇒ Object
- #build_rename(*args) ⇒ Object
- #build_send ⇒ Object
- #build_spam ⇒ Object
- #build_unspam ⇒ Object
- #create!(*args) ⇒ Object
- #date ⇒ Object
- #download(dest_file_path, fmt: 'eml') ⇒ Object
- #flags ⇒ Object
-
#initialize(parent) {|_self| ... } ⇒ Message
constructor
A new instance of Message.
- #jsns_builder ⇒ Object
- #modify!(*args) ⇒ Object
- #read ⇒ Object
- #rename!(*args) ⇒ Object
- #send! ⇒ Object
- #spam! ⇒ Object
- #unspam! ⇒ Object
- #update!(attrs) ⇒ Object
Methods included from MailboxItemConcern
Methods included from RequestMethodsMailbox
Methods included from BelongsToTag
Methods included from BelongsToFolder
#folder, #folder!, #folder=, #move!, #trash!
Methods inherited from Base::Object
#clone, #inspect, #instance_variables_map, #logger, #recorded?, #save!, #to_h, #to_s, #update_attribute
Constructor Details
#initialize(parent) {|_self| ... } ⇒ Message
Returns a new instance of Message.
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/zm/client/message/message.rb', line 17 def initialize(parent) @parent = parent @subject = '' @recipients = Recipients.new @body = Body.new = AttachmentsCollection.new yield(self) if block_given? end |
Instance Attribute Details
#attachments ⇒ Object (readonly)
Returns the value of attribute attachments.
13 14 15 |
# File 'lib/zm/client/message/message.rb', line 13 def end |
#autoSendTime ⇒ Object
Returns the value of attribute autoSendTime.
12 13 14 |
# File 'lib/zm/client/message/message.rb', line 12 def autoSendTime @autoSendTime end |
#body ⇒ Object (readonly)
Returns the value of attribute body.
13 14 15 |
# File 'lib/zm/client/message/message.rb', line 13 def body @body end |
#d ⇒ Object
Returns the value of attribute d.
12 13 14 |
# File 'lib/zm/client/message/message.rb', line 12 def d @d end |
#f ⇒ Object
Returns the value of attribute f.
12 13 14 |
# File 'lib/zm/client/message/message.rb', line 12 def f @f end |
#fr ⇒ Object
Returns the value of attribute fr.
12 13 14 |
# File 'lib/zm/client/message/message.rb', line 12 def fr @fr end |
#idnt ⇒ Object
Returns the value of attribute idnt.
12 13 14 |
# File 'lib/zm/client/message/message.rb', line 12 def idnt @idnt end |
#mid ⇒ Object
Returns the value of attribute mid.
12 13 14 |
# File 'lib/zm/client/message/message.rb', line 12 def mid @mid end |
#recipients ⇒ Object (readonly)
Returns the value of attribute recipients.
13 14 15 |
# File 'lib/zm/client/message/message.rb', line 13 def recipients @recipients end |
#s ⇒ Object Also known as: size
Returns the value of attribute s.
12 13 14 |
# File 'lib/zm/client/message/message.rb', line 12 def s @s end |
#su ⇒ Object
Returns the value of attribute su.
12 13 14 |
# File 'lib/zm/client/message/message.rb', line 12 def su @su end |
#subject ⇒ Object
Returns the value of attribute subject.
12 13 14 |
# File 'lib/zm/client/message/message.rb', line 12 def subject @subject end |
#tn ⇒ Object
Returns the value of attribute tn.
12 13 14 |
# File 'lib/zm/client/message/message.rb', line 12 def tn @tn end |
Instance Method Details
#build_create ⇒ Object
54 55 56 |
# File 'lib/zm/client/message/message.rb', line 54 def build_create raise NotImplementedError end |
#build_modify ⇒ Object
62 63 64 |
# File 'lib/zm/client/message/message.rb', line 62 def build_modify raise NotImplementedError end |
#build_rename(*args) ⇒ Object
85 86 87 |
# File 'lib/zm/client/message/message.rb', line 85 def build_rename(*args) raise NotImplementedError end |
#build_send ⇒ Object
109 110 111 112 |
# File 'lib/zm/client/message/message.rb', line 109 def build_send SoapElement.mail(SoapMailConstants::SEND_MSG_REQUEST) .add_attributes(jsns_builder.to_jsns) end |
#build_spam ⇒ Object
101 102 103 |
# File 'lib/zm/client/message/message.rb', line 101 def build_spam jsns_builder.to_spam end |
#build_unspam ⇒ Object
93 94 95 |
# File 'lib/zm/client/message/message.rb', line 93 def build_unspam jsns_builder.to_unspam end |
#create!(*args) ⇒ Object
50 51 52 |
# File 'lib/zm/client/message/message.rb', line 50 def create!(*args) raise NotImplementedError end |
#date ⇒ Object
38 39 40 41 42 |
# File 'lib/zm/client/message/message.rb', line 38 def date return @date if defined? @date @date = Time.at(d.to_i / 1000) end |
#download(dest_file_path, fmt: 'eml') ⇒ Object
28 29 30 31 |
# File 'lib/zm/client/message/message.rb', line 28 def download(dest_file_path, fmt: 'eml') uploader = @parent.build_uploader uploader.download_file(dest_file_path, id, FolderView::MESSAGE, fmt:) end |
#flags ⇒ Object
44 45 46 47 48 |
# File 'lib/zm/client/message/message.rb', line 44 def flags return @flags if defined? @flags @flags = FlagsCollection.new(self) end |
#jsns_builder ⇒ Object
119 120 121 122 123 |
# File 'lib/zm/client/message/message.rb', line 119 def jsns_builder return @jsns_builder if defined? @jsns_builder @jsns_builder = MessageJsnsBuilder.new(self) end |
#modify!(*args) ⇒ Object
58 59 60 |
# File 'lib/zm/client/message/message.rb', line 58 def modify!(*args) raise NotImplementedError end |
#read ⇒ Object
33 34 35 36 |
# File 'lib/zm/client/message/message.rb', line 33 def read uploader = @parent.build_uploader uploader.read_file(id, FolderView::MESSAGE, fmt: 'eml') end |
#rename!(*args) ⇒ Object
81 82 83 |
# File 'lib/zm/client/message/message.rb', line 81 def rename!(*args) raise NotImplementedError end |
#send! ⇒ Object
105 106 107 |
# File 'lib/zm/client/message/message.rb', line 105 def send! @parent.soap_connector.invoke(build_send) end |
#spam! ⇒ Object
97 98 99 |
# File 'lib/zm/client/message/message.rb', line 97 def spam! @parent.soap_connector.invoke(build_spam) end |
#unspam! ⇒ Object
89 90 91 |
# File 'lib/zm/client/message/message.rb', line 89 def unspam! @parent.soap_connector.invoke(build_unspam) end |
#update!(attrs) ⇒ Object
66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/zm/client/message/message.rb', line 66 def update!(attrs) = i[l rgb color f tn] attrs.reject! { |k| !.include?(k) } attrs.merge!({ op: :update, id: id }) attrs.compact! soap_request = SoapElement.mail(SoapMailConstants::ITEM_ACTION_REQUEST) node_action = SoapElement.create(SoapConstants::ACTION).add_attributes(attrs) soap_request.add_node(node_action) @parent.soap_connector.invoke(soap_request) end |