def call(clazz, action, call_params)
      resource_name = clazz.name.downcase.sub('rubyaem::resources::', '')
      resource = @spec[resource_name]
      action_spec = resource['actions'][action]

      api = @apis[action_spec['api'].to_sym]
      operation = action_spec['operation']

      params = []
      required_params = action_spec['params']['required'] || {}
      required_params.each_value { |value|
        params.push(value % call_params)
      }
      params.push({})
      optional_params = action_spec['params']['optional'] || {}
      optional_params.each { |key, value|
        add_optional_param(key, value, params, call_params)
      }

      base_responses_spec = resource['responses'] || {}
      action_responses_spec = action_spec['responses'] || {}
      responses_spec = base_responses_spec.merge(action_responses_spec)

      begin
        method = RubyAem::Swagger.operation_to_method(operation)
        data, status_code, headers = api.send("#{method}_with_http_info", *params)
        response = RubyAem::Response.new(status_code, data, headers)
      rescue SwaggerAemClient::ApiError => err
        response = RubyAem::Response.new(err.code, err.response_body, err.response_headers)
      end
      handle(response, responses_spec, call_params)
    end
def call(clazz, action, call_params)
      resource_name = clazz.name.downcase.sub('rubyaem::resources::', '')
      resource = @spec[resource_name]
      action_spec = resource['actions'][action]

      api = @apis[action_spec['api'].to_sym]
      operation = action_spec['operation']

      params = []
      required_params = action_spec['params']['required'] || {}
      required_params.each_value { |value|
        params.push(value % call_params)
      }
      params.push({})
      optional_params = action_spec['params']['optional'] || {}
      optional_params.each { |key, value|
        add_optional_param(key, value, params, call_params)
      }

      base_responses_spec = resource['responses'] || {}
      action_responses_spec = action_spec['responses'] || {}
      responses_spec = base_responses_spec.merge(action_responses_spec)

      begin
        method = RubyAem::Swagger.operation_to_method(operation)
        data, status_code, headers = api.send("#{method}_with_http_info", *params)
        response = RubyAem::Response.new(status_code, data, headers)
      rescue SwaggerAemClient::ApiError => err
        response = RubyAem::Response.new(err.code, err.response_body, err.response_headers)
      end
      handle(response, responses_spec, call_params)
    end
Initialise a client.

 @param apis a hash of Swagger AEM client's API instances
 @param spec ruby_aem specification
 @return new RubyAem::Client instance
 Make an API call using the relevant Swagger AEM API client.
 Clazz and action parameters are used to identify the action, API, and params
 from ruby_aem specification, alongside the response handlers.
 Call parameters are used to construct HTTP request parameters based on the
 specification.

 @param clazz the class name of the caller resource
 @param action the action of the API call
 @param call_params API call parameters
 @return RubyAem::Result