Class: ZimbraRestApi::Account
Instance Attribute Summary
Attributes inherited from ZimbraBase
#zmobject
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from ZimbraBase
#initialize
included
Class Method Details
.create(params = {}) ⇒ Object
34
35
36
37
38
39
|
# File 'lib/models/account.rb', line 34
def self.create(params = {})
name = params.delete('name')
password = params.delete('password')
result = Zimbra::Account.create(name, password, params)
new(result)
end
|
.mailbox(account_id) ⇒ Object
41
42
43
|
# File 'lib/models/account.rb', line 41
def self.mailbox(account_id)
Zimbra::Account.mailbox account_id
end
|
Instance Method Details
#add_alias(alias_name) ⇒ Object
5
6
7
|
# File 'lib/models/account.rb', line 5
def add_alias(alias_name)
zmobject.add_alias(alias_name)
end
|
#delegated_auth_token ⇒ Object
9
10
11
|
# File 'lib/models/account.rb', line 9
def delegated_auth_token
zmobject.delegated_auth_token
end
|
#disable_archive ⇒ Object
13
14
15
|
# File 'lib/models/account.rb', line 13
def disable_archive
zmobject.disable_archive
end
|
#enable_archive(cos_id = nil, archive_name = nil) ⇒ Object
17
18
19
|
# File 'lib/models/account.rb', line 17
def enable_archive(cos_id = nil, archive_name = nil)
zmobject.enable_archive(cos_id, archive_name)
end
|
#mailbox ⇒ Object
21
22
23
|
# File 'lib/models/account.rb', line 21
def mailbox
zmobject.mailbox
end
|
#memberships ⇒ Object
25
26
27
28
|
# File 'lib/models/account.rb', line 25
def memberships
results = zmobject.memberships
results.map { |r| {id: r.id, name: r.name, via: r.via} }
end
|
#remove_alias(alias_name) ⇒ Object
30
31
32
|
# File 'lib/models/account.rb', line 30
def remove_alias(alias_name)
zmobject.remove_alias(alias_name)
end
|
#set_password(new_password) ⇒ Object
45
46
47
|
# File 'lib/models/account.rb', line 45
def set_password(new_password)
zmobject.set_password new_password
end
|
#update_attributes(attributes) ⇒ Object
49
50
51
52
53
54
55
|
# File 'lib/models/account.rb', line 49
def update_attributes(attributes)
if attributes['password']
set_password(attributes.delete('password'))
end
attributes.delete('password')
super
end
|