Class: Zm::Client::AceJsnsBuilder

Inherits:
Base::BaseJsnsBuilder show all
Defined in:
lib/zm/client/ace/ace_jsns_builder.rb

Overview

class for account ace jsns builder

Constant Summary

Constants inherited from Base::BaseJsnsBuilder

Base::BaseJsnsBuilder::A_ARRAY_PROC, Base::BaseJsnsBuilder::A_NODE_PROC

Instance Method Summary collapse

Methods inherited from Base::BaseJsnsBuilder

#arrow_name, #initialize, #instance_variables_array, #to_patch, #to_update

Constructor Details

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

Instance Method Details

#attrsObject



27
28
29
30
31
32
33
34
# File 'lib/zm/client/ace/ace_jsns_builder.rb', line 27

def attrs
  {
    zid: @item.zid,
    gt: @item.gt,
    right: @item.right,
    d: @item.d
  }.reject { |_, v| v.nil? }
end

#to_deleteObject



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

def to_delete
  soap_request = SoapElement.(SoapAccountConstants::REVOKE_RIGHTS_REQUEST)
  soap_request.add_attribute(SoapConstants::ACE, attrs)
  soap_request
end

#to_findObject



7
8
9
10
11
12
13
# File 'lib/zm/client/ace/ace_jsns_builder.rb', line 7

def to_find
  soap_request = SoapElement.(SoapAccountConstants::GET_RIGHTS_REQUEST)

  soap_request.add_attribute(SoapConstants::ACE, @item.rights.map { |r| { right: r } }) unless @item.rights.empty?

  soap_request
end

#to_jsnsObject



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

def to_jsns
  soap_request = SoapElement.(SoapAccountConstants::GRANT_RIGHTS_REQUEST)
  soap_request.add_attribute(SoapConstants::ACE, attrs)
  soap_request
end