Class: SwaggerClient::DealerApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ DealerApi

Returns a new instance of DealerApi.



19
20
21
# File 'lib/swagger_client/api/dealer_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/dealer_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#dealer_search(api_key, latitude, longitude, radius, type, opts = {}) ⇒ Array<Dealer>

Find car dealers around The dealers API returns a list of dealers around a given point and radius. Max radius of only 50 miles is supported.

Parameters:

  • api_key

    The API Authentication Key. Mandatory with all API calls.

  • latitude

    Latitude component of location

  • longitude

    Longitude component of location

  • radius

    Radius around the search location

  • type

    Dealer inventory type. Allowed values are - new / used / certified

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

    the optional parameters

Options Hash (opts):

  • :rows (Float)

    Number of results to return. Default is 10. Max is 50

  • :start (Float)

    Offset for the search results. Default is 1.

Returns:



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

def dealer_search(api_key, latitude, longitude, radius, type, opts = {})
  data, status_code, headers = dealer_search_with_http_info(api_key, latitude, longitude, radius, type, opts)
  return data
end

#dealer_search_with_http_info(api_key, latitude, longitude, radius, type, opts = {}) ⇒ Array<(Array<Dealer>, Fixnum, Hash)>

Find car dealers around The dealers API returns a list of dealers around a given point and radius. Max radius of only 50 miles is supported.

Parameters:

  • api_key

    The API Authentication Key. Mandatory with all API calls.

  • latitude

    Latitude component of location

  • longitude

    Longitude component of location

  • radius

    Radius around the search location

  • type

    Dealer inventory type. Allowed values are - new / used / certified

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

    the optional parameters

Options Hash (opts):

  • :rows (Float)

    Number of results to return. Default is 10. Max is 50

  • :start (Float)

    Offset for the search results. Default is 1.

Returns:

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

    Array<Dealer> 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
107
108
109
110
111
112
# File 'lib/swagger_client/api/dealer_api.rb', line 50

