Class: Zm::Client::MailboxPrefsCollection
- Inherits:
-
Object
- Object
- Zm::Client::MailboxPrefsCollection
- Defined in:
- lib/zm/client/base/mailbox_prefs_collection.rb
Instance Method Summary collapse
- #all ⇒ Object (also: #all!)
- #clear ⇒ Object
-
#initialize(parent) ⇒ MailboxPrefsCollection
constructor
A new instance of MailboxPrefsCollection.
- #preferences(*entries) ⇒ Object
- #update!(hash) ⇒ Object
Constructor Details
#initialize(parent) ⇒ MailboxPrefsCollection
Returns a new instance of MailboxPrefsCollection.
6 7 8 9 |
# File 'lib/zm/client/base/mailbox_prefs_collection.rb', line 6 def initialize(parent) @parent = parent @preferences = [] end |
Instance Method Details
#all ⇒ Object Also known as: all!
11 12 13 |
# File 'lib/zm/client/base/mailbox_prefs_collection.rb', line 11 def all build_response end |
#clear ⇒ Object
16 17 18 |
# File 'lib/zm/client/base/mailbox_prefs_collection.rb', line 16 def clear reset_query_params end |
#preferences(*entries) ⇒ Object
20 21 22 23 24 |
# File 'lib/zm/client/base/mailbox_prefs_collection.rb', line 20 def preferences(*entries) entries.flatten! @preferences += entries self end |
#update!(hash) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/zm/client/base/mailbox_prefs_collection.rb', line 26 def update!(hash) # The JSON version is different: # { # ModifyPrefsRequest: { # "_attrs": { # "prefName1": "prefValue1", # "prefName2": "prefValue2" # "+nameOfMulitValuedPref3": "addedPrefValue3", # "-nameOfMulitValuedPref4": "removedPrefValue4", # "nameOfMulitValuedPref5": ["prefValue5one","prefValue5two"], # ... # }, # _jsns: "urn:zimbraAccount" # } # } req = { _attrs: hash } soap_request = SoapElement.account(SoapAccountConstants::MODIFY_PREFS_REQUEST).add_attributes(req) @parent.soap_connector.invoke(soap_request) end |