Class: Zm::Client::DistributionList
Overview
objectClass: zimbraDistributionList
Instance Attribute Summary
Attributes inherited from Base::Object
#id, #name, #parent, #token
Instance Method Summary
collapse
#soap_admin_connector
#clone, #initialize, #inspect, #instance_variables_map, #logger, #recorded?, #save!, #to_h, #to_s, #update_attribute
Instance Method Details
#attrs_write ⇒ Object
100
101
102
|
# File 'lib/zm/client/distributionlist/distributionlist.rb', line 100
def attrs_write
@parent.zimbra_attributes.all_distributionlist_attrs_writable_names
end
|
#create! ⇒ Object
34
35
36
37
|
# File 'lib/zm/client/distributionlist/distributionlist.rb', line 34
def create!
resp = sac.invoke(jsns_builder.to_create)
@id = resp[:CreateDistributionListResponse][:dl].first[:id]
end
|
#delete! ⇒ Object
61
62
63
64
|
# File 'lib/zm/client/distributionlist/distributionlist.rb', line 61
def delete!
sac.invoke(jsns_builder.to_delete)
@id = nil
end
|
#external_transport? ⇒ Boolean
82
83
84
85
86
|
# File 'lib/zm/client/distributionlist/distributionlist.rb', line 82
def external_transport?
return nil unless zimbraMailTransport
zimbraMailTransport.start_with?(SoapConstants::SMTP)
end
|
#group? ⇒ Boolean
92
93
94
|
# File 'lib/zm/client/distributionlist/distributionlist.rb', line 92
def group?
zimbraMailStatus == SoapConstants::DISABLED
end
|
#hide_in_gal? ⇒ Boolean
88
89
90
|
# File 'lib/zm/client/distributionlist/distributionlist.rb', line 88
def hide_in_gal?
zimbraHideInGal == SoapConstants::TRUE
end
|
#local_transport ⇒ Object
66
67
68
69
70
|
# File 'lib/zm/client/distributionlist/distributionlist.rb', line 66
def local_transport
raise Zm::Client::ZmError, 'zimbraMailHost is null' if zimbraMailHost.nil?
"lmtp:#{zimbraMailHost}:7025"
end
|
#local_transport! ⇒ Object
72
73
74
|
# File 'lib/zm/client/distributionlist/distributionlist.rb', line 72
def local_transport!
update!(zimbraMailTransport: local_transport)
end
|
#local_transport? ⇒ Boolean
76
77
78
79
80
|
# File 'lib/zm/client/distributionlist/distributionlist.rb', line 76
def local_transport?
return nil unless zimbraMailTransport
zimbraMailTransport.start_with?(SoapConstants::LMTP)
end
|
#mailing_list? ⇒ Boolean
96
97
98
|
# File 'lib/zm/client/distributionlist/distributionlist.rb', line 96
def mailing_list?
zimbraMailStatus == SoapConstants::ENABLED
end
|
#memberships ⇒ Object
26
27
28
|
# File 'lib/zm/client/distributionlist/distributionlist.rb', line 26
def memberships
@memberships ||= DlsMembershipCollection.new(self)
end
|
#modify! ⇒ Object
39
40
41
42
|
# File 'lib/zm/client/distributionlist/distributionlist.rb', line 39
def modify!
sac.invoke(jsns_builder.to_update)
true
end
|
#rename!(new_name) ⇒ Object
56
57
58
59
|
# File 'lib/zm/client/distributionlist/distributionlist.rb', line 56
def rename!(new_name)
sac.invoke(jsns_builder.to_rename(new_name))
@name = new_name
end
|
#update!(hash) ⇒ Object
44
45
46
47
48
49
50
51
52
53
54
|
# File 'lib/zm/client/distributionlist/distributionlist.rb', line 44
def update!(hash)
return false if hash.delete_if { |k, v| v.nil? || !respond_to?(k) }.empty?
do_update!(hash)
hash.each do |key, value|
update_attribute(key, value)
end
true
end
|