Class: Zm::Client::Domain

Inherits:
Base::Object show all
Includes:
HasSoapAdminConnector, RequestMethodsAdmin
Defined in:
lib/zm/client/domain/domain.rb

Overview

objectClass: zimbraDomain

Instance Attribute Summary

Attributes inherited from Base::Object

#id, #name, #parent, #token

Instance Method Summary collapse

Methods included from RequestMethodsAdmin

#build_create, #build_delete, #build_modify, #build_rename, #delete!, #modify!, #rename!, #update!

Methods included from HasSoapAdminConnector

#soap_admin_connector

Methods inherited from Base::Object

#clone, #initialize, #inspect, #instance_variables_map, #logger, #recorded?, #save!, #to_h, #to_s, #update_attribute

Constructor Details

This class inherits a constructor from Zm::Client::Base::Object

Instance Method Details

#accountsObject



15
16
17
18
19
# File 'lib/zm/client/domain/domain.rb', line 15

def accounts
  return @accounts if defined? @accounts

  @accounts = DomainAccountsCollection.new(self)
end

#attrs_writeObject



42
43
44
# File 'lib/zm/client/domain/domain.rb', line 42

def attrs_write
  @parent.zimbra_attributes.all_domain_attrs_writable_names
end

#cosObject



34
35
36
37
38
39
40
# File 'lib/zm/client/domain/domain.rb', line 34

def cos
  return nil if zimbraDomainDefaultCOSId.nil?

  return @cos if defined? @cos

  @cos = @parent.coses.find_by(id: zimbraDomainDefaultCOSId)
end

#create!Object



10
11
12
13
# File 'lib/zm/client/domain/domain.rb', line 10

def create!
  resp = sac.invoke(build_create)
  @id = resp[:CreateDomainResponse][:domain].first[:id]
end

#distributionlistsObject Also known as: distribution_lists



21
22
23
24
25
# File 'lib/zm/client/domain/domain.rb', line 21

def distributionlists
  return @distributionlists if defined? @distributionlists

  @distributionlists = DomainDistributionListsCollection.new(self)
end

#DKIMPublicTxtObject



46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/zm/client/domain/domain.rb', line 46

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

#jsns_builderObject



62
63
64
65
66
# File 'lib/zm/client/domain/domain.rb', line 62

def jsns_builder
  return @jsns_builder if defined? @jsns_builder

  @jsns_builder = DomainJsnsBuilder.new(self)
end

#resourcesObject



28
29
30
31
32
# File 'lib/zm/client/domain/domain.rb', line 28

def resources
  return @resources if defined? @resources

  @resources = DomainResourcesCollection.new(self)
end