zm-ruby-client 2.0.3 → 2.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e9a46f4c93b0a88af487882f7263348f5e396391a1f78eb6f4237007fc5f684e
4
- data.tar.gz: b5efd5b41eca4bb27aeb004ec3eb49813f1975438be106ea702f772a4e49da44
3
+ metadata.gz: 2922ec4ff3ece6b82feeee37bd6ec363824f822e884df6e5a9eafb87953f3e10
4
+ data.tar.gz: 6139bad6da17e8dcbb042af4060410ea83ea94ff63b9b0b6ee92a437d46d36c6
5
5
  SHA512:
6
- metadata.gz: 9a7ec3db28007938925d0dcf780f388ab314b1b71e84a60e5539570f9564a1aea173132a7f04476f43059ec73d4efa36c804a406b166392eceea6d92130b3939
7
- data.tar.gz: 695abff3589a4999ef61ce7dd302d7230501d224638d2a9d0762bca177ab2be81de99b9ce2e045d7349d536a5caa3b49f599e11b2245428d590f79127770f20e
6
+ metadata.gz: 21213f0d951333e67a030a97f06fb5a578e8970cc080749bc6bb4aa2ecc28d0736686f26879ccafb8404a7ade34230231435195dd262f8f1ed6ea5bbf74c9bc8
7
+ data.tar.gz: 48c3570bb2b80842b66d01a14c586b4e00e2b78bd2d0eaaebbbc818b17304af62d264e8b1255673d8bf2206e0da959ed9e08883d01abfe3b28b1f5ea1f62544e
@@ -29,7 +29,7 @@ module Zm
29
29
  attr_writer :used, :domain_key
30
30
 
31
31
  def soap_account_connector
32
- @soap_account_connector ||= SoapAccountConnector.create(@parent.config)
32
+ @soap_account_connector ||= SoapAccountConnector.create(soap_config)
33
33
  end
34
34
  alias sacc soap_account_connector
35
35
 
@@ -90,7 +90,7 @@ module Zm
90
90
  end
91
91
 
92
92
  def login
93
- if @parent.logged?
93
+ if parent_logged?
94
94
  admin_login
95
95
  else
96
96
  account_login
@@ -293,6 +293,22 @@ module Zm
293
293
  def uploader
294
294
  @uploader ||= Upload.new(self)
295
295
  end
296
+
297
+ private
298
+
299
+ def soap_config
300
+ return @parent.config if @parent.respond_to?(:config)
301
+ return @parent.parent.config if @parent.respond_to?(:parent) && @parent.parent.respond_to?(:config)
302
+
303
+ nil
304
+ end
305
+
306
+ def parent_logged?
307
+ return @parent.logged? if @parent.respond_to?(:logged?)
308
+ return @parent.parent.logged? if @parent.respond_to?(:parent) && @parent.parent.respond_to?(:logged?)
309
+
310
+ false
311
+ end
296
312
  end
297
313
  end
298
314
  end
@@ -47,6 +47,8 @@ module Zm
47
47
 
48
48
  logger.info 'Get Admin session token'
49
49
 
50
+ @soap_admin_connector.token = nil if logged?
51
+
50
52
  soap_request = SoapElement.admin(SoapAdminConstants::AUTH_REQUEST)
51
53
  soap_request.add_attributes(name: @config.zimbra_admin_login, password: @config.zimbra_admin_password)
52
54
  soap_resp = @soap_admin_connector.invoke(soap_request, Zm::Client::AuthError)
@@ -14,16 +14,20 @@ module Zm
14
14
  m: members_node
15
15
  }
16
16
  }
17
+
18
+ SoapElement.mail(SoapMailConstants::CREATE_CONTACT_REQUEST).add_attributes(jsns)
17
19
  end
18
20
 
19
21
  def to_update
20
- {
22
+ jsns = {
21
23
  cn: {
22
24
  a: instance_variables_array.map(&Utils::A_NODE_PROC),
23
25
  id: @item.id,
24
26
  m: members_node
25
27
  }
26
28
  }
29
+
30
+ SoapElement.mail(SoapMailConstants::MODIFY_CONTACT_REQUEST).add_attributes(jsns)
27
31
  end
28
32
 
29
33
  def to_patch(hash)
@@ -33,6 +37,8 @@ module Zm
33
37
  a: hash.map(&Utils::A_ARRAY_PROC).flatten(1).map(&Utils::A_NODE_PROC)
34
38
  }
35
39
  }
40
+
41
+ SoapElement.mail(SoapMailConstants::MODIFY_CONTACT_REQUEST).add_attributes(jsns)
36
42
  end
37
43
 
38
44
  alias to_create to_jsns
@@ -10,7 +10,7 @@ module Zm
10
10
  module VERSION
11
11
  MAJOR = 2
12
12
  MINOR = 0
13
- TINY = 3
13
+ TINY = 5
14
14
 
15
15
  STRING = [MAJOR, MINOR, TINY].compact.join('.')
16
16
  end
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: 2.0.3
4
+ version: 2.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maxime Désécot
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-12-14 00:00:00.000000000 Z
11
+ date: 2024-01-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable