zm-ruby-client 3.0.1 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +96 -0
- data/README.md +128 -27
- data/VERSION +1 -1
- data/lib/zm/client/account/account.rb +12 -19
- data/lib/zm/client/account/account_aliases_collection.rb +6 -4
- data/lib/zm/client/account/account_dls_membership_collection.rb +4 -3
- data/lib/zm/client/account/account_dls_owner_collection.rb +3 -2
- data/lib/zm/client/account/account_jsns_builder.rb +10 -10
- data/lib/zm/client/account/accounts_collection.rb +27 -16
- data/lib/zm/client/ace/ace.rb +3 -6
- data/lib/zm/client/ace/ace_jsns_builder.rb +6 -6
- data/lib/zm/client/appointment/appointment.rb +32 -14
- data/lib/zm/client/appointment/appointment_jsns_builder.rb +5 -5
- data/lib/zm/client/appointment/appointment_jsns_initializer.rb +6 -1
- data/lib/zm/client/appointment/appointments_collection.rb +12 -9
- data/lib/zm/client/backup/backup.rb +5 -2
- data/lib/zm/client/backup/backups_collection.rb +3 -2
- data/lib/zm/client/base/account_objects_collection.rb +1 -0
- data/lib/zm/client/base/account_search_objects_collection.rb +6 -6
- data/lib/zm/client/base/admin_objects_collection.rb +60 -7
- data/lib/zm/client/base/base_account_jsns_builder.rb +89 -87
- data/lib/zm/client/base/base_jsns_builder.rb +3 -3
- data/lib/zm/client/base/base_jsns_initializer.rb +20 -15
- data/lib/zm/client/base/mailbox_infos_collection.rb +92 -90
- data/lib/zm/client/base/mailbox_object.rb +49 -160
- data/lib/zm/client/base/mailbox_prefs_collection.rb +54 -52
- data/lib/zm/client/base/object.rb +19 -2
- data/lib/zm/client/base/objects_collection.rb +10 -10
- data/lib/zm/client/base/zimbra_attribute.rb +28 -42
- data/lib/zm/client/base/zimbra_attributes_collection.rb +38 -24
- data/lib/zm/client/{cluster/batch_request.rb → batch_request.rb} +1 -1
- data/lib/zm/client/cluster/cluster.rb +24 -61
- data/lib/zm/client/cluster/cluster_config.rb +35 -15
- data/lib/zm/client/contact/contact.rb +15 -13
- data/lib/zm/client/contact/contact_jsns_builder.rb +9 -6
- data/lib/zm/client/contact/contact_jsns_initializer.rb +2 -2
- data/lib/zm/client/contact/contact_member.rb +3 -3
- data/lib/zm/client/contact/contact_members_collection.rb +3 -3
- data/lib/zm/client/contact/contacts_builder.rb +1 -1
- data/lib/zm/client/contact/contacts_collection.rb +2 -2
- data/lib/zm/client/contact/group_contact_jsns_builder.rb +18 -14
- data/lib/zm/client/contact/mod_group_contact.rb +12 -8
- data/lib/zm/client/cos/cos.rb +15 -31
- data/lib/zm/client/cos/cos_jsns_builder.rb +21 -21
- data/lib/zm/client/cos/coses_collection.rb +11 -6
- data/lib/zm/client/datasource/datasource.rb +3 -9
- data/lib/zm/client/datasource/datasource_jsns_builder.rb +4 -4
- data/lib/zm/client/datasource/datasources_builder.rb +1 -1
- data/lib/zm/client/datasource/datasources_collection.rb +2 -2
- data/lib/zm/client/deprecated_constants.rb +36 -0
- data/lib/zm/client/distributionlist/distributionlist.rb +15 -47
- data/lib/zm/client/distributionlist/distributionlist_aces_collection.rb +4 -4
- data/lib/zm/client/distributionlist/distributionlist_aliases_collection.rb +7 -5
- data/lib/zm/client/distributionlist/distributionlist_jsns_builder.rb +29 -41
- data/lib/zm/client/distributionlist/distributionlist_jsns_initializer.rb +14 -3
- data/lib/zm/client/distributionlist/distributionlist_members_collection.rb +14 -10
- data/lib/zm/client/distributionlist/distributionlist_owners_collection.rb +13 -13
- data/lib/zm/client/distributionlist/distributionlists_collection.rb +15 -7
- data/lib/zm/client/distributionlist/dls_membership_collection.rb +8 -6
- data/lib/zm/client/document/document.rb +5 -11
- data/lib/zm/client/document/document_jsns_builder.rb +2 -2
- data/lib/zm/client/document/documents_collection.rb +4 -4
- data/lib/zm/client/domain/domain.rb +8 -25
- data/lib/zm/client/domain/domain_jsns_builder.rb +13 -13
- data/lib/zm/client/domain/domains_collection.rb +13 -6
- data/lib/zm/client/filter_rules/filter_rules_collection.rb +1 -1
- data/lib/zm/client/filter_rules/outgoing_filter_rules_collection.rb +1 -1
- data/lib/zm/client/folder/folder.rb +34 -21
- data/lib/zm/client/folder/folder_default.rb +39 -0
- data/lib/zm/client/folder/folder_grant_jsns_builder.rb +3 -3
- data/lib/zm/client/folder/folder_grants_collection.rb +1 -1
- data/lib/zm/client/folder/folder_jsns_builder.rb +12 -12
- data/lib/zm/client/folder/folder_jsns_initializer.rb +1 -1
- data/lib/zm/client/folder/folder_retention_policies_collection.rb +6 -2
- data/lib/zm/client/folder/folder_view.rb +15 -0
- data/lib/zm/client/folder/folders_jsns_builder.rb +1 -1
- data/lib/zm/client/folder/mod_document_folder.rb +16 -12
- data/lib/zm/client/identity/identities_collection.rb +1 -1
- data/lib/zm/client/identity/identity.rb +3 -9
- data/lib/zm/client/identity/identity_jsns_builder.rb +8 -8
- data/lib/zm/client/{base/ldap_filter.rb → ldap_filter.rb} +1 -1
- data/lib/zm/client/license/licenses_collection.rb +1 -1
- data/lib/zm/client/mailbox/mailbox_item_concern.rb +0 -2
- data/lib/zm/client/message/message.rb +14 -19
- data/lib/zm/client/message/message_attachments_collection.rb +39 -0
- data/lib/zm/client/message/message_flags_collection.rb +130 -0
- data/lib/zm/client/message/message_jsns_builder.rb +4 -8
- data/lib/zm/client/message/message_jsns_initializer.rb +4 -4
- data/lib/zm/client/message/message_recipients.rb +19 -43
- data/lib/zm/client/message/messages_collection.rb +20 -4
- data/lib/zm/client/mountpoint/{mountpoint.rb → mount_point.rb} +4 -10
- data/lib/zm/client/mountpoint/{mountpoint_jsns_builder.rb → mount_point_jsns_builder.rb} +3 -3
- data/lib/zm/client/mountpoint/{mountpoint_jsns_initializer.rb → mount_point_jsns_initializer.rb} +1 -1
- data/lib/zm/client/mountpoint/{mountpoints_builder.rb → mount_points_builder.rb} +1 -1
- data/lib/zm/client/mta_queue/mta_queue.rb +4 -16
- data/lib/zm/client/mta_queue/mta_queue_action.rb +12 -0
- data/lib/zm/client/mta_queue/mta_queue_jsns_builder.rb +7 -7
- data/lib/zm/client/mta_queue/mta_queue_name.rb +14 -0
- data/lib/zm/client/mta_queue/mta_queues_collection.rb +4 -3
- data/lib/zm/client/mta_queue_item/mta_queue_items_collection.rb +1 -0
- data/lib/zm/client/recipient.rb +21 -0
- data/lib/zm/client/{common/recipients.rb → recipients.rb} +0 -16
- data/lib/zm/client/resource/resource.rb +3 -7
- data/lib/zm/client/resource/resource_jsns_builder.rb +13 -13
- data/lib/zm/client/resource/resources_collection.rb +20 -7
- data/lib/zm/client/search_folder/search_folder.rb +4 -11
- data/lib/zm/client/search_folder/search_folder_jsns_builder.rb +6 -6
- data/lib/zm/client/search_folder/search_folders_collection.rb +1 -1
- data/lib/zm/client/server/server.rb +16 -22
- data/lib/zm/client/server/server_services.rb +26 -0
- data/lib/zm/client/server/servers_collection.rb +6 -6
- data/lib/zm/client/share/share.rb +2 -5
- data/lib/zm/client/share/shares_builder.rb +1 -1
- data/lib/zm/client/share/shares_collection.rb +5 -4
- data/lib/zm/client/signature/signature.rb +7 -13
- data/lib/zm/client/signature/signature_jsns_builder.rb +13 -13
- data/lib/zm/client/signature/signature_jsns_initializer.rb +2 -2
- data/lib/zm/client/signature/signatures_collection.rb +1 -1
- data/lib/zm/client/tag/account_object_tags_collection.rb +45 -47
- data/lib/zm/client/tag/tag.rb +3 -9
- data/lib/zm/client/tag/tag_jsns_builder.rb +3 -3
- data/lib/zm/client/tag/tags_builder.rb +1 -1
- data/lib/zm/client/tag/tags_collection.rb +2 -2
- data/lib/zm/client/task/task.rb +2 -2
- data/lib/zm/client/task/tasks_collection.rb +2 -2
- data/lib/zm/client/token.rb +4 -1
- data/lib/zm/client/upload.rb +179 -1
- data/lib/zm/client/{common/utils.rb → utils.rb} +6 -3
- data/lib/zm/client/zm_logger.rb +1 -1
- data/lib/zm/client.rb +227 -10
- data/lib/zm/connector/network_error_handler.rb +18 -0
- data/lib/zm/{client/connector → connector}/rest_connector.rb +46 -40
- data/lib/zm/{client/connector/soap_account.rb → connector/soap_account_connector.rb} +15 -17
- data/lib/zm/{client/connector/soap_admin.rb → connector/soap_admin_connector.rb} +3 -5
- data/lib/zm/connector/soap_base_connector.rb +115 -0
- data/lib/zm/connector.rb +13 -0
- data/lib/zm/error/auth_error.rb +8 -0
- data/lib/zm/error/connection_error.rb +8 -0
- data/lib/zm/error/rest_error.rb +8 -0
- data/lib/zm/{client/connector → error}/soap_error.rb +1 -10
- data/lib/zm/error/zm_error.rb +8 -0
- data/lib/zm/error.rb +11 -0
- data/lib/zm/relationship/has_many.rb +22 -0
- data/lib/zm/relationship/jsns_builder.rb +21 -0
- data/lib/zm/relationship/relationship.rb +113 -0
- data/lib/zm/relationship/schema.rb +32 -0
- data/lib/zm/relationship.rb +5 -0
- data/lib/zm/{client/soap_request → soap_request}/request_methods_admin.rb +11 -5
- data/lib/zm/{client/soap_request → soap_request}/request_methods_mailbox.rb +1 -1
- data/lib/zm/{client/soap_request/account_soap_constants.rb → soap_request/soap_account_constants.rb} +1 -1
- data/lib/zm/{client/soap_request/admin_soap_constants.rb → soap_request/soap_admin_constants.rb} +1 -1
- data/lib/zm/{client/soap_request → soap_request}/soap_constants.rb +1 -1
- data/lib/zm/{client/soap_request → soap_request}/soap_context.rb +13 -5
- data/lib/zm/{client/soap_request → soap_request}/soap_element.rb +1 -1
- data/lib/zm/{client/soap_request/mail_soap_constants.rb → soap_request/soap_mail_constants.rb} +1 -1
- data/lib/zm/soap_request.rb +14 -0
- data/lib/zm/support/cache/entry.rb +3 -3
- data/lib/zm/support/cache/file_store.rb +4 -6
- data/lib/zm/support/cache/null_store.rb +2 -4
- data/lib/zm/support/cache/store.rb +17 -9
- data/lib/zm/support/cache.rb +13 -8
- data/lib/zm/support.rb +7 -0
- data/lib/zm/{modules → utils}/belongs_to_folder.rb +1 -1
- data/lib/zm/{modules → utils}/belongs_to_tag.rb +2 -2
- data/lib/zm/utils/content_part.rb +9 -0
- data/lib/zm/utils/content_type.rb +11 -0
- data/lib/zm/{modules → utils}/has_soap_admin_connector.rb +1 -1
- data/lib/zm/utils/inspector.rb +26 -0
- data/lib/zm/utils/log_filter.rb +30 -0
- data/lib/zm/utils/missing_method_static_collection.rb +17 -0
- data/lib/zm/utils/regex.rb +11 -0
- data/lib/zm/utils/search_utils.rb +13 -0
- data/lib/zm/utils.rb +16 -0
- data/lib/zm-ruby-client.rb +12 -0
- data/sig/zm/client/admin_objects.rbs +261 -0
- data/sig/zm/client/base.rbs +191 -0
- data/sig/zm/client/cluster.rbs +152 -0
- data/sig/zm/client/mailbox.rbs +766 -0
- data/sig/zm/error.rbs +23 -0
- metadata +99 -91
- data/.gitignore +0 -59
- data/.rubocop.yml +0 -6
- data/.ruby-version +0 -1
- data/Gemfile +0 -11
- data/SECURITY.md +0 -21
- data/bin/console +0 -11
- data/lib/zm/client/account.rb +0 -9
- data/lib/zm/client/ace.rb +0 -7
- data/lib/zm/client/appointment.rb +0 -7
- data/lib/zm/client/backup.rb +0 -6
- data/lib/zm/client/base.rb +0 -21
- data/lib/zm/client/cluster.rb +0 -4
- data/lib/zm/client/common/message.rb +0 -10
- data/lib/zm/client/common.rb +0 -5
- data/lib/zm/client/connector/soap_base.rb +0 -104
- data/lib/zm/client/constant.rb +0 -229
- data/lib/zm/client/contact.rb +0 -11
- data/lib/zm/client/cos.rb +0 -10
- data/lib/zm/client/datasource.rb +0 -7
- data/lib/zm/client/distributionlist.rb +0 -8
- data/lib/zm/client/document.rb +0 -7
- data/lib/zm/client/domain.rb +0 -10
- data/lib/zm/client/filter_rule.rb +0 -7
- data/lib/zm/client/folder.rb +0 -14
- data/lib/zm/client/identity.rb +0 -7
- data/lib/zm/client/license.rb +0 -5
- data/lib/zm/client/message/attachments_collection.rb +0 -55
- data/lib/zm/client/message/message_flags.rb +0 -115
- data/lib/zm/client/message.rb +0 -10
- data/lib/zm/client/mountpoint.rb +0 -7
- data/lib/zm/client/mta_queue.rb +0 -7
- data/lib/zm/client/mta_queue_item.rb +0 -6
- data/lib/zm/client/resource.rb +0 -7
- data/lib/zm/client/search_folder.rb +0 -7
- data/lib/zm/client/server.rb +0 -7
- data/lib/zm/client/share.rb +0 -7
- data/lib/zm/client/signature.rb +0 -7
- data/lib/zm/client/soap_request.rb +0 -11
- data/lib/zm/client/tag.rb +0 -8
- data/lib/zm/client/task.rb +0 -6
- data/lib/zm/client/upload/upload.rb +0 -160
- data/lib/zm/modules/base.rb +0 -9
- data/lib/zm/modules/common/zimbra-attrs.json +0 -58
- data/lib/zm/modules/inspector.rb +0 -24
- data/lib/zm/modules/missing_method_static_collection.rb +0 -13
- data/lib/zm/modules/zm_model.rb +0 -43
- data/zm-ruby-client.gemspec +0 -27
- /data/lib/zm/client/mountpoint/{mountpoints_collection.rb → mount_points_collection.rb} +0 -0
|
@@ -6,7 +6,7 @@ module Zm
|
|
|
6
6
|
class DataSourcesCollection < Base::AccountObjectsCollection
|
|
7
7
|
def initialize(parent)
|
|
8
8
|
@child_class = DataSource
|
|
9
|
-
@builder_class =
|
|
9
|
+
@builder_class = DataSourcesBuilder
|
|
10
10
|
super
|
|
11
11
|
end
|
|
12
12
|
|
|
@@ -15,7 +15,7 @@ module Zm
|
|
|
15
15
|
end
|
|
16
16
|
|
|
17
17
|
def build_query
|
|
18
|
-
SoapElement.mail(SoapMailConstants::GET_DATA_SOURCES_REQUEST)
|
|
18
|
+
SoapRequest::SoapElement.mail(SoapRequest::SoapMailConstants::GET_DATA_SOURCES_REQUEST)
|
|
19
19
|
end
|
|
20
20
|
end
|
|
21
21
|
end
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Zm
|
|
4
|
+
module Client
|
|
5
|
+
# resolves the 3.0 constant names moved out of Zm::Client, with a deprecation warning
|
|
6
|
+
module DeprecatedConstants
|
|
7
|
+
NAMES = {
|
|
8
|
+
ZmError: 'Zm::Error::ZmError',
|
|
9
|
+
SoapError: 'Zm::Error::SoapError',
|
|
10
|
+
AuthError: 'Zm::Error::AuthError',
|
|
11
|
+
RestError: 'Zm::Error::RestError',
|
|
12
|
+
SoapBaseConnector: 'Zm::Connector::SoapBaseConnector',
|
|
13
|
+
SoapAdminConnector: 'Zm::Connector::SoapAdminConnector',
|
|
14
|
+
SoapAccountConnector: 'Zm::Connector::SoapAccountConnector',
|
|
15
|
+
RestConnector: 'Zm::Connector::RestConnector',
|
|
16
|
+
SoapElement: 'Zm::SoapRequest::SoapElement',
|
|
17
|
+
SoapConstants: 'Zm::SoapRequest::SoapConstants',
|
|
18
|
+
SoapAdminConstants: 'Zm::SoapRequest::SoapAdminConstants',
|
|
19
|
+
SoapAccountConstants: 'Zm::SoapRequest::SoapAccountConstants',
|
|
20
|
+
SoapMailConstants: 'Zm::SoapRequest::SoapMailConstants',
|
|
21
|
+
SoapUtils: 'Zm::Utils::SearchUtils',
|
|
22
|
+
Regex: 'Zm::Utils::Regex',
|
|
23
|
+
ContentType: 'Zm::Utils::ContentType',
|
|
24
|
+
ContentPart: 'Zm::Utils::ContentPart'
|
|
25
|
+
}.freeze
|
|
26
|
+
|
|
27
|
+
def const_missing(name)
|
|
28
|
+
target = NAMES[name]
|
|
29
|
+
return super if target.nil?
|
|
30
|
+
|
|
31
|
+
warn("#{self}::#{name} is deprecated and will be removed in 4.0, use #{target} instead", uplevel: 1)
|
|
32
|
+
const_set(name, Object.const_get(target))
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -1,46 +1,20 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require 'zm/client/distributionlist/distributionlist_aliases_collection'
|
|
4
|
-
require 'zm/client/distributionlist/distributionlist_members_collection'
|
|
5
|
-
require 'zm/client/distributionlist/distributionlist_owners_collection'
|
|
6
|
-
require 'zm/client/distributionlist/distributionlist_aces_collection'
|
|
7
|
-
|
|
8
3
|
module Zm
|
|
9
4
|
module Client
|
|
10
5
|
# objectClass: zimbraDistributionList
|
|
11
6
|
class DistributionList < Base::Object
|
|
12
|
-
|
|
13
|
-
include RequestMethodsAdmin
|
|
14
|
-
|
|
15
|
-
def aliases
|
|
16
|
-
return @aliases if defined? @aliases
|
|
17
|
-
|
|
18
|
-
@aliases = DistributionListAliasesCollection.new(self)
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
def members
|
|
22
|
-
return @members if defined? @members
|
|
7
|
+
extend Relationship
|
|
23
8
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
def owners
|
|
28
|
-
return @owners if defined? @owners
|
|
29
|
-
|
|
30
|
-
@owners = DistributionListOwnersCollection.new(self)
|
|
31
|
-
end
|
|
9
|
+
has_jsns_builder
|
|
10
|
+
include Zm::Utils::HasSoapAdminConnector
|
|
11
|
+
include SoapRequest::RequestMethodsAdmin
|
|
32
12
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
def aces
|
|
40
|
-
return @aces if defined? @aces
|
|
41
|
-
|
|
42
|
-
@aces = DistributionListAcesCollection.new(self)
|
|
43
|
-
end
|
|
13
|
+
has_many :aliases, klass: :'Zm::Client::DistributionListAliasesCollection'
|
|
14
|
+
has_many :members, klass: :'Zm::Client::DistributionListMembersCollection'
|
|
15
|
+
has_many :owners, klass: :'Zm::Client::DistributionListOwnersCollection'
|
|
16
|
+
has_many :memberships, klass: :'Zm::Client::DlsMembershipCollection'
|
|
17
|
+
has_many :aces, klass: :'Zm::Client::DistributionListAcesCollection'
|
|
44
18
|
|
|
45
19
|
def create!
|
|
46
20
|
resp = sac.invoke(build_create)
|
|
@@ -48,7 +22,7 @@ module Zm
|
|
|
48
22
|
end
|
|
49
23
|
|
|
50
24
|
def local_transport
|
|
51
|
-
raise Zm::
|
|
25
|
+
raise Zm::Error::ZmError, 'zimbraMailHost is null' if zimbraMailHost.nil?
|
|
52
26
|
|
|
53
27
|
"lmtp:#{zimbraMailHost}:7025"
|
|
54
28
|
end
|
|
@@ -60,36 +34,30 @@ module Zm
|
|
|
60
34
|
def local_transport?
|
|
61
35
|
return false unless zimbraMailTransport
|
|
62
36
|
|
|
63
|
-
zimbraMailTransport.start_with?(SoapConstants::LMTP)
|
|
37
|
+
zimbraMailTransport.start_with?(SoapRequest::SoapConstants::LMTP)
|
|
64
38
|
end
|
|
65
39
|
|
|
66
40
|
def external_transport?
|
|
67
41
|
return false unless zimbraMailTransport
|
|
68
42
|
|
|
69
|
-
zimbraMailTransport.start_with?(SoapConstants::SMTP)
|
|
43
|
+
zimbraMailTransport.start_with?(SoapRequest::SoapConstants::SMTP)
|
|
70
44
|
end
|
|
71
45
|
|
|
72
46
|
def hide_in_gal?
|
|
73
|
-
zimbraHideInGal == SoapConstants::TRUE
|
|
47
|
+
zimbraHideInGal == SoapRequest::SoapConstants::TRUE
|
|
74
48
|
end
|
|
75
49
|
|
|
76
50
|
def group?
|
|
77
|
-
zimbraMailStatus == SoapConstants::DISABLED
|
|
51
|
+
zimbraMailStatus == SoapRequest::SoapConstants::DISABLED
|
|
78
52
|
end
|
|
79
53
|
|
|
80
54
|
def mailing_list?
|
|
81
|
-
zimbraMailStatus == SoapConstants::ENABLED
|
|
55
|
+
zimbraMailStatus == SoapRequest::SoapConstants::ENABLED
|
|
82
56
|
end
|
|
83
57
|
|
|
84
58
|
def attrs_write
|
|
85
59
|
@parent.zimbra_attributes.all_distributionlist_attrs_writable_names
|
|
86
60
|
end
|
|
87
|
-
|
|
88
|
-
def jsns_builder
|
|
89
|
-
return @jsns_builder if defined? @jsns_builder
|
|
90
|
-
|
|
91
|
-
@jsns_builder = DistributionListJsnsBuilder.new(self)
|
|
92
|
-
end
|
|
93
61
|
end
|
|
94
62
|
end
|
|
95
63
|
end
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
module Zm
|
|
4
4
|
module Client
|
|
5
|
-
DistributionListAce = Struct.new(:zimbra_id, :type, :right)
|
|
6
|
-
|
|
7
5
|
# Collection Account Aliases
|
|
8
6
|
class DistributionListAcesCollection
|
|
9
|
-
include MissingMethodStaticCollection
|
|
7
|
+
include Zm::Utils::MissingMethodStaticCollection
|
|
8
|
+
|
|
9
|
+
DistributionListAce = Data.define(:zimbra_id, :type, :right)
|
|
10
10
|
|
|
11
11
|
def initialize(parent)
|
|
12
12
|
@parent = parent
|
|
@@ -23,7 +23,7 @@ module Zm
|
|
|
23
23
|
|
|
24
24
|
@all = zimbra_aces.map do |str|
|
|
25
25
|
parts = str.split(/\s+/)
|
|
26
|
-
DistributionListAce.new(parts[0], parts[1], parts[2])
|
|
26
|
+
DistributionListAce.new(zimbra_id: parts[0], type: parts[1], right: parts[2])
|
|
27
27
|
end
|
|
28
28
|
end
|
|
29
29
|
end
|
|
@@ -4,7 +4,7 @@ module Zm
|
|
|
4
4
|
module Client
|
|
5
5
|
# Collection Account Aliases
|
|
6
6
|
class DistributionListAliasesCollection
|
|
7
|
-
include MissingMethodStaticCollection
|
|
7
|
+
include Zm::Utils::MissingMethodStaticCollection
|
|
8
8
|
|
|
9
9
|
def initialize(parent)
|
|
10
10
|
@parent = parent
|
|
@@ -13,7 +13,8 @@ module Zm
|
|
|
13
13
|
end
|
|
14
14
|
|
|
15
15
|
def add!(email)
|
|
16
|
-
|
|
16
|
+
email = Utils.format_email(email)
|
|
17
|
+
return false if @all.include?(email)
|
|
17
18
|
|
|
18
19
|
@parent.sac.invoke(build_add(email))
|
|
19
20
|
|
|
@@ -22,13 +23,14 @@ module Zm
|
|
|
22
23
|
end
|
|
23
24
|
|
|
24
25
|
def build_add(email)
|
|
25
|
-
soap_request = SoapElement.admin(SoapAdminConstants::ADD_DISTRIBUTION_LIST_ALIAS_REQUEST)
|
|
26
|
+
soap_request = SoapRequest::SoapElement.admin(Zm::SoapRequest::SoapAdminConstants::ADD_DISTRIBUTION_LIST_ALIAS_REQUEST)
|
|
26
27
|
soap_request.add_attributes({ id: @parent.id, alias: email })
|
|
27
28
|
soap_request
|
|
28
29
|
end
|
|
29
30
|
|
|
30
31
|
def remove!(email)
|
|
31
|
-
|
|
32
|
+
email = Utils.format_email(email)
|
|
33
|
+
return false unless @all.include?(email)
|
|
32
34
|
|
|
33
35
|
@parent.sac.invoke(build_remove(email))
|
|
34
36
|
|
|
@@ -37,7 +39,7 @@ module Zm
|
|
|
37
39
|
end
|
|
38
40
|
|
|
39
41
|
def build_remove(email)
|
|
40
|
-
soap_request = SoapElement.admin(SoapAdminConstants::REMOVE_DISTRIBUTION_LIST_ALIAS_REQUEST)
|
|
42
|
+
soap_request = SoapRequest::SoapElement.admin(Zm::SoapRequest::SoapAdminConstants::REMOVE_DISTRIBUTION_LIST_ALIAS_REQUEST)
|
|
41
43
|
soap_request.add_attributes({ id: @parent.id, alias: email })
|
|
42
44
|
soap_request
|
|
43
45
|
end
|
|
@@ -9,62 +9,34 @@ module Zm
|
|
|
9
9
|
end
|
|
10
10
|
|
|
11
11
|
def to_create
|
|
12
|
-
soap_request = SoapElement.admin(SoapAdminConstants::CREATE_DISTRIBUTION_LIST_REQUEST)
|
|
13
|
-
|
|
12
|
+
soap_request = SoapRequest::SoapElement.admin(Zm::SoapRequest::SoapAdminConstants::CREATE_DISTRIBUTION_LIST_REQUEST)
|
|
13
|
+
.add_attribute(SoapRequest::SoapConstants::NAME, @item.name)
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
values.each do |value|
|
|
17
|
-
node_attr = SoapElement.create(SoapConstants::A)
|
|
18
|
-
.add_attribute(SoapConstants::N, key)
|
|
19
|
-
.add_content(value)
|
|
20
|
-
soap_request.add_node(node_attr)
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
soap_request
|
|
15
|
+
add_attr_nodes(soap_request, attrs_only_set_h)
|
|
25
16
|
end
|
|
26
17
|
|
|
27
18
|
def to_update
|
|
28
|
-
soap_request = SoapElement.admin(SoapAdminConstants::MODIFY_DISTRIBUTION_LIST_REQUEST)
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
attrs_only_set_h.each do |key, values|
|
|
32
|
-
values.each do |value|
|
|
33
|
-
node_attr = SoapElement.create(SoapConstants::A)
|
|
34
|
-
.add_attribute(SoapConstants::N, key)
|
|
35
|
-
.add_content(value)
|
|
36
|
-
soap_request.add_node(node_attr)
|
|
37
|
-
end
|
|
38
|
-
end
|
|
19
|
+
soap_request = SoapRequest::SoapElement.admin(Zm::SoapRequest::SoapAdminConstants::MODIFY_DISTRIBUTION_LIST_REQUEST)
|
|
20
|
+
.add_attribute(SoapRequest::SoapConstants::ID, @item.id)
|
|
39
21
|
|
|
40
|
-
soap_request
|
|
22
|
+
add_attr_nodes(soap_request, attrs_only_set_h)
|
|
41
23
|
end
|
|
42
24
|
|
|
43
25
|
def to_patch(hash)
|
|
44
|
-
soap_request = SoapElement.admin(SoapAdminConstants::MODIFY_DISTRIBUTION_LIST_REQUEST)
|
|
45
|
-
|
|
26
|
+
soap_request = SoapRequest::SoapElement.admin(Zm::SoapRequest::SoapAdminConstants::MODIFY_DISTRIBUTION_LIST_REQUEST)
|
|
27
|
+
.add_attribute(SoapRequest::SoapConstants::ID, @item.id)
|
|
46
28
|
|
|
47
|
-
|
|
48
|
-
values = [values] unless values.is_a?(Array)
|
|
49
|
-
values.each do |value|
|
|
50
|
-
node_attr = SoapElement.create(SoapConstants::A)
|
|
51
|
-
.add_attribute(SoapConstants::N, key)
|
|
52
|
-
.add_content(value)
|
|
53
|
-
soap_request.add_node(node_attr)
|
|
54
|
-
end
|
|
55
|
-
end
|
|
56
|
-
|
|
57
|
-
soap_request
|
|
29
|
+
add_attr_nodes(soap_request, hash)
|
|
58
30
|
end
|
|
59
31
|
|
|
60
32
|
def to_delete
|
|
61
|
-
SoapElement.admin(SoapAdminConstants::DELETE_DISTRIBUTION_LIST_REQUEST)
|
|
62
|
-
|
|
33
|
+
SoapRequest::SoapElement.admin(Zm::SoapRequest::SoapAdminConstants::DELETE_DISTRIBUTION_LIST_REQUEST)
|
|
34
|
+
.add_attribute(SoapRequest::SoapConstants::ID, @item.id)
|
|
63
35
|
end
|
|
64
36
|
|
|
65
37
|
def to_rename(new_name)
|
|
66
|
-
SoapElement.admin(SoapAdminConstants::RENAME_DISTRIBUTION_LIST_REQUEST)
|
|
67
|
-
|
|
38
|
+
SoapRequest::SoapElement.admin(Zm::SoapRequest::SoapAdminConstants::RENAME_DISTRIBUTION_LIST_REQUEST)
|
|
39
|
+
.add_attributes({ id: @item.id, newName: new_name })
|
|
68
40
|
end
|
|
69
41
|
|
|
70
42
|
def attrs_only_set_h
|
|
@@ -80,6 +52,22 @@ module Zm
|
|
|
80
52
|
|
|
81
53
|
arr.to_h
|
|
82
54
|
end
|
|
55
|
+
|
|
56
|
+
private
|
|
57
|
+
|
|
58
|
+
def add_attr_nodes(soap_request, hash)
|
|
59
|
+
hash.each do |key, values|
|
|
60
|
+
values = [values] unless values.is_a?(Array)
|
|
61
|
+
values.each do |value|
|
|
62
|
+
node_attr = SoapRequest::SoapElement.create(SoapRequest::SoapConstants::A)
|
|
63
|
+
.add_attribute(SoapRequest::SoapConstants::N, key)
|
|
64
|
+
.add_content(value)
|
|
65
|
+
soap_request.add_node(node_attr)
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
soap_request
|
|
70
|
+
end
|
|
83
71
|
end
|
|
84
72
|
end
|
|
85
73
|
end
|
|
@@ -15,15 +15,26 @@ module Zm
|
|
|
15
15
|
item.zimbraMailForwardingAddress.compact!
|
|
16
16
|
end
|
|
17
17
|
|
|
18
|
+
update_members(item, json)
|
|
19
|
+
update_owners(item, json)
|
|
20
|
+
|
|
21
|
+
item
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
private
|
|
25
|
+
|
|
26
|
+
def update_members(item, json)
|
|
18
27
|
if json[:dlm].is_a?(Array)
|
|
19
|
-
item.members.all = json[:dlm].
|
|
28
|
+
item.members.all = json[:dlm].filter_map { |a| a[:_content] }
|
|
20
29
|
elsif !item.zimbraMailForwardingAddress.empty?
|
|
21
30
|
item.members.all = item.zimbraMailForwardingAddress
|
|
22
31
|
end
|
|
32
|
+
end
|
|
23
33
|
|
|
24
|
-
|
|
34
|
+
def update_owners(item, json)
|
|
35
|
+
return unless json[:owners].is_a?(Array)
|
|
25
36
|
|
|
26
|
-
item
|
|
37
|
+
item.owners.all = json[:owners].first[:owner].filter_map { |a| a[:name] }
|
|
27
38
|
end
|
|
28
39
|
end
|
|
29
40
|
end
|
|
@@ -12,8 +12,7 @@ module Zm
|
|
|
12
12
|
end
|
|
13
13
|
|
|
14
14
|
def add!(emails)
|
|
15
|
-
emails.
|
|
16
|
-
emails.delete_if { |email| @all.include?(email) }
|
|
15
|
+
emails = format_emails(emails).reject { |email| @all.include?(email) }
|
|
17
16
|
return false if emails.empty?
|
|
18
17
|
|
|
19
18
|
@parent.sac.invoke(build_add(emails))
|
|
@@ -23,17 +22,16 @@ module Zm
|
|
|
23
22
|
end
|
|
24
23
|
|
|
25
24
|
def build_add(emails)
|
|
26
|
-
soap_request = SoapElement.admin(SoapAdminConstants::ADD_DISTRIBUTION_LIST_MEMBER_REQUEST)
|
|
27
|
-
soap_request.add_attribute(SoapConstants::ID, @parent.id)
|
|
28
|
-
node_dlm = SoapElement.create(SoapConstants::DLM)
|
|
25
|
+
soap_request = SoapRequest::SoapElement.admin(Zm::SoapRequest::SoapAdminConstants::ADD_DISTRIBUTION_LIST_MEMBER_REQUEST)
|
|
26
|
+
soap_request.add_attribute(SoapRequest::SoapConstants::ID, @parent.id)
|
|
27
|
+
node_dlm = SoapRequest::SoapElement.create(SoapRequest::SoapConstants::DLM)
|
|
29
28
|
node_dlm.add_content(emails)
|
|
30
29
|
soap_request.add_node(node_dlm)
|
|
31
30
|
soap_request
|
|
32
31
|
end
|
|
33
32
|
|
|
34
33
|
def remove!(emails)
|
|
35
|
-
emails.
|
|
36
|
-
emails.delete_if { |email| !@all.include?(email) }
|
|
34
|
+
emails = format_emails(emails).select { |email| @all.include?(email) }
|
|
37
35
|
return false if emails.empty?
|
|
38
36
|
|
|
39
37
|
@parent.sac.invoke(build_remove(emails))
|
|
@@ -43,13 +41,19 @@ module Zm
|
|
|
43
41
|
end
|
|
44
42
|
|
|
45
43
|
def build_remove(emails)
|
|
46
|
-
soap_request = SoapElement.admin(SoapAdminConstants::REMOVE_DISTRIBUTION_LIST_MEMBER_REQUEST)
|
|
47
|
-
soap_request.add_attribute(SoapConstants::ID, @parent.id)
|
|
48
|
-
node_dlm = SoapElement.create(SoapConstants::DLM)
|
|
44
|
+
soap_request = SoapRequest::SoapElement.admin(Zm::SoapRequest::SoapAdminConstants::REMOVE_DISTRIBUTION_LIST_MEMBER_REQUEST)
|
|
45
|
+
soap_request.add_attribute(SoapRequest::SoapConstants::ID, @parent.id)
|
|
46
|
+
node_dlm = SoapRequest::SoapElement.create(SoapRequest::SoapConstants::DLM)
|
|
49
47
|
node_dlm.add_content(emails)
|
|
50
48
|
soap_request.add_node(node_dlm)
|
|
51
49
|
soap_request
|
|
52
50
|
end
|
|
51
|
+
|
|
52
|
+
private
|
|
53
|
+
|
|
54
|
+
def format_emails(emails)
|
|
55
|
+
[emails].flatten.map { |email| Utils.format_email(email) }.uniq
|
|
56
|
+
end
|
|
53
57
|
end
|
|
54
58
|
end
|
|
55
59
|
end
|
|
@@ -12,9 +12,7 @@ module Zm
|
|
|
12
12
|
end
|
|
13
13
|
|
|
14
14
|
def add!(*emails)
|
|
15
|
-
emails.
|
|
16
|
-
emails.each { |email| Utils.format_email(email) }
|
|
17
|
-
emails.delete_if { |email| @all.include?(email) }
|
|
15
|
+
emails = format_emails(emails).reject { |email| @all.include?(email) }
|
|
18
16
|
return false if emails.empty?
|
|
19
17
|
|
|
20
18
|
@parent.sac.invoke(build_add(emails))
|
|
@@ -28,9 +26,7 @@ module Zm
|
|
|
28
26
|
end
|
|
29
27
|
|
|
30
28
|
def remove!(*emails)
|
|
31
|
-
emails.
|
|
32
|
-
emails.each { |email| Utils.format_email(email) }
|
|
33
|
-
emails.delete_if { |email| !@all.include?(email) }
|
|
29
|
+
emails = format_emails(emails).select { |email| @all.include?(email) }
|
|
34
30
|
return false if emails.empty?
|
|
35
31
|
|
|
36
32
|
@parent.sac.invoke(build_remove(emails))
|
|
@@ -43,20 +39,24 @@ module Zm
|
|
|
43
39
|
jsns('removeOwners', emails)
|
|
44
40
|
end
|
|
45
41
|
|
|
46
|
-
def jsns(
|
|
47
|
-
soap_request = SoapElement.account(SoapAccountConstants::DISTRIBUTION_LIST_ACTION_REQUEST)
|
|
48
|
-
node_dl = SoapElement.create(SoapConstants::DL)
|
|
49
|
-
|
|
50
|
-
|
|
42
|
+
def jsns(operation, emails)
|
|
43
|
+
soap_request = SoapRequest::SoapElement.account(Zm::SoapRequest::SoapAccountConstants::DISTRIBUTION_LIST_ACTION_REQUEST)
|
|
44
|
+
node_dl = SoapRequest::SoapElement.create(SoapRequest::SoapConstants::DL)
|
|
45
|
+
.add_attribute(SoapRequest::SoapConstants::BY, SoapRequest::SoapConstants::ID)
|
|
46
|
+
.add_content(@parent.id)
|
|
51
47
|
soap_request.add_node(node_dl)
|
|
52
|
-
node_action = SoapElement.create(SoapConstants::ACTION)
|
|
53
|
-
|
|
48
|
+
node_action = SoapRequest::SoapElement.create(SoapRequest::SoapConstants::ACTION)
|
|
49
|
+
.add_attributes({ op: operation, owner: jsns_owners(emails) })
|
|
54
50
|
soap_request.add_node(node_action)
|
|
55
51
|
soap_request
|
|
56
52
|
end
|
|
57
53
|
|
|
58
54
|
private
|
|
59
55
|
|
|
56
|
+
def format_emails(emails)
|
|
57
|
+
emails.flatten.map { |email| Utils.format_email(email) }.uniq
|
|
58
|
+
end
|
|
59
|
+
|
|
60
60
|
def jsns_owners(emails)
|
|
61
61
|
emails.map { |email| { by: :name, type: :usr, _content: email } }
|
|
62
62
|
end
|
|
@@ -7,7 +7,7 @@ module Zm
|
|
|
7
7
|
def initialize(parent)
|
|
8
8
|
@child_class = DistributionList
|
|
9
9
|
@builder_class = DistributionListsBuilder
|
|
10
|
-
@search_type =
|
|
10
|
+
@search_type = :distributionlists
|
|
11
11
|
super
|
|
12
12
|
end
|
|
13
13
|
|
|
@@ -19,12 +19,12 @@ module Zm
|
|
|
19
19
|
end
|
|
20
20
|
|
|
21
21
|
def build_find_by(hash)
|
|
22
|
-
soap_request = SoapElement.admin(SoapAdminConstants::GET_DISTRIBUTION_LIST_REQUEST)
|
|
23
|
-
node_dl = SoapElement.create(SoapConstants::DL)
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
soap_request = SoapRequest::SoapElement.admin(Zm::SoapRequest::SoapAdminConstants::GET_DISTRIBUTION_LIST_REQUEST)
|
|
23
|
+
node_dl = SoapRequest::SoapElement.create(SoapRequest::SoapConstants::DL)
|
|
24
|
+
.add_attribute(SoapRequest::SoapConstants::BY, hash.keys.first)
|
|
25
|
+
.add_content(hash.values.first)
|
|
26
26
|
soap_request.add_node(node_dl)
|
|
27
|
-
soap_request.add_attribute(SoapConstants::ATTRS, attrs_comma)
|
|
27
|
+
soap_request.add_attribute(SoapRequest::SoapConstants::ATTRS, attrs_comma)
|
|
28
28
|
soap_request
|
|
29
29
|
end
|
|
30
30
|
|
|
@@ -32,7 +32,15 @@ module Zm
|
|
|
32
32
|
|
|
33
33
|
def reset_query_params
|
|
34
34
|
super
|
|
35
|
-
@attrs =
|
|
35
|
+
@attrs = %w[
|
|
36
|
+
displayName
|
|
37
|
+
zimbraId
|
|
38
|
+
zimbraMailHost
|
|
39
|
+
uid
|
|
40
|
+
description
|
|
41
|
+
zimbraMailStatus
|
|
42
|
+
zimbraMailAlias
|
|
43
|
+
]
|
|
36
44
|
end
|
|
37
45
|
end
|
|
38
46
|
end
|
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
module Zm
|
|
4
4
|
module Client
|
|
5
|
-
DlMembership =
|
|
5
|
+
DlMembership = Data.define(:name, :id, :via)
|
|
6
6
|
|
|
7
|
+
# Collection distribution list dls membership
|
|
7
8
|
class DlsMembershipCollection < Base::ObjectsCollection
|
|
8
9
|
def initialize(parent)
|
|
10
|
+
super()
|
|
9
11
|
@parent = parent
|
|
10
12
|
end
|
|
11
13
|
|
|
@@ -14,10 +16,10 @@ module Zm
|
|
|
14
16
|
end
|
|
15
17
|
|
|
16
18
|
def build_query
|
|
17
|
-
soap_request = SoapElement.admin(SoapAdminConstants::GET_DISTRIBUTION_LIST_MEMBERSHIP_REQUEST)
|
|
18
|
-
node_account = SoapElement.create(SoapConstants::ACCOUNT)
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
soap_request = SoapRequest::SoapElement.admin(Zm::SoapRequest::SoapAdminConstants::GET_DISTRIBUTION_LIST_MEMBERSHIP_REQUEST)
|
|
20
|
+
node_account = SoapRequest::SoapElement.create(SoapRequest::SoapConstants::ACCOUNT)
|
|
21
|
+
.add_attribute(SoapRequest::SoapConstants::BY, SoapRequest::SoapConstants::ID)
|
|
22
|
+
.add_content(@parent.id)
|
|
21
23
|
soap_request.add_node(node_account)
|
|
22
24
|
soap_request
|
|
23
25
|
end
|
|
@@ -26,7 +28,7 @@ module Zm
|
|
|
26
28
|
|
|
27
29
|
def build_response
|
|
28
30
|
collection = make_query.dig(:Body, :GetDistributionListMembershipResponse, :dl) || []
|
|
29
|
-
collection.map { |json| DlMembership.new(json[:name], json[:id], json[:via]) }
|
|
31
|
+
collection.map { |json| DlMembership.new(name: json[:name], id: json[:id], via: json[:via]) }
|
|
30
32
|
end
|
|
31
33
|
end
|
|
32
34
|
end
|
|
@@ -4,9 +4,11 @@ module Zm
|
|
|
4
4
|
module Client
|
|
5
5
|
# class for account document
|
|
6
6
|
class Document < Base::Object
|
|
7
|
-
include BelongsToFolder
|
|
8
|
-
include BelongsToTag
|
|
9
|
-
include RequestMethodsMailbox
|
|
7
|
+
include Zm::Utils::BelongsToFolder
|
|
8
|
+
include Zm::Utils::BelongsToTag
|
|
9
|
+
include SoapRequest::RequestMethodsMailbox
|
|
10
|
+
extend Relationship
|
|
11
|
+
has_jsns_builder
|
|
10
12
|
|
|
11
13
|
attr_accessor :id, :uuid, :name, :s, :d, :l, :luuid, :ms, :mdver, :md, :rev, :f, :t, :meta, :ct,
|
|
12
14
|
:descEnabled, :ver, :leb, :cr, :cd, :acl, :loid, :sf, :tn
|
|
@@ -47,14 +49,6 @@ module Zm
|
|
|
47
49
|
uploader = @parent.build_uploader
|
|
48
50
|
uploader.download_file(dest_file_path, id, nil)
|
|
49
51
|
end
|
|
50
|
-
|
|
51
|
-
private
|
|
52
|
-
|
|
53
|
-
def jsns_builder
|
|
54
|
-
return @jsns_builder if defined? @jsns_builder
|
|
55
|
-
|
|
56
|
-
@jsns_builder = DocumentJsnsBuilder.new(self)
|
|
57
|
-
end
|
|
58
52
|
end
|
|
59
53
|
end
|
|
60
54
|
end
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
module Zm
|
|
4
4
|
module Client
|
|
5
5
|
# class for account document
|
|
6
|
-
class DocumentJsnsBuilder < BaseAccountJsnsBuilder
|
|
6
|
+
class DocumentJsnsBuilder < Base::BaseAccountJsnsBuilder
|
|
7
7
|
def to_delete
|
|
8
8
|
attrs = {
|
|
9
9
|
op: :delete,
|
|
10
|
-
comp:
|
|
10
|
+
comp: Zm::Utils::SearchUtils::OFF,
|
|
11
11
|
id: @item.id
|
|
12
12
|
}
|
|
13
13
|
|
|
@@ -10,17 +10,17 @@ module Zm
|
|
|
10
10
|
super
|
|
11
11
|
@child_class = Document
|
|
12
12
|
@builder_class = DocumentsBuilder
|
|
13
|
-
@type = SoapConstants::DOCUMENT
|
|
14
|
-
@sort_by = SoapConstants::DATE_ASC
|
|
13
|
+
@type = SoapRequest::SoapConstants::DOCUMENT
|
|
14
|
+
@sort_by = SoapRequest::SoapConstants::DATE_ASC
|
|
15
15
|
end
|
|
16
16
|
|
|
17
|
-
def find_each(offset: 0, limit: 500, &
|
|
17
|
+
def find_each(offset: 0, limit: 500, &)
|
|
18
18
|
@more = true
|
|
19
19
|
@offset = offset
|
|
20
20
|
@limit = limit
|
|
21
21
|
|
|
22
22
|
while @more
|
|
23
|
-
build_response.each
|
|
23
|
+
build_response.each(&)
|
|
24
24
|
@offset += @limit
|
|
25
25
|
end
|
|
26
26
|
end
|
|
@@ -4,32 +4,21 @@ module Zm
|
|
|
4
4
|
module Client
|
|
5
5
|
# objectClass: zimbraDomain
|
|
6
6
|
class Domain < Base::Object
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
extend Zm::Relationship
|
|
8
|
+
has_jsns_builder
|
|
9
|
+
include Zm::Utils::HasSoapAdminConnector
|
|
10
|
+
include SoapRequest::RequestMethodsAdmin
|
|
9
11
|
|
|
10
12
|
def create!
|
|
11
13
|
resp = sac.invoke(build_create)
|
|
12
14
|
@id = resp[:CreateDomainResponse][:domain].first[:id]
|
|
13
15
|
end
|
|
14
16
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
+
has_many :accounts, klass: :'Zm::Client::DomainAccountsCollection'
|
|
18
|
+
has_many :distribution_lists, klass: :'Zm::Client::DomainDistributionListsCollection'
|
|
19
|
+
alias distributionlists distribution_lists
|
|
17
20
|
|
|
18
|
-
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
def distributionlists
|
|
22
|
-
return @distributionlists if defined? @distributionlists
|
|
23
|
-
|
|
24
|
-
@distributionlists = DomainDistributionListsCollection.new(self)
|
|
25
|
-
end
|
|
26
|
-
alias distribution_lists distributionlists
|
|
27
|
-
|
|
28
|
-
def resources
|
|
29
|
-
return @resources if defined? @resources
|
|
30
|
-
|
|
31
|
-
@resources = DomainResourcesCollection.new(self)
|
|
32
|
-
end
|
|
21
|
+
has_many :resources, klass: :'Zm::Client::DomainResourcesCollection'
|
|
33
22
|
|
|
34
23
|
def cos
|
|
35
24
|
return nil if zimbraDomainDefaultCOSId.nil?
|
|
@@ -58,12 +47,6 @@ module Zm
|
|
|
58
47
|
|
|
59
48
|
@DKIMPublicTxt = matches.first.first.strip
|
|
60
49
|
end
|
|
61
|
-
|
|
62
|
-
def jsns_builder
|
|
63
|
-
return @jsns_builder if defined? @jsns_builder
|
|
64
|
-
|
|
65
|
-
@jsns_builder = DomainJsnsBuilder.new(self)
|
|
66
|
-
end
|
|
67
50
|
end
|
|
68
51
|
end
|
|
69
52
|
end
|