def request(operation, data)
      opts = {
        method:       :post,
        url:          api_url,
        payload:      { 'Package' => body(operation, data) },
        content_type: :xml,
        verify_ssl:   verify_ssl,
        ssl_ca_file:  ssl_ca_file }

      response = RestClient::Request.execute(opts)
      response = Response.new(response)

      if !response.success? && fail_on_error
        fail Error.new(response)
      end
      response
    end
def request(operation, data)
      opts = {
        method:       :post,
        url:          api_url,
        payload:      { 'Package' => body(operation, data) },
        content_type: :xml,
        verify_ssl:   verify_ssl,
        ssl_ca_file:  ssl_ca_file }

      response = RestClient::Request.execute(opts)
      response = Response.new(response)

      if !response.success? && fail_on_error
        fail Error.new(response)
      end
      response
    end
Create an instance of an API client

 ==== Attributes
 * +options+ - Access credentials and options hash, required keys are: account_api_key, user_api_key
 ==== Example
 client = Smarteru::Client.new({account_api_key: 'abc', user_api_key: 'abc'})
 Make an API request

 ==== Attributes
 * +operation+  - Operation method eg getGroup
 * +data+ - Data hash
 ==== Example
 client.request("getGroup", {
   group: {
     name: 'MyGroup'
   }
 })