zm-ruby-client 0.18.1 → 0.18.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/zm/client/base/account_search_objects_collection.rb +1 -1
- data/lib/zm/client/connector/soap_account.rb +13 -0
- data/lib/zm/client/connector/soap_admin.rb +12 -5
- data/lib/zm/client/cos/cos.rb +5 -1
- data/lib/zm/client/distributionlist/distributionlist.rb +27 -9
- data/lib/zm/client/domain/domain.rb +6 -1
- data/lib/zm/client/folder/folder.rb +1 -0
- data/lib/zm/client/identity/identity.rb +1 -1
- data/lib/zm/client/message/messages_builder.rb +2 -1
- data/lib/zm/client/mountpoint/mountpoint.rb +6 -1
- data/lib/zm/client/mountpoint/mountpoint_jsns_builder.rb +0 -2
- data/lib/zm/client/resource/resource.rb +6 -39
- data/lib/zm/client/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d440e1ce50365f9c9225698840476f72397aa4ac165dfb52d484d9065e9044de
|
4
|
+
data.tar.gz: 01bbd079546b0aa7d94969d4b27cbb28ad069c3d8e652d5891651ab201147ecd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f84d4885300650907d06b86f1c7979c0fbec790af950b65e15713946159b9de5ba92b0daebe420a21d62b90fcf50b8c2f7af9e375a414dd61c541364ca8d1e2
|
7
|
+
data.tar.gz: c8c3b854cf9fb4afd531164b41f15ebaf53eb85ae1e639a54ff23538eed2084510864736512ff9209a1c2ba276b0d98e270a7a5f41247dfae469b36f04a9bb32
|
@@ -364,6 +364,19 @@ module Zm
|
|
364
364
|
curl_request(body)
|
365
365
|
end
|
366
366
|
|
367
|
+
def modify_prefs(token, hash)
|
368
|
+
soap_name = :ModifyPrefsRequest
|
369
|
+
body = init_hash_request(token, soap_name, ACCOUNTSPACE)
|
370
|
+
|
371
|
+
req = {
|
372
|
+
_attrs: hash
|
373
|
+
}
|
374
|
+
|
375
|
+
body[:Body][soap_name].merge!(req)
|
376
|
+
|
377
|
+
curl_request(body)
|
378
|
+
end
|
379
|
+
|
367
380
|
def get_signatures(token)
|
368
381
|
soap_name = :GetSignaturesRequest
|
369
382
|
body = init_hash_request(token, soap_name, ACCOUNTSPACE)
|
@@ -153,12 +153,15 @@ module Zm
|
|
153
153
|
curl_request(body)
|
154
154
|
end
|
155
155
|
|
156
|
-
def modify_cos(id,
|
157
|
-
|
158
|
-
req = { _jsns: ADMINSPACE, id: id }
|
156
|
+
def modify_cos(id, attrs = nil)
|
157
|
+
req = { _jsns: ADMINSPACE, id: [{ _content: id }], a: attrs.to_a.map{ |n| { n: n.first, _content: n.last } } }
|
159
158
|
body = { Body: { ModifyCosRequest: req } }.merge(hash_header(@token))
|
160
|
-
|
161
|
-
|
159
|
+
curl_request(body)
|
160
|
+
end
|
161
|
+
|
162
|
+
def delete_cos(id)
|
163
|
+
req = { _jsns: ADMINSPACE, id: [{ _content: id }] }
|
164
|
+
body = { Body: { DeleteCosRequest: req } }.merge(hash_header(@token))
|
162
165
|
curl_request(body)
|
163
166
|
end
|
164
167
|
|
@@ -198,6 +201,10 @@ module Zm
|
|
198
201
|
curl_request(body)
|
199
202
|
end
|
200
203
|
|
204
|
+
def rename_resource(id, email)
|
205
|
+
generic_rename(:RenameCalendarResourceRequest, id, email)
|
206
|
+
end
|
207
|
+
|
201
208
|
def create_distribution_list(name, attrs = [])
|
202
209
|
soap_name = :CreateDistributionListRequest
|
203
210
|
req = { name: name }
|
data/lib/zm/client/cos/cos.rb
CHANGED
@@ -17,11 +17,9 @@ module Zm
|
|
17
17
|
@grantee_type = 'grp'.freeze
|
18
18
|
end
|
19
19
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
# hashmap
|
24
|
-
# end
|
20
|
+
def domain_name
|
21
|
+
@domain_name ||= @name.split('@').last
|
22
|
+
end
|
25
23
|
|
26
24
|
def all_instance_variable_keys
|
27
25
|
DistributionListCommon::ALL_ATTRS
|
@@ -102,13 +100,33 @@ module Zm
|
|
102
100
|
end
|
103
101
|
|
104
102
|
def add_owners!(*emails)
|
105
|
-
|
106
|
-
|
103
|
+
sac.distribution_list_action(
|
104
|
+
@id,
|
105
|
+
:id,
|
106
|
+
{
|
107
|
+
op: 'addOwners',
|
108
|
+
owner: emails.map do |email|
|
109
|
+
{ by: :name, type: :usr, _content: email }
|
110
|
+
end
|
111
|
+
}
|
112
|
+
)
|
113
|
+
|
114
|
+
@owners += emails
|
107
115
|
end
|
108
116
|
|
109
117
|
def remove_owners!(*emails)
|
110
|
-
|
111
|
-
|
118
|
+
sac.distribution_list_action(
|
119
|
+
@id,
|
120
|
+
:id,
|
121
|
+
{
|
122
|
+
op: 'removeOwners',
|
123
|
+
owner: emails.map do |email|
|
124
|
+
{ by: :name, type: :usr, _content: email }
|
125
|
+
end
|
126
|
+
}
|
127
|
+
)
|
128
|
+
|
129
|
+
@owners -= emails
|
112
130
|
end
|
113
131
|
|
114
132
|
def local_transport
|
@@ -6,7 +6,8 @@ module Zm
|
|
6
6
|
class Domain < Base::AdminObject
|
7
7
|
INSTANCE_VARIABLE_KEYS = %i[name description zimbraDomainName zimbraDomainStatus zimbraId zimbraDomainType
|
8
8
|
zimbraDomainDefaultCOSId zimbraGalAccountId zimbraPreAuthKey zimbraGalLdapBindDn zimbraGalLdapBindPassword
|
9
|
-
zimbraGalLdapFilter zimbraGalLdapSearchBase zimbraGalLdapURL zimbraGalMode zimbraMailTransport
|
9
|
+
zimbraGalLdapFilter zimbraGalLdapSearchBase zimbraGalLdapURL zimbraGalMode zimbraMailTransport
|
10
|
+
zimbraPublicServiceHostname zimbraPublicServiceProtocol]
|
10
11
|
|
11
12
|
attr_accessor *INSTANCE_VARIABLE_KEYS
|
12
13
|
|
@@ -54,6 +55,10 @@ module Zm
|
|
54
55
|
@accounts ||= DomainAccountsCollection.new(self)
|
55
56
|
end
|
56
57
|
|
58
|
+
def delete!
|
59
|
+
sac.generic_delete(:DeleteDomainRequest, id)
|
60
|
+
end
|
61
|
+
|
57
62
|
# def account_quotas(server_id)
|
58
63
|
# rep = sac.get_quota_usage(name, nil, nil, nil, nil, nil, nil, server_id)
|
59
64
|
# AccountsBuilder.new(@parent, rep).make
|
@@ -14,6 +14,7 @@ module Zm
|
|
14
14
|
:s, :i4ms, :i4next, :zid, :rid, :ruuid, :owner, :reminder, :acl, :itemCount, :broken, :deletable, :fb
|
15
15
|
|
16
16
|
attr_accessor :folders, :grants, :retention_policies
|
17
|
+
attr_writer :absFolderPath
|
17
18
|
|
18
19
|
define_changed_attributes :name, :color, :rgb, :l, :url, :f, :view
|
19
20
|
|
@@ -12,7 +12,8 @@ module Zm
|
|
12
12
|
webOfflineSyncDays color rgb
|
13
13
|
].freeze
|
14
14
|
|
15
|
-
attr_reader :owner, :rev, :reminder, :ms, :deletable, :rid, :uuid, :url, :f, :broken, :luuid, :ruuid, :activesyncdisabled, :absFolderPath, :
|
15
|
+
attr_reader :owner, :rev, :reminder, :ms, :deletable, :rid, :uuid, :url, :f, :broken, :luuid, :ruuid, :activesyncdisabled, :absFolderPath, :zid, :id, :webOfflineSyncDays
|
16
|
+
attr_writer :view, :zid, :rid
|
16
17
|
|
17
18
|
define_changed_attributes :name, :color, :rgb, :l
|
18
19
|
|
@@ -32,6 +33,10 @@ module Zm
|
|
32
33
|
# todo
|
33
34
|
end
|
34
35
|
|
36
|
+
def fb
|
37
|
+
nil
|
38
|
+
end
|
39
|
+
|
35
40
|
private
|
36
41
|
|
37
42
|
def jsns_builder
|
@@ -17,7 +17,6 @@ module Zm
|
|
17
17
|
color: @item.color,
|
18
18
|
rgb: @item.rgb,
|
19
19
|
url: @item.url,
|
20
|
-
fb: @item.fb,
|
21
20
|
view: @item.view,
|
22
21
|
zid: @item.zid,
|
23
22
|
rid: @item.rid
|
@@ -38,7 +37,6 @@ module Zm
|
|
38
37
|
color: @item.color,
|
39
38
|
rgb: @item.rgb,
|
40
39
|
url: @item.url,
|
41
|
-
fb: @item.fb,
|
42
40
|
view: @item.view
|
43
41
|
}.delete_if { |_, v| v.nil? }
|
44
42
|
|
@@ -6,8 +6,7 @@ module Zm
|
|
6
6
|
module Client
|
7
7
|
# objectClass: zimbraCalendarResource
|
8
8
|
class Resource < Base::AdminObject
|
9
|
-
|
10
|
-
attr_accessor :home_url
|
9
|
+
attr_accessor :home_url, :zimbraCalResAutoDeclineRecurring
|
11
10
|
|
12
11
|
def initialize(parent)
|
13
12
|
extend(ResourceCommon)
|
@@ -15,12 +14,6 @@ module Zm
|
|
15
14
|
@grantee_type = 'usr'.freeze
|
16
15
|
end
|
17
16
|
|
18
|
-
# def to_h
|
19
|
-
# hashmap = Hash[all_instance_variable_keys.map { |key| [key, instance_variable_get(arrow_name(key))] }]
|
20
|
-
# hashmap.delete_if { |_, v| v.nil? }
|
21
|
-
# hashmap
|
22
|
-
# end
|
23
|
-
|
24
17
|
def all_instance_variable_keys
|
25
18
|
ResourceCommon::ALL_ATTRS
|
26
19
|
end
|
@@ -110,40 +103,14 @@ module Zm
|
|
110
103
|
@id = rep[:Body][:CreateCalendarResourceResponse][:calresource].first[:id]
|
111
104
|
end
|
112
105
|
|
106
|
+
def rename!(email)
|
107
|
+
sac.rename_resource(@id, email)
|
108
|
+
@name = email
|
109
|
+
end
|
110
|
+
|
113
111
|
def uploader
|
114
112
|
@uploader ||= Upload.new(self)
|
115
113
|
end
|
116
|
-
|
117
|
-
# def download(folder_path, fmt, types, dest_file_path)
|
118
|
-
# url_folder_path = File.join(@home_url, folder_path.to_s)
|
119
|
-
# uri = Addressable::URI.new
|
120
|
-
# uri.query_values = {
|
121
|
-
# fmt: fmt,
|
122
|
-
# types: types.join(','),
|
123
|
-
# emptyname: 'Vide',
|
124
|
-
# charset: 'UTF-8',
|
125
|
-
# auth: 'qp',
|
126
|
-
# zauthtoken: @token
|
127
|
-
# }
|
128
|
-
# url_folder_path << '?' << uri.query
|
129
|
-
#
|
130
|
-
# rac.download(url_folder_path, dest_file_path)
|
131
|
-
# end
|
132
|
-
#
|
133
|
-
# def upload(folder_path, fmt, types, resolve, src_file_path)
|
134
|
-
# url_folder_path = File.join(@home_url, folder_path.to_s)
|
135
|
-
# uri = Addressable::URI.new
|
136
|
-
# uri.query_values = {
|
137
|
-
# fmt: fmt,
|
138
|
-
# types: types.join(','),
|
139
|
-
# resolve: resolve,
|
140
|
-
# auth: 'qp',
|
141
|
-
# zauthtoken: @token
|
142
|
-
# }
|
143
|
-
# url_folder_path << '?' << uri.query
|
144
|
-
#
|
145
|
-
# rac.upload(url_folder_path, src_file_path)
|
146
|
-
# end
|
147
114
|
end
|
148
115
|
end
|
149
116
|
end
|
data/lib/zm/client/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zm-ruby-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.18.
|
4
|
+
version: 0.18.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Maxime Désécot
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-10-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -249,7 +249,7 @@ homepage: https://github.com/RaoH37/zm-ruby-client
|
|
249
249
|
licenses:
|
250
250
|
- GPL-3.0
|
251
251
|
metadata: {}
|
252
|
-
post_install_message:
|
252
|
+
post_install_message:
|
253
253
|
rdoc_options: []
|
254
254
|
require_paths:
|
255
255
|
- lib
|
@@ -264,8 +264,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
264
264
|
- !ruby/object:Gem::Version
|
265
265
|
version: '0'
|
266
266
|
requirements: []
|
267
|
-
rubygems_version: 3.
|
268
|
-
signing_key:
|
267
|
+
rubygems_version: 3.4.19
|
268
|
+
signing_key:
|
269
269
|
specification_version: 4
|
270
270
|
summary: zm-ruby-client
|
271
271
|
test_files: []
|