Class: Zm::Client::Domain
Overview
objectClass: zimbraDomain
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
57
58
59
|
# File 'lib/zm/client/domain/domain.rb', line 57
def attrs_write
@parent.zimbra_attributes.all_domain_attrs_writable_names
end
|
#cos ⇒ Object
51
52
53
54
55
|
# File 'lib/zm/client/domain/domain.rb', line 51
def cos
return nil if self.zimbraDomainDefaultCOSId.nil?
@cos ||= @parent.coses.find_by id: self.zimbraDomainDefaultCOSId
end
|
#create! ⇒ Object
9
10
11
12
|
# File 'lib/zm/client/domain/domain.rb', line 9
def create!
resp = sac.invoke(jsns_builder.to_create)
@id = resp[:CreateDomainResponse][:domain].first[:id]
end
|
#distributionlists ⇒ Object
Also known as:
distribution_lists
#DKIMPublicTxt ⇒ Object
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
# File 'lib/zm/client/domain/domain.rb', line 61
def DKIMPublicTxt
return if self.DKIMPublicKey.nil?
return @DKIMPublicTxt if @DKIMPublicTxt
txt = self.DKIMPublicKey.each_line.map do |line|
line.chomp!
line.gsub!('"', '')
line.strip!
end.join
matches = txt.scan(/\((.*)\)/)
return if matches.first.nil?
@DKIMPublicTxt = matches.first.first.strip
end
|
#modify! ⇒ Object
14
15
16
17
|
# File 'lib/zm/client/domain/domain.rb', line 14
def modify!
sac.invoke(jsns_builder.to_update)
true
end
|
#update!(hash) ⇒ Object
19
20
21
22
23
24
25
26
27
28
29
|
# File 'lib/zm/client/domain/domain.rb', line 19
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
|