Class: SwaggerClient::HistoryApi
- Inherits:
-
Object
- Object
- SwaggerClient::HistoryApi
- Defined in:
- lib/swagger_client/api/history_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#history(api_key, vin, opts = {}) ⇒ Array<HistoricalListing>
Get a cars online listing history The history API returns online listing history for a car identified by its VIN.
-
#history_with_http_info(api_key, vin, opts = {}) ⇒ Array<(Array<HistoricalListing>, Fixnum, Hash)>
Get a cars online listing history The history API returns online listing history for a car identified by its VIN.
-
#initialize(api_client = ApiClient.default) ⇒ HistoryApi
constructor
A new instance of HistoryApi.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ HistoryApi
Returns a new instance of HistoryApi.
19 20 21 |
# File 'lib/swagger_client/api/history_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/swagger_client/api/history_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#history(api_key, vin, opts = {}) ⇒ Array<HistoricalListing>
Get a cars online listing history The history API returns online listing history for a car identified by its VIN. History listings are sorted in the descending order of the listing date / last seen date
31 32 33 34 |
# File 'lib/swagger_client/api/history_api.rb', line 31 def history(api_key, vin, opts = {}) data, status_code, headers = history_with_http_info(api_key, vin, opts) return data end |
#history_with_http_info(api_key, vin, opts = {}) ⇒ Array<(Array<HistoricalListing>, Fixnum, Hash)>
Get a cars online listing history The history API returns online listing history for a car identified by its VIN. History listings are sorted in the descending order of the listing date / last seen date
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/swagger_client/api/history_api.rb', line 44 def history_with_http_info(api_key, vin, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: HistoryApi#history ..." end # verify the required parameter 'api_key' is set fail "Missing the required parameter 'api_key' when calling history" if api_key.nil? # verify the required parameter 'vin' is set fail "Missing the required parameter 'vin' when calling history" if vin.nil? # resource path local_var_path = "/history/{vin}".sub('{format}','json').sub('{' + 'vin' + '}', vin.to_s) # query parameters query_params = {} query_params[:'api_key'] = api_key query_params[:'rows'] = opts[:'rows'] if opts[:'rows'] query_params[:'page'] = opts[:'page'] if opts[:'page'] query_params[:'fields'] = opts[:'fields'] if opts[:'fields'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = [] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Array<HistoricalListing>') if @api_client.config.debugging @api_client.config.logger.debug "API called: HistoryApi#history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |