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



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

def attrs
  h = {
    zid: @item.zid,
    gt: @item.gt,
    right: @item.right,
    d: @item.d
  }
  h.compact!
  h
end

#to_deleteObject



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

def to_delete
  SoapElement.(SoapAccountConstants::REVOKE_RIGHTS_REQUEST)
             .add_attribute(SoapConstants::ACE, attrs)
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
# File 'lib/zm/client/ace/ace_jsns_builder.rb', line 15

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