Class: SwaggerClient::MarketTrendsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/swagger_client/api/market_trends_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ MarketTrendsApi

Returns a new instance of MarketTrendsApi.



19
20
21
# File 'lib/swagger_client/api/market_trends_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/swagger_client/api/market_trends_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

Get Trends for criteria Get historical market trends for cars matching the given VIN’s basic specification or Year, Make, Model, Trim (Optional) criteria

Parameters:

  • api_key

    The API Authentication Key. Mandatory with all API calls.

  • vin

    VIN as a reference to the type of car for which trend data is to be returned

  • car_type

    Car type. Allowed values are - new / used / certified

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :year (String)

    Year of the car

  • :make (String)

    Make of the car

  • :model (String)

    Model of the Car

  • :trim (String)

    Trim of the Car

Returns:



34
35
36
37
# File 'lib/swagger_client/api/market_trends_api.rb', line 34

def get_trends(api_key, vin, car_type, opts = {})
  data, status_code, headers = get_trends_with_http_info(api_key, vin, car_type, opts)
  return data
end

Get Trends for criteria Get historical market trends for cars matching the given VIN's basic specification or Year, Make, Model, Trim (Optional) criteria

Parameters:

  • api_key

    The API Authentication Key. Mandatory with all API calls.

  • vin

    VIN as a reference to the type of car for which trend data is to be returned

  • car_type

    Car type. Allowed values are - new / used / certified

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :year (String)

    Year of the car

  • :make (String)

    Make of the car

  • :model (String)

    Model of the Car

  • :trim (String)

    Trim of the Car

Returns:

  • (Array<(Array<TrendPoint>, Fixnum, Hash)>)

    Array<TrendPoint> data, response status code and response headers



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
95
96
97
98
99
100
101
102
103
104
105
106
# File 'lib/swagger_client/api/market_trends_api.rb', line 50

def get_trends_with_http_info(api_key, vin, car_type, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: MarketTrendsApi#get_trends ..."
  end
  
  # verify the required parameter 'api_key' is set
  fail "Missing the required parameter 'api_key' when calling get_trends" if api_key.nil?
  
  # verify the required parameter 'vin' is set
  fail "Missing the required parameter 'vin' when calling get_trends" if vin.nil?
  
  # verify the required parameter 'car_type' is set
  fail "Missing the required parameter 'car_type' when calling get_trends" if car_type.nil?
  
  # resource path
  local_var_path = "/trends".sub('{format}','json')

  # query parameters
  query_params = {}
  query_params[:'api_key'] = api_key
  query_params[:'vin'] = vin
  query_params[:'car_type'] = car_type
  query_params[:'year'] = opts[:'year'] if opts[:'year']
  query_params[:'make'] = opts[:'make'] if opts[:'make']
  query_params[:'model'] = opts[:'model'] if opts[:'model']
  query_params[:'trim'] = opts[:'trim'] if opts[:'trim']

  # 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<TrendPoint>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: MarketTrendsApi#get_trends\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end