zm-ruby-client 3.1.2 → 3.2.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 +126 -0
- data/README.md +42 -0
- data/VERSION +1 -1
- data/lib/zm/client/account/account.rb +214 -8
- data/lib/zm/client/account/account_jsns_builder.rb +6 -18
- data/lib/zm/client/account/account_jsns_initializer.rb +1 -1
- data/lib/zm/client/account/accounts_collection.rb +1 -0
- data/lib/zm/client/account/accounts_response.rb +21 -0
- data/lib/zm/client/backup/backups_collection.rb +1 -1
- data/lib/zm/client/backup/backups_response.rb +16 -0
- data/lib/zm/client/base/admin_objects_collection.rb +18 -8
- data/lib/zm/client/base/admin_objects_response.rb +23 -0
- data/lib/zm/client/base/base_jsns_initializer.rb +34 -3
- data/lib/zm/client/base/has_cos.rb +75 -0
- data/lib/zm/client/base/has_zimbra_attributes.rb +133 -0
- data/lib/zm/client/base/object.rb +2 -0
- data/lib/zm/client/base/objects_builder.rb +1 -1
- data/lib/zm/client/base/zimbra_attributes_collection.rb +43 -166
- data/lib/zm/client/base/zimbra_attrs_jsns.rb +44 -0
- data/lib/zm/client/cluster/cluster.rb +16 -9
- data/lib/zm/client/cluster/cluster_config.rb +50 -18
- data/lib/zm/client/contact/contact_jsns_initializer.rb +16 -16
- data/lib/zm/client/contact/contact_members_collection.rb +19 -1
- data/lib/zm/client/cos/cos.rb +183 -11
- data/lib/zm/client/cos/cos_jsns_builder.rb +4 -16
- data/lib/zm/client/cos/cos_jsns_initializer.rb +2 -2
- data/lib/zm/client/cos/coses_collection.rb +1 -0
- data/lib/zm/client/cos/coses_response.rb +27 -0
- data/lib/zm/client/deprecation.rb +24 -0
- data/lib/zm/client/distributionlist/distributionlist.rb +11 -4
- data/lib/zm/client/distributionlist/distributionlist_jsns_builder.rb +4 -16
- data/lib/zm/client/distributionlist/distributionlist_jsns_initializer.rb +1 -2
- data/lib/zm/client/distributionlist/distributionlists_collection.rb +1 -0
- data/lib/zm/client/distributionlist/distributionlists_response.rb +16 -0
- data/lib/zm/client/distributionlist/dls_membership_collection.rb +5 -5
- data/lib/zm/client/domain/domain.rb +51 -10
- data/lib/zm/client/domain/domain_jsns_builder.rb +4 -16
- data/lib/zm/client/domain/domain_jsns_initializer.rb +9 -2
- data/lib/zm/client/domain/domains_collection.rb +1 -0
- data/lib/zm/client/domain/domains_response.rb +23 -0
- data/lib/zm/client/folder/folder.rb +1 -0
- data/lib/zm/client/folder/folder_default.rb +3 -1
- data/lib/zm/client/folder/folder_grants_collection.rb +24 -0
- data/lib/zm/client/folder/folder_jsns_initializer.rb +4 -3
- data/lib/zm/client/folder/folder_retention_policies_collection.rb +8 -0
- data/lib/zm/client/folder/folder_retention_policy.rb +2 -2
- data/lib/zm/client/folder/folder_view_filters.rb +32 -0
- data/lib/zm/client/folder/folders_builder.rb +31 -16
- data/lib/zm/client/folder/folders_collection.rb +21 -13
- data/lib/zm/client/folder/folders_response.rb +14 -0
- data/lib/zm/client/mailbox/mailbox_item_concern.rb +1 -3
- data/lib/zm/client/mailbox/mailbox_item_id.rb +7 -1
- data/lib/zm/client/mountpoint/mount_points_builder.rb +3 -3
- data/lib/zm/client/mountpoint/mount_points_collection.rb +0 -4
- data/lib/zm/client/mountpoint/mount_points_response.rb +10 -0
- data/lib/zm/client/resource/resource.rb +215 -4
- data/lib/zm/client/resource/resource_jsns_builder.rb +4 -16
- data/lib/zm/client/resource/resource_jsns_initializer.rb +1 -1
- data/lib/zm/client/resource/resources_collection.rb +1 -0
- data/lib/zm/client/resource/resources_response.rb +16 -0
- data/lib/zm/client/server/server.rb +28 -2
- data/lib/zm/client/server/servers_collection.rb +1 -0
- data/lib/zm/client/server/servers_response.rb +43 -0
- data/lib/zm/client/upload.rb +2 -0
- data/lib/zm/client/zm_logger.rb +32 -2
- data/lib/zm/client.rb +15 -0
- data/lib/zm/connector/network_error_handler.rb +2 -0
- data/lib/zm/connector/rest_connector.rb +2 -0
- data/lib/zm/connector/soap_account_connector.rb +2 -0
- data/lib/zm/connector/soap_base_connector.rb +11 -7
- data/lib/zm/connector/ssl.rb +10 -0
- data/lib/zm/connector.rb +2 -1
- data/lib/zm/soap_request/request_methods_admin.rb +10 -6
- data/lib/zm/soap_request/soap_context.rb +2 -2
- data/lib/zm/support/cache/file_store.rb +2 -11
- data/lib/zm/support/cache/store.rb +4 -2
- data/lib/zm/utils/log_filter.rb +13 -5
- data/lib/zm-ruby-client.rb +0 -2
- data/sig/zm/client/admin_objects.rbs +119 -11
- data/sig/zm/client/base.rbs +81 -4
- data/sig/zm/client/cluster.rbs +13 -6
- data/sig/zm/client/mailbox.rbs +91 -2
- metadata +18 -17
- data/lib/zm/modules/common/zimbra-attrs.csv +0 -737
|
@@ -8,18 +8,22 @@ module Zm
|
|
|
8
8
|
|
|
9
9
|
COUNT_OBJECT_TYPES = %i[userAccount account alias dl domain cos server calresource internalUserAccount].freeze
|
|
10
10
|
|
|
11
|
-
attr_reader :soap_admin_connector, :config, :
|
|
11
|
+
attr_reader :soap_admin_connector, :config, :type, :version, :release, :buildDate, :host,
|
|
12
12
|
:majorversion, :minorversion, :microversion
|
|
13
13
|
|
|
14
14
|
def initialize(config)
|
|
15
15
|
@config = config
|
|
16
|
-
@
|
|
17
|
-
|
|
18
|
-
@zimbra_attributes = Base::ZimbraAttributesCollection.shared(self)
|
|
16
|
+
@domain_keys = {}
|
|
19
17
|
|
|
20
18
|
@soap_admin_connector = Zm::Connector::SoapAdminConnector.create(@config)
|
|
21
19
|
end
|
|
22
20
|
|
|
21
|
+
def zimbra_attributes
|
|
22
|
+
Deprecation.warn_once('Zm::Client::Cluster#zimbra_attributes',
|
|
23
|
+
'use the class methods zimbra_attrs and attrs_write (Zm::Client::Account.attrs_write)')
|
|
24
|
+
Base::ZimbraAttributesCollection.shared
|
|
25
|
+
end
|
|
26
|
+
|
|
23
27
|
def has_admin_credentials?
|
|
24
28
|
@config.has_admin_credentials?
|
|
25
29
|
end
|
|
@@ -84,11 +88,14 @@ module Zm
|
|
|
84
88
|
alias distributionlists distribution_lists
|
|
85
89
|
|
|
86
90
|
def domain_key(domain_name)
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
91
|
+
return @config.domain_key(domain_name) unless logged?
|
|
92
|
+
|
|
93
|
+
@domain_keys.fetch(domain_name) { @domain_keys[domain_name] = find_domain_key(domain_name) }
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
def clear_domain_keys
|
|
97
|
+
@domain_keys.clear
|
|
98
|
+
self
|
|
92
99
|
end
|
|
93
100
|
|
|
94
101
|
def count_object(type)
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
require 'logger'
|
|
4
|
+
|
|
3
5
|
module Zm
|
|
4
6
|
module Client
|
|
5
7
|
# class config for cluster connection
|
|
6
8
|
class ClusterConfig
|
|
7
9
|
BASE_URL_REGEX = %r{\A(https?://[^/?#]+).*}
|
|
10
|
+
ZIMBRA_VERSION_ADVICE = 'it is not used, call Cluster#infos! to read the server version with Cluster#version'
|
|
8
11
|
|
|
9
|
-
attr_reader :zimbra_admin_url, :zimbra_public_url
|
|
10
|
-
attr_writer :logger
|
|
12
|
+
attr_reader :zimbra_admin_url, :zimbra_public_url, :log_path
|
|
13
|
+
attr_writer :logger
|
|
11
14
|
attr_accessor :zimbra_admin_login, :zimbra_admin_password,
|
|
12
|
-
:domains, :
|
|
15
|
+
:domains, :timeout,
|
|
13
16
|
:ssl_verify, :ssl_ca_file, :ssl_ca_path
|
|
14
17
|
|
|
15
18
|
def initialize(parameters = nil)
|
|
@@ -86,6 +89,7 @@ module Zm
|
|
|
86
89
|
end
|
|
87
90
|
|
|
88
91
|
def init_from_h(parameters)
|
|
92
|
+
parameters = parameters.dup
|
|
89
93
|
@zimbra_admin_login = parameters.delete(:zimbra_admin_login)
|
|
90
94
|
@zimbra_admin_password = parameters.delete(:zimbra_admin_password)
|
|
91
95
|
|
|
@@ -93,9 +97,7 @@ module Zm
|
|
|
93
97
|
|
|
94
98
|
init_public_url_from_parameters(parameters)
|
|
95
99
|
|
|
96
|
-
|
|
97
|
-
@zimbra_version = version
|
|
98
|
-
end
|
|
100
|
+
init_zimbra_version_from_parameters(parameters)
|
|
99
101
|
|
|
100
102
|
if (p_timeout = parameters.delete(:timeout))
|
|
101
103
|
@timeout = p_timeout.to_i
|
|
@@ -103,9 +105,24 @@ module Zm
|
|
|
103
105
|
|
|
104
106
|
init_ssl_from_parameters(parameters)
|
|
105
107
|
|
|
108
|
+
init_log_from_parameters(parameters)
|
|
109
|
+
|
|
106
110
|
init_domains_from_parameters(parameters)
|
|
107
111
|
end
|
|
108
112
|
|
|
113
|
+
def init_zimbra_version_from_parameters(parameters)
|
|
114
|
+
return unless (version = parameters.delete(:zimbra_version))
|
|
115
|
+
|
|
116
|
+
Deprecation.warn_once('the zimbra_version parameter of Zm::Client::ClusterConfig', ZIMBRA_VERSION_ADVICE)
|
|
117
|
+
@zimbra_version = version
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
def init_log_from_parameters(parameters)
|
|
121
|
+
@log_path = parameters.delete(:log_path) if parameters.key?(:log_path)
|
|
122
|
+
@log_level = Logger::Severity.coerce(parameters.delete(:log_level)) if parameters.key?(:log_level)
|
|
123
|
+
@colorize_logging = parameters.delete(:colorize_logging) == true if parameters.key?(:colorize_logging)
|
|
124
|
+
end
|
|
125
|
+
|
|
109
126
|
def init_ssl_from_parameters(parameters)
|
|
110
127
|
@ssl_verify = parameters.delete(:ssl_verify) == true if parameters.key?(:ssl_verify)
|
|
111
128
|
@ssl_ca_file = parameters.delete(:ssl_ca_file) if parameters.key?(:ssl_ca_file)
|
|
@@ -115,13 +132,7 @@ module Zm
|
|
|
115
132
|
def ssl_options
|
|
116
133
|
return Zm::Connector::SSL_VERIFY_NONE unless @ssl_verify
|
|
117
134
|
|
|
118
|
-
|
|
119
|
-
verify: true,
|
|
120
|
-
verify_hostname: true,
|
|
121
|
-
verify_mode: OpenSSL::SSL::VERIFY_PEER,
|
|
122
|
-
ca_file: @ssl_ca_file,
|
|
123
|
-
ca_path: @ssl_ca_path
|
|
124
|
-
}.compact
|
|
135
|
+
Zm::Connector::SSL_VERIFY_PEER.merge(ca_file: @ssl_ca_file, ca_path: @ssl_ca_path).compact
|
|
125
136
|
end
|
|
126
137
|
|
|
127
138
|
def init_domains_from_parameters(parameters)
|
|
@@ -187,13 +198,23 @@ module Zm
|
|
|
187
198
|
end
|
|
188
199
|
|
|
189
200
|
def zimbra_attributes_path
|
|
190
|
-
|
|
201
|
+
Deprecation.warn_once('Zm::Client::ClusterConfig#zimbra_attributes_path', 'it always returns nil')
|
|
202
|
+
nil
|
|
191
203
|
end
|
|
192
204
|
|
|
193
|
-
def zimbra_attributes_path=(
|
|
194
|
-
|
|
205
|
+
def zimbra_attributes_path=(_path)
|
|
206
|
+
Deprecation.warn_once('Zm::Client::ClusterConfig#zimbra_attributes_path=',
|
|
207
|
+
'declare custom attributes with zimbra_attr (Zm::Client::Account.zimbra_attr :myAttr)')
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
def zimbra_version
|
|
211
|
+
Deprecation.warn_once('Zm::Client::ClusterConfig#zimbra_version', ZIMBRA_VERSION_ADVICE)
|
|
212
|
+
@zimbra_version
|
|
213
|
+
end
|
|
195
214
|
|
|
196
|
-
|
|
215
|
+
def zimbra_version=(version)
|
|
216
|
+
Deprecation.warn_once('Zm::Client::ClusterConfig#zimbra_version=', ZIMBRA_VERSION_ADVICE)
|
|
217
|
+
@zimbra_version = version
|
|
197
218
|
end
|
|
198
219
|
|
|
199
220
|
def logger
|
|
@@ -201,11 +222,22 @@ module Zm
|
|
|
201
222
|
|
|
202
223
|
@logger = ZmLogger.new(@log_path).tap do |log|
|
|
203
224
|
log.level = @log_level
|
|
204
|
-
log.colorize
|
|
225
|
+
log.colorize = @colorize_logging
|
|
205
226
|
end
|
|
206
227
|
end
|
|
207
228
|
|
|
229
|
+
def log_path=(path)
|
|
230
|
+
@log_path = path
|
|
231
|
+
@logger.log_path = path if defined?(@logger) && @logger.is_a?(ZmLogger)
|
|
232
|
+
end
|
|
233
|
+
|
|
234
|
+
def colorize_logging=(value)
|
|
235
|
+
@colorize_logging = value
|
|
236
|
+
@logger.colorize = value if defined?(@logger) && @logger.is_a?(ZmLogger)
|
|
237
|
+
end
|
|
238
|
+
|
|
208
239
|
def log_level=(level)
|
|
240
|
+
level = Logger::Severity.coerce(level)
|
|
209
241
|
return if level == @log_level
|
|
210
242
|
|
|
211
243
|
logger.level = @log_level = level
|
|
@@ -4,6 +4,9 @@ module Zm
|
|
|
4
4
|
module Client
|
|
5
5
|
# class for account contact
|
|
6
6
|
class ContactJsnsInitializer
|
|
7
|
+
SETTERS = Hash.new { |h, name| h[name] = :"#{name}=" }
|
|
8
|
+
CUSTOM_KEY_REGEX = /\A[a-zA-Z_][a-zA-Z0-9_]*\z/
|
|
9
|
+
|
|
7
10
|
class << self
|
|
8
11
|
def create(parent, json)
|
|
9
12
|
item = Contact.new(parent)
|
|
@@ -16,10 +19,7 @@ module Zm
|
|
|
16
19
|
item.name = json.delete(:fileAsStr)
|
|
17
20
|
item.tn = json.delete(:tn)
|
|
18
21
|
|
|
19
|
-
if json[:_attrs].is_a?(Hash)
|
|
20
|
-
make_custom_keys(json[:_attrs], item)
|
|
21
|
-
init_by_attrs(json[:_attrs], item)
|
|
22
|
-
end
|
|
22
|
+
init_by_attrs(json[:_attrs], item) if json[:_attrs].is_a?(Hash)
|
|
23
23
|
|
|
24
24
|
if item.group?
|
|
25
25
|
item.extend(Zm::Client::ModGroupContact)
|
|
@@ -29,22 +29,22 @@ module Zm
|
|
|
29
29
|
item
|
|
30
30
|
end
|
|
31
31
|
|
|
32
|
-
def make_custom_keys(attrs, item)
|
|
33
|
-
custom_keys = attrs.keys - item.all_instance_variable_keys
|
|
34
|
-
return if custom_keys.empty?
|
|
35
|
-
|
|
36
|
-
item.class.attr_accessor(*custom_keys)
|
|
37
|
-
rescue StandardError => _e
|
|
38
|
-
nil
|
|
39
|
-
end
|
|
40
|
-
|
|
41
32
|
def init_by_attrs(attrs, item)
|
|
42
|
-
attrs.each do |
|
|
43
|
-
|
|
44
|
-
|
|
33
|
+
attrs.each do |key, value|
|
|
34
|
+
setter = SETTERS[key]
|
|
35
|
+
|
|
36
|
+
if item.respond_to?(setter)
|
|
37
|
+
item.public_send(setter, value)
|
|
38
|
+
elsif custom_key?(key)
|
|
39
|
+
item.add_custom_property(key, value)
|
|
40
|
+
end
|
|
45
41
|
end
|
|
46
42
|
end
|
|
47
43
|
|
|
44
|
+
def custom_key?(key)
|
|
45
|
+
CUSTOM_KEY_REGEX.match?(key) && !ContactJsnsBuilder::EXCLUDE_INSTANCE_VARIABLE_KEYS.include?(:"@#{key}")
|
|
46
|
+
end
|
|
47
|
+
|
|
48
48
|
def init_members_from_json(m, item)
|
|
49
49
|
return if m.nil?
|
|
50
50
|
|
|
@@ -3,13 +3,31 @@
|
|
|
3
3
|
module Zm
|
|
4
4
|
module Client
|
|
5
5
|
class ContactMembersCollection
|
|
6
|
-
|
|
6
|
+
include Zm::Utils::MissingMethodStaticCollection
|
|
7
|
+
|
|
8
|
+
attr_writer :all
|
|
7
9
|
|
|
8
10
|
def initialize(parent)
|
|
9
11
|
@parent = parent
|
|
10
12
|
@all = []
|
|
11
13
|
end
|
|
12
14
|
|
|
15
|
+
def internals
|
|
16
|
+
@all.select(&:internal?)
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def shared
|
|
20
|
+
@all.select(&:shared?)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def frees
|
|
24
|
+
@all.select(&:free?)
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def ldaps
|
|
28
|
+
@all.select(&:ldap?)
|
|
29
|
+
end
|
|
30
|
+
|
|
13
31
|
def add(new_member)
|
|
14
32
|
return false unless new_member.is_a?(Zm::Client::ContactMember)
|
|
15
33
|
|
data/lib/zm/client/cos/cos.rb
CHANGED
|
@@ -8,19 +8,193 @@ module Zm
|
|
|
8
8
|
has_jsns_builder
|
|
9
9
|
|
|
10
10
|
include Zm::Utils::HasSoapAdminConnector
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
extend Base::HasZimbraAttributes
|
|
12
|
+
|
|
13
|
+
zimbra_attr %i[
|
|
14
|
+
cn description zimbraNotes zimbraMailQuota zimbraPrefSaveToSent zimbraPasswordMinLength zimbraPasswordMaxLength
|
|
15
|
+
zimbraPasswordMinAge zimbraPasswordMaxAge zimbraPasswordEnforceHistory zimbraPasswordLocked
|
|
16
|
+
zimbraPrefGroupMailBy zimbraPrefIncludeSpamInSearch zimbraPrefIncludeTrashInSearch zimbraPrefMailItemsPerPage
|
|
17
|
+
zimbraPrefUseKeyboardShortcuts zimbraPrefMailInitialSearch zimbraPrefSentMailFolder zimbraMailTrashLifetime
|
|
18
|
+
zimbraMailSpamLifetime zimbraMailMessageLifetime zimbraContactMaxNumEntries zimbraAuthTokenLifetime
|
|
19
|
+
zimbraAdminAuthTokenLifetime zimbraMailMinPollingInterval zimbraPrefMailPollingInterval zimbraAttachmentsBlocked
|
|
20
|
+
zimbraAttachmentsViewInHtmlOnly zimbraPrefForwardReplyPrefixChar zimbraPrefAutoAddAddressEnabled
|
|
21
|
+
zimbraPrefReplyIncludeOriginalText zimbraPrefForwardIncludeOriginalText zimbraFeatureContactsEnabled
|
|
22
|
+
zimbraFeatureCalendarEnabled zimbraFeatureTaggingEnabled zimbraFeatureSavedSearchesEnabled
|
|
23
|
+
zimbraFeatureConversationsEnabled zimbraFeatureChangePasswordEnabled zimbraFeatureInitialSearchPreferenceEnabled
|
|
24
|
+
zimbraFeatureFiltersEnabled zimbraPrefDedupeMessagesSentToSelf zimbraPrefMessageViewHtmlPreferred
|
|
25
|
+
zimbraMailIdleSessionTimeout zimbraPrefContactsPerPage zimbraFeatureGalEnabled zimbraNewMailNotificationFrom
|
|
26
|
+
zimbraNewMailNotificationSubject zimbraNewMailNotificationBody zimbraPrefMailSignatureStyle
|
|
27
|
+
zimbraAttachmentsIndexingEnabled zimbraImapEnabled zimbraPop3Enabled zimbraPrefShowFragments
|
|
28
|
+
zimbraPrefComposeInNewWindow zimbraPrefComposeFormat zimbraPrefForwardReplyInOriginalFormat
|
|
29
|
+
zimbraFeatureHtmlComposeEnabled zimbraPrefShowSearchString zimbraPrefTimeZoneId
|
|
30
|
+
zimbraPrefUseTimeZoneListInCalendar zimbraPrefCalendarInitialView zimbraPrefImapSearchFoldersEnabled
|
|
31
|
+
zimbraPrefHtmlEditorDefaultFontFamily zimbraPrefHtmlEditorDefaultFontSize zimbraPrefHtmlEditorDefaultFontColor
|
|
32
|
+
zimbraPrefCalendarFirstDayOfWeek zimbraPrefCalendarNotifyDelegatedChanges zimbraPrefCalendarUseQuickAdd
|
|
33
|
+
zimbraPrefCalendarAlwaysShowMiniCal zimbraZimletAvailableZimlets zimbraProxyAllowedDomains
|
|
34
|
+
zimbraFeatureViewInHtmlEnabled zimbraFeatureSharingEnabled zimbraPrefCalendarApptReminderWarningTime
|
|
35
|
+
zimbraFeatureMailForwardingEnabled zimbraLocale zimbraFeatureMobileSyncEnabled zimbraFeatureSkinChangeEnabled
|
|
36
|
+
zimbraPrefSkin zimbraFeatureGalAutoCompleteEnabled zimbraAvailableSkin zimbraFeatureOutOfOfficeReplyEnabled
|
|
37
|
+
zimbraFeatureNewMailNotificationEnabled zimbraPrefGalAutoCompleteEnabled zimbraPasswordLockoutEnabled
|
|
38
|
+
zimbraPasswordLockoutDuration zimbraPasswordLockoutMaxFailures zimbraPasswordLockoutFailureLifetime
|
|
39
|
+
zimbraPrefOutOfOfficeCacheDuration zimbraPasswordMinUpperCaseChars zimbraPasswordMinLowerCaseChars
|
|
40
|
+
zimbraPasswordMinPunctuationChars zimbraPasswordMinNumericChars zimbraTextAnalyzer zimbraPrefUseRfc2231
|
|
41
|
+
zimbraPrefShortcuts zimbraDomainAdminMaxMailQuota zimbraPrefForwardReplyFormat zimbraIdentityMaxNumEntries
|
|
42
|
+
zimbraFeatureIdentitiesEnabled zimbraFeaturePop3DataSourceEnabled zimbraDataSourceMaxNumEntries
|
|
43
|
+
zimbraAllowAnyFromAddress zimbraArchiveAccountNameTemplate zimbraArchiveAccountDateTemplate
|
|
44
|
+
zimbraFeatureTasksEnabled zimbraSyncWindowSize zimbraPrefCalendarDayHourStart zimbraPrefCalendarDayHourEnd
|
|
45
|
+
zimbraPrefLocale zimbraFeatureVoiceEnabled zimbraAdminSavedSearches zimbraFeaturePortalEnabled zimbraPortalName
|
|
46
|
+
zimbraFeatureOptionsEnabled zimbraPrefClientType zimbraMailSignatureMaxLength zimbraDataSourcePollingInterval
|
|
47
|
+
zimbraPrefWarnOnExit zimbraPrefMailDefaultCharset zimbraPrefDeleteInviteOnReply zimbraPrefShowSelectionCheckbox
|
|
48
|
+
zimbraFeatureGroupCalendarEnabled zimbraNotebookMaxRevisions zimbraQuotaWarnPercent zimbraQuotaWarnInterval
|
|
49
|
+
zimbraQuotaWarnMessage zimbraAvailableLocale zimbraFeatureMailEnabled zimbraSignatureMaxNumEntries
|
|
50
|
+
zimbraFeatureSignaturesEnabled zimbraFeatureBriefcasesEnabled zimbraFeatureFlaggingEnabled
|
|
51
|
+
zimbraPrefOpenMailInNewWindow zimbraPrefDisplayExternalImages zimbraFeatureInstantNotify
|
|
52
|
+
zimbraSignatureMinNumEntries zimbraDataSourceMinPollingInterval zimbraPrefVoiceItemsPerPage
|
|
53
|
+
zimbraFeatureMailUpsellEnabled zimbraFeatureMailUpsellURL zimbraFeatureContactsUpsellEnabled
|
|
54
|
+
zimbraFeatureContactsUpsellURL zimbraFeatureCalendarUpsellEnabled zimbraFeatureCalendarUpsellURL
|
|
55
|
+
zimbraFeatureVoiceUpsellEnabled zimbraFeatureVoiceUpsellURL zimbraPrefInboxUnreadLifetime
|
|
56
|
+
zimbraPrefInboxReadLifetime zimbraPrefSentLifetime zimbraPrefJunkLifetime zimbraPrefTrashLifetime
|
|
57
|
+
zimbraFeatureZimbraAssistantEnabled zimbraPrefAutoSaveDraftInterval zimbraFeatureMailPriorityEnabled
|
|
58
|
+
zimbraFeatureImapDataSourceEnabled zimbraJunkMessagesIndexingEnabled zimbraFeatureComposeInNewWindowEnabled
|
|
59
|
+
zimbraFeatureOpenMailInNewWindowEnabled zimbraSpamApplyUserFilters zimbraFreebusyExchangeURL
|
|
60
|
+
zimbraFreebusyExchangeAuthUsername zimbraFreebusyExchangeAuthPassword zimbraFreebusyExchangeUserOrg
|
|
61
|
+
zimbraFreebusyExchangeAuthScheme zimbraInterceptAddress zimbraInterceptSendHeadersOnly zimbraInterceptFrom
|
|
62
|
+
zimbraInterceptSubject zimbraInterceptBody zimbraBatchedIndexingSize zimbraFreebusyExchangeCachedIntervalStart
|
|
63
|
+
zimbraFreebusyExchangeCachedInterval zimbraFeatureNewAddrBookEnabled zimbraPrefTagTreeOpen
|
|
64
|
+
zimbraPrefSearchTreeOpen zimbraPrefGalSearchEnabled zimbraPrefFolderTreeOpen zimbraPrefZimletTreeOpen
|
|
65
|
+
zimbraNotebookSanitizeHtml zimbraPrefMarkMsgRead zimbraPrefPop3DownloadSince zimbraACE
|
|
66
|
+
zimbraPrefMailSoundsEnabled zimbraPrefCalendarReminderSoundsEnabled zimbraPrefAdvancedClientEnforceMinDisplay
|
|
67
|
+
zimbraPrefMailFlashTitle zimbraPrefMailFlashIcon zimbraPrefCalendarReminderFlashTitle
|
|
68
|
+
zimbraPrefCalendarAllowForwardedInvite zimbraPrefCalendarAllowPublishMethodInvite
|
|
69
|
+
zimbraPrefStandardClientAccessibilityMode zimbraPrefListViewColumns zimbraPrefCalendarAllowCancelEmailToSelf
|
|
70
|
+
zimbraFeatureMailForwardingInFiltersEnabled zimbraCalendarMaxRevisions zimbraFeatureGalSyncEnabled
|
|
71
|
+
zimbraMailPurgeUseChangeDateForTrash zimbraPrefMandatorySpellCheckEnabled zimbraFreebusyLocalMailboxNotActive
|
|
72
|
+
zimbraContactRankingTableSize zimbraPrefSharedAddrBookAutoCompleteEnabled zimbraPrefZimlets
|
|
73
|
+
zimbraDataSourcePop3PollingInterval zimbraDataSourceImapPollingInterval zimbraDataSourceLivePollingInterval
|
|
74
|
+
zimbraDataSourceRssPollingInterval zimbraPrefFolderColorEnabled zimbraFeatureDiscardInFiltersEnabled
|
|
75
|
+
zimbraDataSourceCaldavPollingInterval zimbraDataSourceYabPollingInterval zimbraSmtpEnableTrace
|
|
76
|
+
zimbraMailWhitelistMaxNumEntries zimbraMailBlacklistMaxNumEntries zimbraPrefReadingPaneLocation
|
|
77
|
+
zimbraFeatureConfirmationPageEnabled zimbraPrefMailToasterEnabled zimbraPrefCalendarToasterEnabled
|
|
78
|
+
zimbraPrefIMToasterEnabled zimbraCalendarCalDavSyncStart zimbraCalendarCalDavSyncEnd
|
|
79
|
+
zimbraCalendarCalDavSharedFolderCacheDuration zimbraPrefConversationOrder
|
|
80
|
+
zimbraDataSourceCalendarPollingInterval zimbraFeatureReadReceiptsEnabled zimbraPrefMailSendReadReceipts
|
|
81
|
+
zimbraDataSourceGalPollingInterval zimbraContactAutoCompleteMaxResults zimbraPrefCalendarApptVisibility
|
|
82
|
+
zimbraFeatureMobilePolicyEnabled zimbraMobilePolicyAllowNonProvisionableDevices
|
|
83
|
+
zimbraMobilePolicyAllowPartialProvisioning zimbraMobilePolicyRefreshInterval
|
|
84
|
+
zimbraMobilePolicyDevicePasswordEnabled zimbraMobilePolicyMinDevicePasswordLength
|
|
85
|
+
zimbraMobilePolicyAllowSimpleDevicePassword zimbraMobilePolicyAlphanumericDevicePasswordRequired
|
|
86
|
+
zimbraMobilePolicyMinDevicePasswordComplexCharacters zimbraMobilePolicyDevicePasswordExpiration
|
|
87
|
+
zimbraMobilePolicyDevicePasswordHistory zimbraMobilePolicyMaxInactivityTimeDeviceLock
|
|
88
|
+
zimbraMobilePolicyMaxDevicePasswordFailedAttempts zimbraMobilePolicyPasswordRecoveryEnabled
|
|
89
|
+
zimbraPrefCalendarAutoAddInvites zimbraPrefCalendarSendInviteDeniedAutoReply zimbraPrefConvReadingPaneLocation
|
|
90
|
+
zimbraMaxMailItemsPerPage zimbraMaxContactsPerPage zimbraMaxVoiceItemsPerPage
|
|
91
|
+
zimbraPrefCalendarShowPastDueReminders zimbraGalSyncAccountBasedAutoCompleteEnabled
|
|
92
|
+
zimbraPrefAppleIcalDelegationEnabled zimbraPrefAdminConsoleWarnOnExit zimbraMailForwardingAddressMaxLength
|
|
93
|
+
zimbraMailForwardingAddressMaxNumAddrs zimbraPrefSpellDictionary zimbraPrefShowCalendarWeek
|
|
94
|
+
zimbraPrefMailSelectAfterDelete zimbraWebClientShowOfflineLink zimbraPrefAccountTreeOpen
|
|
95
|
+
zimbraFeatureVoiceChangePinEnabled zimbraFeatureManageZimlets zimbraFeatureBriefcaseSpreadsheetEnabled
|
|
96
|
+
zimbraFeatureBriefcaseSlidesEnabled zimbraFeatureBriefcaseDocsEnabled zimbraPrefGetMailAction
|
|
97
|
+
zimbraPrefMailFoldersCheckedForNewMsgIndicator zimbraPrefSpellIgnoreWord zimbraPrefDisabledZimlets
|
|
98
|
+
zimbraSmtpRestrictEnvelopeFrom zimbraPrefItemsPerVirtualPage zimbraCalendarResourceDoubleBookingAllowed
|
|
99
|
+
zimbraContactEmailFields zimbraPrefCalendarApptAllowAtendeeEdit zimbraPrefAutoCompleteQuickCompletionOnComma
|
|
100
|
+
zimbraCalendarShowResourceTabs zimbraPrefDefaultPrintFontSize zimbraMailAllowReceiveButNotSendWhenOverQuota
|
|
101
|
+
zimbraPrefCalendarWorkingHours zimbraMailPurgeUseChangeDateForSpam zimbraFeatureMAPIConnectorEnabled
|
|
102
|
+
zimbraDumpsterEnabled zimbraMailDumpsterLifetime zimbraFeatureDistributionListExpandMembersEnabled
|
|
103
|
+
zimbraFeatureMailSendLaterEnabled zimbraPrefMailTrustedSenderList zimbraMailTrustedSenderListMaxNumEntries
|
|
104
|
+
zimbraFeatureFreeBusyViewEnabled zimbraFeatureCalendarReminderDeviceEmailEnabled
|
|
105
|
+
zimbraPrefTasksReadingPaneLocation zimbraPrefBriefcaseReadingPaneLocation zimbraFilterBatchSize
|
|
106
|
+
zimbraFilterSleepInterval zimbraMailThreadingAlgorithm zimbraPasswordMinAlphaChars zimbraPasswordAllowedChars
|
|
107
|
+
zimbraFeatureContactsDetailedSearchEnabled zimbraPrefPop3DeleteOption zimbraPrefPop3IncludeSpam
|
|
108
|
+
zimbraFeatureAntispamEnabled zimbraFeatureAdminMailEnabled zimbraPrefShortEmailAddress
|
|
109
|
+
zimbraFeatureManageSMIMECertificateEnabled zimbraFeatureImportFolderEnabled zimbraFeatureExportFolderEnabled
|
|
110
|
+
zimbraFeatureSMIMEEnabled zimbraPrefCalendarDefaultApptDuration zimbraPrefSortOrder
|
|
111
|
+
zimbraPrefCalendarViewTimeInterval zimbraPrefCalendarShowDeclinedMeetings zimbraPrefFileSharingApplication
|
|
112
|
+
zimbraPrefMessageIdDedupingEnabled zimbraMobileSmartForwardRFC822Enabled zimbraArchiveEnabled
|
|
113
|
+
zimbraPrefSpellIgnoreAllCaps zimbraDefaultFolderFlags zimbraMailHighlightObjectsMaxSize
|
|
114
|
+
zimbraPrefMailRequestReadReceipts zimbraCalendarLocationDisabledFields
|
|
115
|
+
zimbraCalendarKeepExceptionsOnSeriesTimeChange zimbraPrefOutOfOfficeStatusAlertOnLogin zimbraPrefFont
|
|
116
|
+
zimbraPasswordMinDigitsOrPuncs zimbraPasswordAllowedPunctuationChars zimbraExternalShareLifetime
|
|
117
|
+
zimbraExternalSharingEnabled zimbraExternalShareWhitelistDomain zimbraExternalShareDomainWhitelistEnabled
|
|
118
|
+
zimbraStandardClientCustomPrefTabsEnabled zimbraStandardClientCustomPrefTab zimbraFeaturePriorityInboxEnabled
|
|
119
|
+
zimbraFeatureSocialFiltersEnabled zimbraPrefComposeDirection zimbraPrefShowComposeDirection
|
|
120
|
+
zimbraMobilePolicyAllowStorageCard zimbraMobilePolicyAllowCamera zimbraMobilePolicyRequireDeviceEncryption
|
|
121
|
+
zimbraMobilePolicyAllowUnsignedApplications zimbraMobilePolicyAllowUnsignedInstallationPackages
|
|
122
|
+
zimbraMobilePolicyAllowWiFi zimbraMobilePolicyAllowTextMessaging zimbraMobilePolicyAllowPOPIMAPEmail
|
|
123
|
+
zimbraMobilePolicyAllowBluetooth zimbraMobilePolicyAllowIrDA zimbraMobilePolicyRequireManualSyncWhenRoaming
|
|
124
|
+
zimbraMobilePolicyAllowDesktopSync zimbraMobilePolicyMaxCalendarAgeFilter zimbraMobilePolicyAllowHTMLEmail
|
|
125
|
+
zimbraMobilePolicyMaxEmailAgeFilter zimbraMobilePolicyMaxEmailBodyTruncationSize
|
|
126
|
+
zimbraMobilePolicyMaxEmailHTMLBodyTruncationSize zimbraMobilePolicyRequireSignedSMIMEMessages
|
|
127
|
+
zimbraMobilePolicyRequireEncryptedSMIMEMessages zimbraMobilePolicyRequireSignedSMIMEAlgorithm
|
|
128
|
+
zimbraMobilePolicyRequireEncryptionSMIMEAlgorithm zimbraMobilePolicyAllowSMIMEEncryptionAlgorithmNegotiation
|
|
129
|
+
zimbraMobilePolicyAllowSMIMESoftCerts zimbraMobilePolicyAllowBrowser zimbraMobilePolicyAllowConsumerEmail
|
|
130
|
+
zimbraMobilePolicyAllowRemoteDesktop zimbraMobilePolicyAllowInternetSharing
|
|
131
|
+
zimbraMobilePolicyUnapprovedInROMApplication zimbraMobilePolicyApprovedApplication
|
|
132
|
+
zimbraMobilePolicySuppressDeviceEncryption zimbraFileExpirationWarningThreshold zimbraFileLifetime
|
|
133
|
+
zimbraFileExpirationWarningSubject zimbraFileExpirationWarningBody zimbraFileDeletionNotificationSubject
|
|
134
|
+
zimbraFileDeletionNotificationBody zimbraDumpsterUserVisibleAge zimbraDumpsterPurgeEnabled
|
|
135
|
+
zimbraInternalSendersDomain zimbraPrefExternalSendersType zimbraPrefTasksFilterBy zimbraFileVersioningEnabled
|
|
136
|
+
zimbraFileVersionLifetime zimbraPrefIncludeSharedItemsInSearch zimbraShareLifetime
|
|
137
|
+
zimbraFileUploadMaxSizePerFile zimbraPublicSharingEnabled zimbraPublicShareLifetime zimbraFileShareLifetime
|
|
138
|
+
zimbraFileExternalShareLifetime zimbraFilePublicShareLifetime zimbraExternalAccountLifetimeAfterDisabled
|
|
139
|
+
zimbraFeatureExternalFeedbackEnabled zimbraFeatureCrocodocEnabled zimbraFileAndroidCrashReportingEnabled
|
|
140
|
+
zimbraFeatureSocialcastEnabled zimbraSocialcastURL zimbraFileIOSCrashReportingEnabled
|
|
141
|
+
zimbraZimletLoadSynchronously zimbraPrefConvShowCalendar zimbraDevicePasscodeEnabled
|
|
142
|
+
zimbraDeviceAllowedPasscodeLockoutDuration zimbraDevicePasscodeLockoutDuration zimbraDeviceLockWhenInactive
|
|
143
|
+
zimbraDeviceFileOpenWithEnabled zimbraUCServiceId zimbraMobilePolicyApprovedApplicationList
|
|
144
|
+
zimbraDeviceOfflineCacheEnabled zimbraDataSourceImportOnLogin zimbraMobileNotificationEnabled
|
|
145
|
+
zimbraMobileNotificationAdminAddress zimbraMobileAttachSkippedItemEnabled zimbraPrefColorMessagesEnabled
|
|
146
|
+
zimbraMobileMetadataMaxSizeEnabled zimbraMobileItemsToTrackPerFolderMaxSize zimbraPrefSpellIgnorePattern
|
|
147
|
+
zimbraTouchJSErrorTrackingEnabled zimbraTouchJSErrorTrackingKey zimbraForceClearCookies
|
|
148
|
+
zimbraFeatureDistributionListFolderEnabled zimbraMobileSyncKeyFormatConvertedFolders zimbraConverterHints
|
|
149
|
+
zimbraFilePreviewMaxSize zimbraMobilePolicyRequireStorageCardEncryption zimbraPrefFontSize
|
|
150
|
+
zimbraDeviceCalendarSoftDeleteExcludePattern zimbraWebClientOfflineSyncMaxDays zimbraMobileOutlookSyncEnabled
|
|
151
|
+
zimbraFeatureFromDisplayEnabled zimbraFeatureSocialEnabled zimbraFeatureSocialExternalEnabled
|
|
152
|
+
zimbraFeatureSocialExternalURL zimbraMobileShareContactEnabled zimbraMobileForceSamsungProtocol25
|
|
153
|
+
zimbraMobileForceProtocol25 zimbraFeatureEwsEnabled zimbraFeatureWebClientOfflineAccessEnabled
|
|
154
|
+
zimbraFeatureSocialName zimbraPrefCalendarAllowedTargetsForInviteDeniedAutoReply zimbraMobileTombstoneEnabled
|
|
155
|
+
zimbraLogOutFromAllServers zimbraFeatureTouchClientEnabled zimbraCommunityAPIClientID
|
|
156
|
+
zimbraCommunityAPIClientSecret zimbraCommunityUsernameMapping zimbraCommunityBaseURL zimbraCommunityHomeURL
|
|
157
|
+
zimbraMobileSyncRedoMaxAttempts zimbraPrefUseSendMsgShortcut zimbraPrefDelegatedSendSaveTarget
|
|
158
|
+
zimbraFeatureAdminPreferencesEnabled zimbraPrefShowChatsFolderInMail zimbraFeatureTwoFactorAuthRequired
|
|
159
|
+
zimbraTwoFactorAuthNumScratchCodes zimbraMaxAppSpecificPasswords
|
|
160
|
+
zimbraRevokeAppSpecificPasswordsOnPasswordChange zimbraAppSpecificPasswordDuration
|
|
161
|
+
zimbraPrefShowAllNewMailNotifications zimbraFeatureAppSpecificPasswordsEnabled
|
|
162
|
+
zimbraTwoFactorAuthTrustedDeviceTokenLifetime zimbraPrefZmgPushNotificationEnabled zimbraPrefTabInEditorEnabled
|
|
163
|
+
zimbraFeatureDataSourcePurgingEnabled zimbraDataSourceQuota zimbraDataSourceTotalQuota
|
|
164
|
+
zimbraNewMailNotificationMessage zimbraTwoFactorAuthTokenLifetime zimbraTwoFactorAuthEnablementTokenLifetime
|
|
165
|
+
zimbraZimletUserPropertiesMaxNumEntries zimbraDisableCrossAccountConversationThreading
|
|
166
|
+
zimbraFeatureTwoFactorAuthAvailable zimbraPrefChatPlaySound zimbraFeatureChatEnabled
|
|
167
|
+
zimbraFeatureTrustedDevicesEnabled zimbraMobileSearchMimeSupportEnabled zimbraExportMaxDays
|
|
168
|
+
zimbraPrefChatEnabled zimbraTwoFactorAuthLockoutMaxFailures zimbraFeatureMobileGatewayEnabled
|
|
169
|
+
zimbraPasswordLockoutSuppressionCacheSize zimbraPasswordLockoutSuppressionEnabled
|
|
170
|
+
zimbraPasswordLockoutSuppressionProtocols zimbraChatHistoryEnabled zimbraSieveRejectMailEnabled
|
|
171
|
+
zimbraSieveNotifyActionRFCCompliant zimbraAdminSieveScriptBefore zimbraAdminSieveScriptAfter
|
|
172
|
+
zimbraAdminOutgoingSieveScriptBefore zimbraAdminOutgoingSieveScriptAfter zimbraSieveRequireControlEnabled
|
|
173
|
+
zimbraSieveEditHeaderEnabled zimbraSieveImmutableHeaders zimbraFeatureMarkMailForwardedAsRead
|
|
174
|
+
zimbraFeatureAddressVerificationEnabled zimbraFeatureAddressVerificationExpiry zimbraFeatureContactBackupEnabled
|
|
175
|
+
zimbraPrefOutOfOfficeSpecificDomains zimbraPrefDisplayTimeInMailList zimbraMailHostPool
|
|
176
|
+
zimbraFeatureAdvancedSearchEnabled zimbraFeatureResetPasswordStatus zimbraFeatureResetPasswordSuspensionTime
|
|
177
|
+
zimbraPasswordRecoveryMaxAttempts zimbraPrefDefaultCalendarId zimbraRecoveryAccountCodeValidity
|
|
178
|
+
zimbraResetPasswordRecoveryCodeExpiry zimbraShowClientTOS
|
|
179
|
+
]
|
|
180
|
+
|
|
181
|
+
zimbra_attr %i[zimbraId zimbraCreateTimestamp], readonly: true
|
|
182
|
+
|
|
183
|
+
def modify!(force: false)
|
|
184
|
+
return false unless force || zimbra_attrs_changed?
|
|
185
|
+
|
|
186
|
+
sac.invoke(build_modify(force:))
|
|
187
|
+
clear_zimbra_attrs_changes
|
|
14
188
|
true
|
|
15
189
|
end
|
|
16
190
|
|
|
17
|
-
def build_modify
|
|
18
|
-
jsns_builder.to_update
|
|
191
|
+
def build_modify(force: false)
|
|
192
|
+
jsns_builder.to_update(force:)
|
|
19
193
|
end
|
|
20
194
|
|
|
21
|
-
def update!(hash = nil, update_attributes: true, **attrs)
|
|
195
|
+
def update!(hash = nil, update_attributes: true, force: false, **attrs)
|
|
22
196
|
hash = hash.nil? ? attrs : hash.merge(attrs)
|
|
23
|
-
return false if hash
|
|
197
|
+
return false if zimbra_attrs_to_update(hash, force).empty?
|
|
24
198
|
|
|
25
199
|
do_update!(hash)
|
|
26
200
|
|
|
@@ -32,12 +206,14 @@ module Zm
|
|
|
32
206
|
def do_update_attributes(hash)
|
|
33
207
|
hash.each do |key, value|
|
|
34
208
|
update_attribute(key, value)
|
|
209
|
+
forget_zimbra_attr_change(key)
|
|
35
210
|
end
|
|
36
211
|
end
|
|
37
212
|
|
|
38
213
|
def create!
|
|
39
214
|
resp = sac.invoke(build_create)
|
|
40
215
|
|
|
216
|
+
clear_zimbra_attrs_changes
|
|
41
217
|
@id = resp[:CreateCosResponse][:cos].first[:id]
|
|
42
218
|
end
|
|
43
219
|
|
|
@@ -66,10 +242,6 @@ module Zm
|
|
|
66
242
|
has_many :domains, klass: :'Zm::Client::CosDomainsCollection'
|
|
67
243
|
has_many :accounts, klass: :'Zm::Client::CosAccountsCollection'
|
|
68
244
|
|
|
69
|
-
def attrs_write
|
|
70
|
-
@parent.zimbra_attributes.all_cos_attrs_writable_names
|
|
71
|
-
end
|
|
72
|
-
|
|
73
245
|
private
|
|
74
246
|
|
|
75
247
|
def do_update!(hash)
|
|
@@ -4,6 +4,8 @@ module Zm
|
|
|
4
4
|
module Client
|
|
5
5
|
# class for cos jsns builder
|
|
6
6
|
class CosJsnsBuilder
|
|
7
|
+
include Base::ZimbraAttrsJsns
|
|
8
|
+
|
|
7
9
|
def initialize(item)
|
|
8
10
|
@item = item
|
|
9
11
|
end
|
|
@@ -25,13 +27,13 @@ module Zm
|
|
|
25
27
|
soap_request
|
|
26
28
|
end
|
|
27
29
|
|
|
28
|
-
def to_update
|
|
30
|
+
def to_update(force: false)
|
|
29
31
|
soap_request = SoapRequest::SoapElement.admin(Zm::SoapRequest::SoapAdminConstants::MODIFY_COS_REQUEST)
|
|
30
32
|
node_cos = SoapRequest::SoapElement.create(SoapRequest::SoapConstants::ID)
|
|
31
33
|
.add_content(@item.id)
|
|
32
34
|
soap_request.add_node(node_cos)
|
|
33
35
|
|
|
34
|
-
|
|
36
|
+
attrs_to_update_h(force).each do |key, values|
|
|
35
37
|
values.each do |value|
|
|
36
38
|
node_attr = SoapRequest::SoapElement.create(SoapRequest::SoapConstants::A)
|
|
37
39
|
.add_attribute(SoapRequest::SoapConstants::N, key)
|
|
@@ -89,20 +91,6 @@ module Zm
|
|
|
89
91
|
SoapRequest::SoapElement.create(SoapRequest::SoapConstants::ID).add_content(@item.id)
|
|
90
92
|
)
|
|
91
93
|
end
|
|
92
|
-
|
|
93
|
-
def attrs_only_set_h
|
|
94
|
-
selected_attrs = @item.attrs_write.map { |a| Utils.arrow_name_sym(a) }
|
|
95
|
-
attrs_only_set = @item.instance_variables & selected_attrs
|
|
96
|
-
|
|
97
|
-
arr = attrs_only_set.map do |name|
|
|
98
|
-
n = name.to_s[1..]
|
|
99
|
-
values = @item.instance_variable_get(name)
|
|
100
|
-
values = [values] unless values.is_a?(Array)
|
|
101
|
-
[n, values]
|
|
102
|
-
end
|
|
103
|
-
|
|
104
|
-
arr.to_h
|
|
105
|
-
end
|
|
106
94
|
end
|
|
107
95
|
end
|
|
108
96
|
end
|
|
@@ -12,9 +12,9 @@ module Zm
|
|
|
12
12
|
|
|
13
13
|
case item.zimbraMailHostPool
|
|
14
14
|
when String
|
|
15
|
-
item.zimbraMailHostPool
|
|
15
|
+
item.instance_variable_set(:@zimbraMailHostPool, [item.zimbraMailHostPool])
|
|
16
16
|
when NilClass
|
|
17
|
-
item.zimbraMailHostPool
|
|
17
|
+
item.instance_variable_set(:@zimbraMailHostPool, [])
|
|
18
18
|
end
|
|
19
19
|
|
|
20
20
|
item
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Zm
|
|
4
|
+
module Client
|
|
5
|
+
# classes of service returned by CosesCollection#all and find_in_batches
|
|
6
|
+
class CosesResponse < Base::AdminObjectsResponse
|
|
7
|
+
UNLIMITED_QUOTA = 0
|
|
8
|
+
|
|
9
|
+
def with_server(server)
|
|
10
|
+
server_id = server.is_a?(Server) ? server.id : server
|
|
11
|
+
self.class.new(@collection, select { |cos| Array(cos.zimbraMailHostPool).include?(server_id) })
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def by_server
|
|
15
|
+
each_with_object({}) do |cos, servers|
|
|
16
|
+
Array(cos.zimbraMailHostPool).each do |server_id|
|
|
17
|
+
(servers[server_id] ||= self.class.new(@collection)) << cos
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def unlimited_quotas
|
|
23
|
+
self.class.new(@collection, select { |cos| cos.zimbraMailQuota == UNLIMITED_QUOTA })
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Zm
|
|
4
|
+
module Client
|
|
5
|
+
# prints a deprecation warning once per deprecated name
|
|
6
|
+
module Deprecation
|
|
7
|
+
MUTEX = Mutex.new
|
|
8
|
+
|
|
9
|
+
class << self
|
|
10
|
+
def warn_once(name, advice)
|
|
11
|
+
return unless MUTEX.synchronize { warned.add?(name) }
|
|
12
|
+
|
|
13
|
+
warn("#{name} is deprecated and will be removed in 4.0, #{advice}", uplevel: 2)
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
private
|
|
17
|
+
|
|
18
|
+
def warned
|
|
19
|
+
@warned ||= Set.new
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -9,6 +9,16 @@ module Zm
|
|
|
9
9
|
has_jsns_builder
|
|
10
10
|
include Zm::Utils::HasSoapAdminConnector
|
|
11
11
|
include SoapRequest::RequestMethodsAdmin
|
|
12
|
+
extend Base::HasZimbraAttributes
|
|
13
|
+
|
|
14
|
+
zimbra_attr %i[
|
|
15
|
+
cn description displayName zimbraMailHost zimbraNotes zimbraMailForwardingAddress zimbraMailStatus
|
|
16
|
+
zimbraPrefReplyToAddress zimbraLocale zimbraHideInGal zimbraPrefReplyToDisplay zimbraPrefReplyToEnabled
|
|
17
|
+
zimbraACE zimbraAdminConsoleUIComponents zimbraPrefAllowAddressForDelegatedSender
|
|
18
|
+
zimbraDistributionListSendShareMessageToNewMembers
|
|
19
|
+
]
|
|
20
|
+
|
|
21
|
+
zimbra_attr %i[mail uid zimbraId zimbraMailAlias zimbraCreateTimestamp], readonly: true
|
|
12
22
|
|
|
13
23
|
has_many :aliases, klass: :'Zm::Client::DistributionListAliasesCollection'
|
|
14
24
|
has_many :members, klass: :'Zm::Client::DistributionListMembersCollection'
|
|
@@ -18,6 +28,7 @@ module Zm
|
|
|
18
28
|
|
|
19
29
|
def create!
|
|
20
30
|
resp = sac.invoke(build_create)
|
|
31
|
+
clear_zimbra_attrs_changes
|
|
21
32
|
@id = resp[:CreateDistributionListResponse][:dl].first[:id]
|
|
22
33
|
end
|
|
23
34
|
|
|
@@ -54,10 +65,6 @@ module Zm
|
|
|
54
65
|
def mailing_list?
|
|
55
66
|
zimbraMailStatus == SoapRequest::SoapConstants::ENABLED
|
|
56
67
|
end
|
|
57
|
-
|
|
58
|
-
def attrs_write
|
|
59
|
-
@parent.zimbra_attributes.all_distributionlist_attrs_writable_names
|
|
60
|
-
end
|
|
61
68
|
end
|
|
62
69
|
end
|
|
63
70
|
end
|