Class: SwaggerClient::ListingsApi
- Inherits:
-
Object
- Object
- SwaggerClient::ListingsApi
- Defined in:
- lib/swagger_client/api/listings_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#get_listing(api_key, id, opts = {}) ⇒ Listing
Listing by id Get a particular listing by its id.
-
#get_listing_extra(api_key, id, opts = {}) ⇒ ListingExtraAttributes
Long text Listings attributes for Listing with the given id Get listing options, features, seller comments.
-
#get_listing_extra_with_http_info(api_key, id, opts = {}) ⇒ Array<(ListingExtraAttributes, Fixnum, Hash)>
Long text Listings attributes for Listing with the given id Get listing options, features, seller comments.
-
#get_listing_media(api_key, id, opts = {}) ⇒ ListingMedia
Listing media by id Get listing media (photo, photos) by id.
-
#get_listing_media_with_http_info(api_key, id, opts = {}) ⇒ Array<(ListingMedia, Fixnum, Hash)>
Listing media by id Get listing media (photo, photos) by id.
-
#get_listing_vdp(api_key, id, opts = {}) ⇒ ListingVDP
Get listing HTML Cached HTML of the Vehicle Details Page (VDP) for the listing.
-
#get_listing_vdp_with_http_info(api_key, id, opts = {}) ⇒ Array<(ListingVDP, Fixnum, Hash)>
Get listing HTML Cached HTML of the Vehicle Details Page (VDP) for the listing.
-
#get_listing_with_http_info(api_key, id, opts = {}) ⇒ Array<(Listing, Fixnum, Hash)>
Listing by id Get a particular listing by its id.
-
#initialize(api_client = ApiClient.default) ⇒ ListingsApi
constructor
A new instance of ListingsApi.
-
#search(api_key, latitude, longitude, radius, car_type, opts = {}) ⇒ SearchResponse
Gets active car listings for the given search criteria This endpoint is the meat of the API and serves many purposes.
-
#search_with_http_info(api_key, latitude, longitude, radius, car_type, opts = {}) ⇒ Array<(SearchResponse, Fixnum, Hash)>
Gets active car listings for the given search criteria This endpoint is the meat of the API and serves many purposes.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ ListingsApi
Returns a new instance of ListingsApi.
19 20 21 |
# File 'lib/swagger_client/api/listings_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/listings_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#get_listing(api_key, id, opts = {}) ⇒ Listing
Listing by id Get a particular listing by its id
29 30 31 32 |
# File 'lib/swagger_client/api/listings_api.rb', line 29 def get_listing(api_key, id, opts = {}) data, status_code, headers = get_listing_with_http_info(api_key, id, opts) return data end |
#get_listing_extra(api_key, id, opts = {}) ⇒ ListingExtraAttributes
Long text Listings attributes for Listing with the given id Get listing options, features, seller comments
95 96 97 98 |
# File 'lib/swagger_client/api/listings_api.rb', line 95 def get_listing_extra(api_key, id, opts = {}) data, status_code, headers = get_listing_extra_with_http_info(api_key, id, opts) return data end |
#get_listing_extra_with_http_info(api_key, id, opts = {}) ⇒ Array<(ListingExtraAttributes, Fixnum, Hash)>
Long text Listings attributes for Listing with the given id Get listing options, features, seller comments
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 |
# File 'lib/swagger_client/api/listings_api.rb', line 106 def get_listing_extra_with_http_info(api_key, id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ListingsApi#get_listing_extra ..." end # verify the required parameter 'api_key' is set fail "Missing the required parameter 'api_key' when calling get_listing_extra" if api_key.nil? # verify the required parameter 'id' is set fail "Missing the required parameter 'id' when calling get_listing_extra" if id.nil? # resource path local_var_path = "/listing/{id}/extra".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 => 'ListingExtraAttributes') if @api_client.config.debugging @api_client.config.logger.debug "API called: ListingsApi#get_listing_extra\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_listing_media(api_key, id, opts = {}) ⇒ ListingMedia
Listing media by id Get listing media (photo, photos) by id
161 162 163 164 |
# File 'lib/swagger_client/api/listings_api.rb', line 161 def get_listing_media(api_key, id, opts = {}) data, status_code, headers = get_listing_media_with_http_info(api_key, id, opts) return data end |
#get_listing_media_with_http_info(api_key, id, opts = {}) ⇒ Array<(ListingMedia, Fixnum, Hash)>
Listing media by id Get listing media (photo, photos) by id
172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 |
# File 'lib/swagger_client/api/listings_api.rb', line 172 def get_listing_media_with_http_info(api_key, id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ListingsApi#get_listing_media ..." end # verify the required parameter 'api_key' is set fail "Missing the required parameter 'api_key' when calling get_listing_media" if api_key.nil? # verify the required parameter 'id' is set fail "Missing the required parameter 'id' when calling get_listing_media" if id.nil? # resource path local_var_path = "/listing/{id}/media".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 => 'ListingMedia') if @api_client.config.debugging @api_client.config.logger.debug "API called: ListingsApi#get_listing_media\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_listing_vdp(api_key, id, opts = {}) ⇒ ListingVDP
Get listing HTML Cached HTML of the Vehicle Details Page (VDP) for the listing. The HTML is cached only for 7 days for all listings. So this API could be used to get HTML of mostly active listings and that have recently expired
227 228 229 230 |
# File 'lib/swagger_client/api/listings_api.rb', line 227 def get_listing_vdp(api_key, id, opts = {}) data, status_code, headers = get_listing_vdp_with_http_info(api_key, id, opts) return data end |
#get_listing_vdp_with_http_info(api_key, id, opts = {}) ⇒ Array<(ListingVDP, Fixnum, Hash)>
Get listing HTML Cached HTML of the Vehicle Details Page (VDP) for the listing. The HTML is cached only for 7 days for all listings. So this API could be used to get HTML of mostly active listings and that have recently expired
238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 |
# File 'lib/swagger_client/api/listings_api.rb', line 238 def get_listing_vdp_with_http_info(api_key, id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ListingsApi#get_listing_vdp ..." end # verify the required parameter 'api_key' is set fail "Missing the required parameter 'api_key' when calling get_listing_vdp" if api_key.nil? # verify the required parameter 'id' is set fail "Missing the required parameter 'id' when calling get_listing_vdp" if id.nil? # resource path local_var_path = "/listing/{id}/vdp".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 => 'ListingVDP') if @api_client.config.debugging @api_client.config.logger.debug "API called: ListingsApi#get_listing_vdp\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_listing_with_http_info(api_key, id, opts = {}) ⇒ Array<(Listing, Fixnum, Hash)>
Listing by id Get a particular listing by its id
40 41 42 43 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 |
# File 'lib/swagger_client/api/listings_api.rb', line 40 def get_listing_with_http_info(api_key, id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ListingsApi#get_listing ..." end # verify the required parameter 'api_key' is set fail "Missing the required parameter 'api_key' when calling get_listing" if api_key.nil? # verify the required parameter 'id' is set fail "Missing the required parameter 'id' when calling get_listing" if id.nil? # resource path local_var_path = "/listing/{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 => 'Listing') if @api_client.config.debugging @api_client.config.logger.debug "API called: ListingsApi#get_listing\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#search(api_key, latitude, longitude, radius, car_type, opts = {}) ⇒ SearchResponse
Gets active car listings for the given search criteria This endpoint is the meat of the API and serves many purposes. This API produces a list of currently active cars from the market for the given search criteria. The API results are limited to allow pagination upto 1000 rows. n The search API facilitates the following use cases - n1. Search Cars around a given geo-point within a given radius n2. Search cars for a specific year / make / model or combination of these n3. Search cars matching multiple year, make, model combinatins in the same search requestn4. Filter results by most car specification attributesn5. Search for similar cars by VIN or Taxonomy VIN n6. Filter cars within a given price / miles / days on market (dom) rangen7. Specify a sort order for the results on price / miles / dom / listed date n8. Search cars for a given City / State combination n9. Get Facets to build the search drill downs n10. Get Market averages for price/miles/dom/msrp for your search
321 322 323 324 |
# File 'lib/swagger_client/api/listings_api.rb', line 321 def search(api_key, latitude, longitude, radius, car_type, opts = {}) data, status_code, headers = search_with_http_info(api_key, latitude, longitude, radius, car_type, opts) return data end |
#search_with_http_info(api_key, latitude, longitude, radius, car_type, opts = {}) ⇒ Array<(SearchResponse, Fixnum, Hash)>
Gets active car listings for the given search criteria This endpoint is the meat of the API and serves many purposes. This API produces a list of currently active cars from the market for the given search criteria. The API results are limited to allow pagination upto 1000 rows. n The search API facilitates the following use cases - n1. Search Cars around a given geo-point within a given radius n2. Search cars for a specific year / make / model or combination of these n3. Search cars matching multiple year, make, model combinatins in the same search requestn4. Filter results by most car specification attributesn5. Search for similar cars by VIN or Taxonomy VIN n6. Filter cars within a given price / miles / days on market (dom) rangen7. Specify a sort order for the results on price / miles / dom / listed date n8. Search cars for a given City / State combination n9. Get Facets to build the search drill downs n10. Get Market averages for price/miles/dom/msrp for your search
360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 |
# File 'lib/swagger_client/api/listings_api.rb', line 360 def search_with_http_info(api_key, latitude, longitude, radius, car_type, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ListingsApi#search ..." end # verify the required parameter 'api_key' is set fail "Missing the required parameter 'api_key' when calling search" if api_key.nil? # verify the required parameter 'latitude' is set fail "Missing the required parameter 'latitude' when calling search" if latitude.nil? # verify the required parameter 'longitude' is set fail "Missing the required parameter 'longitude' when calling search" if longitude.nil? # verify the required parameter 'radius' is set fail "Missing the required parameter 'radius' when calling search" if radius.nil? # verify the required parameter 'car_type' is set fail "Missing the required parameter 'car_type' when calling search" if car_type.nil? unless ['new', 'used', 'certified'].include?(car_type) fail "invalid value for 'car_type', must be one of new, used, certified" end if opts[:'body_type'] && !['suv', 'sedan', 'pickup', 'minivan', 'coupe', 'hatchback', 'convertible', 'wagon', 'crossover', 'chassis', 'liftback'].include?(opts[:'body_type']) fail 'invalid value for "body_type", must be one of suv, sedan, pickup, minivan, coupe, hatchback, convertible, wagon, crossover, chassis, liftback' end if opts[:'body_subtype'] && !['crew cab', 'quad cab', 'extended cab', 'double cab', 'regular cab', 'super cab', 'mega cab', 'king cab', 'supercab'].include?(opts[:'body_subtype']) fail 'invalid value for "body_subtype", must be one of crew cab, quad cab, extended cab, double cab, regular cab, super cab, mega cab, king cab', 'supercab' end if opts[:'vehicle_type'] && !['suv', 'truck', 'car', 'van'].include?(opts[:'vehicle_type']) fail 'invalid value for "vehicle_type", must be one of suv, truck, car, van' end if opts[:'cylinders'] && !['0', '3', '4', '5', '6', '8', '10', '12', '16'].include?(opts[:'cylinders']) fail 'invalid value for "cylinders", must be one of 0, 3, 4, 5, 6, 8, 10, 12, 16' end if opts[:'transmission'] && !['a', 'm'].include?(opts[:'transmission']) fail 'invalid value for "transmission", must be one of a, m' end if opts[:'drivetrain'] && !['4wd', '2wd', 'awd', 'fwd', 'rwd', '4x2', '4x4'].include?(opts[:'drivetrain']) fail 'invalid value for "drivetrain", must be one of 4wd, 2wd, awd, fwd, rwd, 4x2, 4x4' end # resource path local_var_path = "/search".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[:'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'] query_params[:'dealer_id'] = opts[:'dealer_id'] if opts[:'dealer_id'] query_params[:'body_type'] = opts[:'body_type'] if opts[:'body_type'] query_params[:'body_subtype'] = opts[:'body_subtype'] if opts[:'body_subtype'] query_params[:'vehicle_type'] = opts[:'vehicle_type'] if opts[:'vehicle_type'] query_params[:'vins'] = opts[:'vins'] if opts[:'vins'] query_params[:'taxonomy_vins'] = opts[:'taxonomy_vins'] if opts[:'taxonomy_vins'] query_params[:'ymmt'] = opts[:'ymmt'] if opts[:'ymmt'] query_params[:'cylinders'] = opts[:'cylinders'] if opts[:'cylinders'] query_params[:'transmission'] = opts[:'transmission'] if opts[:'transmission'] query_params[:'drivetrain'] = opts[:'drivetrain'] if opts[:'drivetrain'] query_params[:'exterior_color'] = opts[:'exterior_color'] if opts[:'exterior_color'] query_params[:'interior_color'] = opts[:'interior_color'] if opts[:'interior_color'] query_params[:'miles_range'] = opts[:'miles_range'] if opts[:'miles_range'] query_params[:'price_range'] = opts[:'price_range'] if opts[:'price_range'] query_params[:'dom_range'] = opts[:'dom_range'] if opts[:'dom_range'] query_params[:'sort_by'] = opts[:'sort_by'] if opts[:'sort_by'] query_params[:'sort_order'] = opts[:'sort_order'] if opts[:'sort_order'] query_params[:'rows'] = opts[:'rows'] if opts[:'rows'] query_params[:'start'] = opts[:'start'] if opts[:'start'] query_params[:'facets'] = opts[:'facets'] if opts[:'facets'] query_params[:'stats'] = opts[:'stats'] if opts[:'stats'] # 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 => 'SearchResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: ListingsApi#search\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |