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
#accounts ⇒ Object
38
39
40
|
# File 'lib/zm/client/domain/domain.rb', line 38
def accounts
@accounts ||= DomainAccountsCollection.new(self)
end
|
#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
|
#delete! ⇒ Object
31
32
33
34
35
36
|
# File 'lib/zm/client/domain/domain.rb', line 31
def delete!
soap_request = SoapElement.admin(SoapAdminConstants::DELETE_DOMAIN_REQUEST).add_attribute(SoapConstants::ID,
@id)
sac.invoke(soap_request)
@id = nil
end
|
#distributionlists ⇒ Object
Also known as:
distribution_lists
42
43
44
|
# File 'lib/zm/client/domain/domain.rb', line 42
def distributionlists
@distributionlists ||= DomainDistributionListsCollection.new(self)
end
|
#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
|
#resources ⇒ Object
47
48
49
|
# File 'lib/zm/client/domain/domain.rb', line 47
def resources
@resources ||= DomainResourcesCollection.new(self)
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
|