Class: AmznSpApi::SpApiClient

Inherits:
ApiClient show all
Defined in:
lib/amzn_sp_api/sp_api_client.rb

Instance Attribute Summary

Attributes inherited from ApiClient

#config, #default_headers

Instance Method Summary collapse

Methods inherited from ApiClient

#build_collection_param, #build_request, #build_request_body, #build_request_url, #convert_to_type, default, #deserialize, #download_file, #json_mime?, #object_to_hash, #object_to_http_body, #sanitize_filename, #select_header_accept, #select_header_content_type, #update_params_for_auth!, #user_agent=

Constructor Details

#initialize(config = SpApiConfiguration.default) ⇒ SpApiClient

Returns a new instance of SpApiClient.



8
9
10
# File 'lib/amzn_sp_api/sp_api_client.rb', line 8

def initialize(config = SpApiConfiguration.default)
  super(config)
end

Instance Method Details

#call_api(http_method, path, opts = {}) ⇒ Object



14
15
16
17
18
19
# File 'lib/amzn_sp_api/sp_api_client.rb', line 14

def call_api(http_method, path, opts = {})
  unsigned_request = build_request(http_method, path, opts)
  aws_headers = auth_headers(http_method, unsigned_request.url, unsigned_request.encoded_body)
  singed_opts = opts.merge(header_params: aws_headers.merge(opts[:header_params] || {}))
  super(http_method, path, singed_opts)
end

#super_call_apiObject



12
# File 'lib/amzn_sp_api/sp_api_client.rb', line 12

alias super_call_api call_api