def dealer_search_with_http_info(api_key, latitude, longitude, radius, type, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: DealerApi#dealer_search ..."
  end
  
  # verify the required parameter 'api_key' is set
  fail "Missing the required parameter 'api_key' when calling dealer_search" if api_key.nil?
  
  # verify the required parameter 'latitude' is set
  fail "Missing the required parameter 'latitude' when calling dealer_search" if latitude.nil?
  
  # verify the required parameter 'longitude' is set
  fail "Missing the required parameter 'longitude' when calling dealer_search" if longitude.nil?
  
  # verify the required parameter 'radius' is set
  fail "Missing the required parameter 'radius' when calling dealer_search" if radius.nil?
  
  # verify the required parameter 'type' is set
  fail "Missing the required parameter 'type' when calling dealer_search" if type.nil?
  
  # resource path
  local_var_path = "/dealers".sub('{format}','json')

  # query parameters
  query_params = {}
  query_params[:'api_key'] = api_key
  query_params[:'latitude'] = latitude
  query_params[:'longitude'] = longitude
  query_params[:'radius'] = radius
  query_params[:'type'] = type
  query_params[:'rows'] = opts[:'rows'] if opts[:'rows']
  query_params[:'start'] = opts[:'start'] if opts[:'start']

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

#get_dealer(api_key, id, opts = {}) ⇒ Dealer

Dealer by id Get a particular dealer’s information by its id

Parameters:

  • api_key

    The API Authentication Key. Mandatory with all API calls.

  • id

    Dealer id to get all the dealer info attributes

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

    the optional parameters

Returns:



120
121
122
123
# File 'lib/swagger_client/api/dealer_api.rb', line 120

def get_dealer(api_key, id, opts = {})
  data, status_code, headers = get_dealer_with_http_info(api_key, id, opts)
  return data
end

#get_dealer_active_inventory(api_key, dealer_id, opts = {}) ⇒ BaseListing

Dealer inventory Get a dealer’s currently active inventory

Parameters:

  • api_key

    The API Authentication Key. Mandatory with all API calls.

  • dealer_id

    Id representing the dealer to fetch the active inventory for

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

    the optional parameters

Options Hash (opts):

  • :rows (String)

    Number of results to return. Default is 10. Max is 50

  • :start (String)

    Page number to fetch the results for the given criteria. Default is 1. Pagination is allowed only till first 1000 results for the search and sort criteria. The page value can be only between 1 to 1000/rows

Returns:



188
189
190
191
# File 'lib/swagger_client/api/dealer_api.rb', line 188

def get_dealer_active_inventory(api_key, dealer_id, opts = {})
  data, status_code, headers = get_dealer_active_inventory_with_http_info(api_key, dealer_id, opts)
  return data
end

#get_dealer_active_inventory_with_http_info(api_key, dealer_id, opts = {}) ⇒ Array<(BaseListing, Fixnum, Hash)>

Dealer inventory Get a dealer&#39;s currently active inventory

Parameters:

  • api_key

    The API Authentication Key. Mandatory with all API calls.

  • dealer_id

    Id representing the dealer to fetch the active inventory for

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

    the optional parameters

Options Hash (opts):

  • :rows (String)

    Number of results to return. Default is 10. Max is 50

  • :start (String)

    Page number to fetch the results for the given criteria. Default is 1. Pagination is allowed only till first 1000 results for the search and sort criteria. The page value can be only between 1 to 1000/rows

Returns:

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

    BaseListing data, response status code and response headers



201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
# File 'lib/swagger_client/api/dealer_api.rb', line 201

def get_dealer_active_inventory_with_http_info(api_key, dealer_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: DealerApi#get_dealer_active_inventory ..."
  end
  
  # verify the required parameter 'api_key' is set
  fail "Missing the required parameter 'api_key' when calling get_dealer_active_inventory" if api_key.nil?
  
  # verify the required parameter 'dealer_id' is set
  fail "Missing the required parameter 'dealer_id' when calling get_dealer_active_inventory" if dealer_id.nil?
  
  # resource path
  local_var_path = "/dealer/{dealer_id}/active/inventory".sub('{format}','json').sub('{' + 'dealer_id' + '}', dealer_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'api_key'] = api_key
  query_params[:'rows'] = opts[:'rows'] if opts[:'rows']
  query_params[:'start'] = opts[:'start'] if opts[:'start']

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

#get_dealer_historical_inventory(dealer_id, opts = {}) ⇒ BaseListing

Dealer’s historical inventory

v1 : Not Implemented Yet
  • Get a dealer’s historical inventory

Parameters:

  • dealer_id

    Id representing the dealer to fetch the active inventory for

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

    the optional parameters

Returns:



257
258
259
260
# File 'lib/swagger_client/api/dealer_api.rb', line 257

def get_dealer_historical_inventory(dealer_id, opts = {})
  data, status_code, headers = get_dealer_historical_inventory_with_http_info(dealer_id, opts)
  return data
end

#get_dealer_historical_inventory_with_http_info(dealer_id, opts = {}) ⇒ Array<(BaseListing, Fixnum, Hash)>

Dealer&#39;s historical inventory

v1 : Not Implemented Yet
  • Get a dealer&#39;s historical inventory

Parameters:

  • dealer_id

    Id representing the dealer to fetch the active inventory for

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

    the optional parameters

Returns:

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

    BaseListing data, response status code and response headers



267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
# File 'lib/swagger_client/api/dealer_api.rb', line 267

def get_dealer_historical_inventory_with_http_info(dealer_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: DealerApi#get_dealer_historical_inventory ..."
  end
  
  # verify the required parameter 'dealer_id' is set
  fail "Missing the required parameter 'dealer_id' when calling get_dealer_historical_inventory" if dealer_id.nil?
  
  # resource path
  local_var_path = "/dealer/{dealer_id}/historical/inventory".sub('{format}','json').sub('{' + 'dealer_id' + '}', dealer_id.to_s)

  # query parameters
  query_params = {}

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

#get_dealer_with_http_info(api_key, id, opts = {}) ⇒ Array<(Dealer, Fixnum, Hash)>

Dealer by id Get a particular dealer&#39;s information by its id

Parameters:

  • api_key

    The API Authentication Key. Mandatory with all API calls.

  • id

    Dealer id to get all the dealer info attributes

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

    the optional parameters

Returns:

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

    Dealer data, response status code and response headers



131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
# File 'lib/swagger_client/api/dealer_api.rb', line 131

def get_dealer_with_http_info(api_key, id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: DealerApi#get_dealer ..."
  end
  
  # verify the required parameter 'api_key' is set
  fail "Missing the required parameter 'api_key' when calling get_dealer" if api_key.nil?
  
  # verify the required parameter 'id' is set
  fail "Missing the required parameter 'id' when calling get_dealer" if id.nil?
  
  # resource path
  local_var_path = "/dealer/{id}".sub('{format}','json').sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}
  query_params[:'api_key'] = api_key

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