marketcheck_ruby_client 1.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +133 -0
- data/docs/Averages.md +13 -0
- data/docs/BaseListing.md +27 -0
- data/docs/Build.md +19 -0
- data/docs/Dealer.md +23 -0
- data/docs/DealerApi.md +230 -0
- data/docs/Error.md +9 -0
- data/docs/FacetItem.md +9 -0
- data/docs/FacetsApi.md +71 -0
- data/docs/GraphsApi.md +73 -0
- data/docs/HistoricalListing.md +19 -0
- data/docs/HistoryApi.md +65 -0
- data/docs/InventoryApi.md +113 -0
- data/docs/Listing.md +23 -0
- data/docs/ListingDebugAttributes.md +13 -0
- data/docs/ListingExtraAttributes.md +10 -0
- data/docs/ListingMedia.md +9 -0
- data/docs/ListingVDP.md +10 -0
- data/docs/ListingsApi.md +324 -0
- data/docs/Location.md +12 -0
- data/docs/MakeModel.md +9 -0
- data/docs/MarketAveragesApi.md +70 -0
- data/docs/MarketTrendsApi.md +72 -0
- data/docs/PlotPoint.md +14 -0
- data/docs/SearchResponse.md +9 -0
- data/docs/TrendPoint.md +12 -0
- data/docs/VINDecoderApi.md +59 -0
- data/git_push.sh +52 -0
- data/lib/marketcheck_ruby_client.rb +65 -0
- data/lib/swagger_client/api/dealer_api.rb +312 -0
- data/lib/swagger_client/api/facets_api.rb +105 -0
- data/lib/swagger_client/api/graphs_api.rb +108 -0
- data/lib/swagger_client/api/history_api.rb +95 -0
- data/lib/swagger_client/api/inventory_api.rb +155 -0
- data/lib/swagger_client/api/listings_api.rb +474 -0
- data/lib/swagger_client/api/market_averages_api.rb +102 -0
- data/lib/swagger_client/api/market_trends_api.rb +108 -0
- data/lib/swagger_client/api/vin_decoder_api.rb +89 -0
- data/lib/swagger_client/api_client.rb +332 -0
- data/lib/swagger_client/api_error.rb +36 -0
- data/lib/swagger_client/configuration.rb +163 -0
- data/lib/swagger_client/models/averages.rb +217 -0
- data/lib/swagger_client/models/base_listing.rb +370 -0
- data/lib/swagger_client/models/build.rb +284 -0
- data/lib/swagger_client/models/dealer.rb +329 -0
- data/lib/swagger_client/models/error.rb +173 -0
- data/lib/swagger_client/models/facet_item.rb +173 -0
- data/lib/swagger_client/models/historical_listing.rb +284 -0
- data/lib/swagger_client/models/listing.rb +327 -0
- data/lib/swagger_client/models/listing_debug_attributes.rb +217 -0
- data/lib/swagger_client/models/listing_extra_attributes.rb +188 -0
- data/lib/swagger_client/models/listing_media.rb +175 -0
- data/lib/swagger_client/models/listing_vdp.rb +185 -0
- data/lib/swagger_client/models/location.rb +207 -0
- data/lib/swagger_client/models/make_model.rb +171 -0
- data/lib/swagger_client/models/plot_point.rb +228 -0
- data/lib/swagger_client/models/search_response.rb +175 -0
- data/lib/swagger_client/models/trend_point.rb +206 -0
- data/lib/swagger_client/version.rb +15 -0
- data/marketcheck_ruby_client-1.0.6.gem +0 -0
- data/marketcheck_ruby_client.gemspec +32 -0
- data/spec/api/dealer_api_spec.rb +109 -0
- data/spec/api/facets_api_spec.rb +57 -0
- data/spec/api/graphs_api_spec.rb +58 -0
- data/spec/api/history_api_spec.rb +54 -0
- data/spec/api/inventory_api_spec.rb +70 -0
- data/spec/api/listings_api_spec.rb +148 -0
- data/spec/api/market_averages_api_spec.rb +57 -0
- data/spec/api/market_trends_api_spec.rb +57 -0
- data/spec/api/vin_decoder_api_spec.rb +52 -0
- data/spec/models/averages_spec.rb +96 -0
- data/spec/models/base_listing_spec.rb +236 -0
- data/spec/models/build_spec.rb +156 -0
- data/spec/models/dealer_spec.rb +196 -0
- data/spec/models/error_spec.rb +56 -0
- data/spec/models/facet_item_spec.rb +56 -0
- data/spec/models/historical_listing_spec.rb +156 -0
- data/spec/models/listing_debug_attributes_spec.rb +96 -0
- data/spec/models/listing_extra_attributes_spec.rb +66 -0
- data/spec/models/listing_media_spec.rb +56 -0
- data/spec/models/listing_spec.rb +196 -0
- data/spec/models/listing_vdp_spec.rb +66 -0
- data/spec/models/location_spec.rb +86 -0
- data/spec/models/make_model_spec.rb +56 -0
- data/spec/models/plot_point_spec.rb +106 -0
- data/spec/models/search_response_spec.rb +56 -0
- data/spec/models/trend_point_spec.rb +86 -0
- metadata +337 -0
data/docs/Location.md
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
# SwaggerClient::Location
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**city** | **String** | City of the listing | [optional]
|
7
|
+
**state** | **String** | State of the listing | [optional]
|
8
|
+
**zip** | **String** | Zip of the listing | [optional]
|
9
|
+
**latitude** | **Float** | Latitude component of the location | [optional]
|
10
|
+
**longitude** | **Float** | Longitude component of the location | [optional]
|
11
|
+
|
12
|
+
|
data/docs/MakeModel.md
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
# SwaggerClient::MarketAveragesApi
|
2
|
+
|
3
|
+
All URIs are relative to *http://api.marketcheck.com/v1*
|
4
|
+
|
5
|
+
Method | HTTP request | Description
|
6
|
+
------------- | ------------- | -------------
|
7
|
+
[**get_averages**](MarketAveragesApi.md#get_averages) | **GET** /averages | Get Averages for YMM
|
8
|
+
|
9
|
+
|
10
|
+
# **get_averages**
|
11
|
+
> Averages get_averages(api_key, , opts)
|
12
|
+
|
13
|
+
Get Averages for YMM
|
14
|
+
|
15
|
+
[Merged with the /search API - Please check the 'stats' parameter to the Search API above] Get market averages for price / miles / msrp / dom (days on market) fields for active cars matching the given reference VIN's basic specification or Year, Make, Model, Trim (Optional) criteria
|
16
|
+
|
17
|
+
### Example
|
18
|
+
```ruby
|
19
|
+
# load the gem
|
20
|
+
require 'marketcheck_ruby_client'
|
21
|
+
|
22
|
+
api_instance = SwaggerClient::MarketAveragesApi.new
|
23
|
+
|
24
|
+
api_key = "api_key_example" # String | The API Authentication Key. Mandatory with all API calls.
|
25
|
+
|
26
|
+
opts = {
|
27
|
+
vin: "vin_example", # String | VIN as a reference to the type of car for which averages data is to be returned
|
28
|
+
year: "year_example", # String | Year of the car
|
29
|
+
make: "make_example", # String | Make of the car
|
30
|
+
model: "model_example", # String | Model of the Car
|
31
|
+
trim: "trim_example", # String | Trim of the Car
|
32
|
+
fields: "fields_example" # String | Comma separated list of fields to generate stats for. Allowed fields in the list are - price, miles, msrp, dom (days on market)
|
33
|
+
}
|
34
|
+
|
35
|
+
begin
|
36
|
+
#Get Averages for YMM
|
37
|
+
result = api_instance.get_averages(api_key, , opts)
|
38
|
+
p result
|
39
|
+
rescue SwaggerClient::ApiError => e
|
40
|
+
puts "Exception when calling MarketAveragesApi->get_averages: #{e}"
|
41
|
+
end
|
42
|
+
```
|
43
|
+
|
44
|
+
### Parameters
|
45
|
+
|
46
|
+
Name | Type | Description | Notes
|
47
|
+
------------- | ------------- | ------------- | -------------
|
48
|
+
**api_key** | **String**| The API Authentication Key. Mandatory with all API calls. |
|
49
|
+
**vin** | **String**| VIN as a reference to the type of car for which averages data is to be returned | [optional]
|
50
|
+
**year** | **String**| Year of the car | [optional]
|
51
|
+
**make** | **String**| Make of the car | [optional]
|
52
|
+
**model** | **String**| Model of the Car | [optional]
|
53
|
+
**trim** | **String**| Trim of the Car | [optional]
|
54
|
+
**fields** | **String**| Comma separated list of fields to generate stats for. Allowed fields in the list are - price, miles, msrp, dom (days on market) | [optional]
|
55
|
+
|
56
|
+
### Return type
|
57
|
+
|
58
|
+
[**Averages**](Averages.md)
|
59
|
+
|
60
|
+
### Authorization
|
61
|
+
|
62
|
+
No authorization required
|
63
|
+
|
64
|
+
### HTTP reuqest headers
|
65
|
+
|
66
|
+
- **Content-Type**: Not defined
|
67
|
+
- **Accept**: application/json
|
68
|
+
|
69
|
+
|
70
|
+
|
@@ -0,0 +1,72 @@
|
|
1
|
+
# SwaggerClient::MarketTrendsApi
|
2
|
+
|
3
|
+
All URIs are relative to *http://api.marketcheck.com/v1*
|
4
|
+
|
5
|
+
Method | HTTP request | Description
|
6
|
+
------------- | ------------- | -------------
|
7
|
+
[**get_trends**](MarketTrendsApi.md#get_trends) | **GET** /trends | Get Trends for criteria
|
8
|
+
|
9
|
+
|
10
|
+
# **get_trends**
|
11
|
+
> Array<TrendPoint> get_trends(api_key, vin, car_type, opts)
|
12
|
+
|
13
|
+
Get Trends for criteria
|
14
|
+
|
15
|
+
Get historical market trends for cars matching the given VIN's basic specification or Year, Make, Model, Trim (Optional) criteria
|
16
|
+
|
17
|
+
### Example
|
18
|
+
```ruby
|
19
|
+
# load the gem
|
20
|
+
require 'marketcheck_ruby_client'
|
21
|
+
|
22
|
+
api_instance = SwaggerClient::MarketTrendsApi.new
|
23
|
+
|
24
|
+
api_key = "api_key_example" # String | The API Authentication Key. Mandatory with all API calls.
|
25
|
+
|
26
|
+
vin = "vin_example" # String | VIN as a reference to the type of car for which trend data is to be returned
|
27
|
+
|
28
|
+
car_type = "car_type_example" # String | Car type. Allowed values are - new / used / certified
|
29
|
+
|
30
|
+
opts = {
|
31
|
+
year: "year_example", # String | Year of the car
|
32
|
+
make: "make_example", # String | Make of the car
|
33
|
+
model: "model_example", # String | Model of the Car
|
34
|
+
trim: "trim_example" # String | Trim of the Car
|
35
|
+
}
|
36
|
+
|
37
|
+
begin
|
38
|
+
#Get Trends for criteria
|
39
|
+
result = api_instance.get_trends(api_key, vin, car_type, opts)
|
40
|
+
p result
|
41
|
+
rescue SwaggerClient::ApiError => e
|
42
|
+
puts "Exception when calling MarketTrendsApi->get_trends: #{e}"
|
43
|
+
end
|
44
|
+
```
|
45
|
+
|
46
|
+
### Parameters
|
47
|
+
|
48
|
+
Name | Type | Description | Notes
|
49
|
+
------------- | ------------- | ------------- | -------------
|
50
|
+
**api_key** | **String**| The API Authentication Key. Mandatory with all API calls. |
|
51
|
+
**vin** | **String**| VIN as a reference to the type of car for which trend data is to be returned |
|
52
|
+
**car_type** | **String**| Car type. Allowed values are - new / used / certified |
|
53
|
+
**year** | **String**| Year of the car | [optional]
|
54
|
+
**make** | **String**| Make of the car | [optional]
|
55
|
+
**model** | **String**| Model of the Car | [optional]
|
56
|
+
**trim** | **String**| Trim of the Car | [optional]
|
57
|
+
|
58
|
+
### Return type
|
59
|
+
|
60
|
+
[**Array<TrendPoint>**](TrendPoint.md)
|
61
|
+
|
62
|
+
### Authorization
|
63
|
+
|
64
|
+
No authorization required
|
65
|
+
|
66
|
+
### HTTP reuqest headers
|
67
|
+
|
68
|
+
- **Content-Type**: Not defined
|
69
|
+
- **Accept**: application/json
|
70
|
+
|
71
|
+
|
72
|
+
|
data/docs/PlotPoint.md
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
# SwaggerClient::PlotPoint
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**price** | **Float** | Price | [optional]
|
7
|
+
**miles** | **Float** | Miles | [optional]
|
8
|
+
**vin** | **String** | Vin | [optional]
|
9
|
+
**msrp** | **Float** | Msrp | [optional]
|
10
|
+
**dom** | **Float** | DOM | [optional]
|
11
|
+
**seller_name** | **String** | Seller name | [optional]
|
12
|
+
**id** | **String** | Listing id | [optional]
|
13
|
+
|
14
|
+
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# SwaggerClient::SearchResponse
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**num_found** | **Float** | The number of listings found | [optional]
|
7
|
+
**listings** | [**Array<BaseListing>**](BaseListing.md) | | [optional]
|
8
|
+
|
9
|
+
|
data/docs/TrendPoint.md
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
# SwaggerClient::TrendPoint
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**price** | **Float** | Price | [optional]
|
7
|
+
**miles** | **Float** | Miles | [optional]
|
8
|
+
**dom** | **Float** | Days on Market | [optional]
|
9
|
+
**units** | **Float** | Units | [optional]
|
10
|
+
**msrp** | **Float** | MSRP | [optional]
|
11
|
+
|
12
|
+
|
@@ -0,0 +1,59 @@
|
|
1
|
+
# SwaggerClient::VINDecoderApi
|
2
|
+
|
3
|
+
All URIs are relative to *http://api.marketcheck.com/v1*
|
4
|
+
|
5
|
+
Method | HTTP request | Description
|
6
|
+
------------- | ------------- | -------------
|
7
|
+
[**decode**](VINDecoderApi.md#decode) | **GET** /vin/{vin}/specs | VIN Decoder
|
8
|
+
|
9
|
+
|
10
|
+
# **decode**
|
11
|
+
> Build decode(api_key, vin)
|
12
|
+
|
13
|
+
VIN Decoder
|
14
|
+
|
15
|
+
Get the basic information on specifications for a car identified by a valid VIN
|
16
|
+
|
17
|
+
### Example
|
18
|
+
```ruby
|
19
|
+
# load the gem
|
20
|
+
require 'marketcheck_ruby_client'
|
21
|
+
|
22
|
+
api_instance = SwaggerClient::VINDecoderApi.new
|
23
|
+
|
24
|
+
api_key = "api_key_example" # String | The API Authentication Key. Mandatory with all API calls.
|
25
|
+
|
26
|
+
vin = "vin_example" # String | VIN to decode
|
27
|
+
|
28
|
+
|
29
|
+
begin
|
30
|
+
#VIN Decoder
|
31
|
+
result = api_instance.decode(api_key, vin)
|
32
|
+
p result
|
33
|
+
rescue SwaggerClient::ApiError => e
|
34
|
+
puts "Exception when calling VINDecoderApi->decode: #{e}"
|
35
|
+
end
|
36
|
+
```
|
37
|
+
|
38
|
+
### Parameters
|
39
|
+
|
40
|
+
Name | Type | Description | Notes
|
41
|
+
------------- | ------------- | ------------- | -------------
|
42
|
+
**api_key** | **String**| The API Authentication Key. Mandatory with all API calls. |
|
43
|
+
**vin** | **String**| VIN to decode |
|
44
|
+
|
45
|
+
### Return type
|
46
|
+
|
47
|
+
[**Build**](Build.md)
|
48
|
+
|
49
|
+
### Authorization
|
50
|
+
|
51
|
+
No authorization required
|
52
|
+
|
53
|
+
### HTTP reuqest headers
|
54
|
+
|
55
|
+
- **Content-Type**: Not defined
|
56
|
+
- **Accept**: application/json
|
57
|
+
|
58
|
+
|
59
|
+
|
data/git_push.sh
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
|
3
|
+
#
|
4
|
+
# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update"
|
5
|
+
|
6
|
+
git_user_id=$1
|
7
|
+
git_repo_id=$2
|
8
|
+
release_note=$3
|
9
|
+
|
10
|
+
if [ "$git_user_id" = "" ]; then
|
11
|
+
git_user_id=""
|
12
|
+
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
|
13
|
+
fi
|
14
|
+
|
15
|
+
if [ "$git_repo_id" = "" ]; then
|
16
|
+
git_repo_id=""
|
17
|
+
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
|
18
|
+
fi
|
19
|
+
|
20
|
+
if [ "$release_note" = "" ]; then
|
21
|
+
release_note=""
|
22
|
+
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
|
23
|
+
fi
|
24
|
+
|
25
|
+
# Initialize the local directory as a Git repository
|
26
|
+
git init
|
27
|
+
|
28
|
+
# Adds the files in the local repository and stages them for commit.
|
29
|
+
git add .
|
30
|
+
|
31
|
+
# Commits the tracked changes and prepares them to be pushed to a remote repository.
|
32
|
+
git commit -m "$release_note"
|
33
|
+
|
34
|
+
# Sets the new remote
|
35
|
+
git_remote=`git remote`
|
36
|
+
if [ "$git_remote" = "" ]; then # git remote not defined
|
37
|
+
|
38
|
+
if [ "$GIT_TOKEN" = "" ]; then
|
39
|
+
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git crediential in your environment."
|
40
|
+
git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
|
41
|
+
else
|
42
|
+
git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
|
43
|
+
fi
|
44
|
+
|
45
|
+
fi
|
46
|
+
|
47
|
+
git pull origin master
|
48
|
+
|
49
|
+
# Pushes (Forces) the changes in the local repository up to the remote repository
|
50
|
+
echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
|
51
|
+
git push origin master 2>&1 | grep -v 'To https'
|
52
|
+
|
@@ -0,0 +1,65 @@
|
|
1
|
+
=begin
|
2
|
+
Marketcheck Cars API
|
3
|
+
|
4
|
+
<b>Access the New, Used and Certified cars inventories for all Car Dealers in US.</b> <br/>The data is sourced from online listings by over 40,000 Car dealers in US. At any time, there are about 5.2M searchable listings (about 1.8M unique VINs) for Used & Certified cars and about 5M (about 2.3M unique VINs) New Car listings from all over US. We use this API at the back for our website <a href='http://www.marketcheck.com' target='_blank'>www.marketcheck.com</a> and our Android and iOS mobile apps too.<br/><h5> Few useful links : </h5><ul><li>A quick view of the API and the use cases is depicated <a href='https://portals.marketcheck.com/mcapi/' target='_blank'>here</a></li><li>The Postman collection with various usages of the API is shared here https://www.getpostman.com/collections/2752684ff636cdd7bac2</li><li> [Coming soon] API Key : Request your API Key <a href='https://portals.marketcheck.com/api' target='_blank'> here </a> </li><li> [Coming soon] Benchmarks : See the API benchmarks <a href='https://portals.marketcheck.com/mcapi/benchmarks'>here</a></li></ul>
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.0.0
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
# Common files
|
14
|
+
require 'swagger_client/api_client'
|
15
|
+
require 'swagger_client/api_error'
|
16
|
+
require 'swagger_client/version'
|
17
|
+
require 'swagger_client/configuration'
|
18
|
+
|
19
|
+
# Models
|
20
|
+
require 'swagger_client/models/averages'
|
21
|
+
require 'swagger_client/models/base_listing'
|
22
|
+
require 'swagger_client/models/build'
|
23
|
+
require 'swagger_client/models/dealer'
|
24
|
+
require 'swagger_client/models/error'
|
25
|
+
require 'swagger_client/models/facet_item'
|
26
|
+
require 'swagger_client/models/historical_listing'
|
27
|
+
require 'swagger_client/models/listing'
|
28
|
+
require 'swagger_client/models/listing_debug_attributes'
|
29
|
+
require 'swagger_client/models/listing_extra_attributes'
|
30
|
+
require 'swagger_client/models/listing_media'
|
31
|
+
require 'swagger_client/models/listing_vdp'
|
32
|
+
require 'swagger_client/models/location'
|
33
|
+
require 'swagger_client/models/make_model'
|
34
|
+
require 'swagger_client/models/plot_point'
|
35
|
+
require 'swagger_client/models/search_response'
|
36
|
+
require 'swagger_client/models/trend_point'
|
37
|
+
|
38
|
+
# APIs
|
39
|
+
require 'swagger_client/api/dealer_api'
|
40
|
+
require 'swagger_client/api/facets_api'
|
41
|
+
require 'swagger_client/api/graphs_api'
|
42
|
+
require 'swagger_client/api/history_api'
|
43
|
+
require 'swagger_client/api/inventory_api'
|
44
|
+
require 'swagger_client/api/listings_api'
|
45
|
+
require 'swagger_client/api/market_averages_api'
|
46
|
+
require 'swagger_client/api/market_trends_api'
|
47
|
+
require 'swagger_client/api/vin_decoder_api'
|
48
|
+
|
49
|
+
module SwaggerClient
|
50
|
+
class << self
|
51
|
+
# Customize default settings for the SDK using block.
|
52
|
+
# SwaggerClient.configure do |config|
|
53
|
+
# config.username = "xxx"
|
54
|
+
# config.password = "xxx"
|
55
|
+
# end
|
56
|
+
# If no block given, return the default Configuration object.
|
57
|
+
def configure
|
58
|
+
if block_given?
|
59
|
+
yield(Configuration.default)
|
60
|
+
else
|
61
|
+
Configuration.default
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
@@ -0,0 +1,312 @@
|
|
1
|
+
=begin
|
2
|
+
Marketcheck Cars API
|
3
|
+
|
4
|
+
<b>Access the New, Used and Certified cars inventories for all Car Dealers in US.</b> <br/>The data is sourced from online listings by over 40,000 Car dealers in US. At any time, there are about 5.2M searchable listings (about 1.8M unique VINs) for Used & Certified cars and about 5M (about 2.3M unique VINs) New Car listings from all over US. We use this API at the back for our website <a href='http://www.marketcheck.com' target='_blank'>www.marketcheck.com</a> and our Android and iOS mobile apps too.<br/><h5> Few useful links : </h5><ul><li>A quick view of the API and the use cases is depicated <a href='https://portals.marketcheck.com/mcapi/' target='_blank'>here</a></li><li>The Postman collection with various usages of the API is shared here https://www.getpostman.com/collections/2752684ff636cdd7bac2</li><li> [Coming soon] API Key : Request your API Key <a href='https://portals.marketcheck.com/api' target='_blank'> here </a> </li><li> [Coming soon] Benchmarks : See the API benchmarks <a href='https://portals.marketcheck.com/mcapi/benchmarks'>here</a></li></ul>
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.0.3
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require "uri"
|
14
|
+
|
15
|
+
module SwaggerClient
|
16
|
+
class DealerApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
|
23
|
+
# Find car dealers around
|
24
|
+
# The dealers API returns a list of dealers around a given point and radius. Max radius of only 50 miles is supported.
|
25
|
+
# @param api_key The API Authentication Key. Mandatory with all API calls.
|
26
|
+
# @param latitude Latitude component of location
|
27
|
+
# @param longitude Longitude component of location
|
28
|
+
# @param radius Radius around the search location
|
29
|
+
# @param type Dealer inventory type. Allowed values are - new / used / certified
|
30
|
+
# @param [Hash] opts the optional parameters
|
31
|
+
# @option opts [Float] :rows Number of results to return. Default is 10. Max is 50
|
32
|
+
# @option opts [Float] :start Offset for the search results. Default is 1.
|
33
|
+
# @return [Array<Dealer>]
|
34
|
+
def dealer_search(api_key, latitude, longitude, radius, type, opts = {})
|
35
|
+
data, status_code, headers = dealer_search_with_http_info(api_key, latitude, longitude, radius, type, opts)
|
36
|
+
return data
|
37
|
+
end
|
38
|
+
|
39
|
+
# Find car dealers around
|
40
|
+
# The dealers API returns a list of dealers around a given point and radius. Max radius of only 50 miles is supported.
|
41
|
+
# @param api_key The API Authentication Key. Mandatory with all API calls.
|
42
|
+
# @param latitude Latitude component of location
|
43
|
+
# @param longitude Longitude component of location
|
44
|
+
# @param radius Radius around the search location
|
45
|
+
# @param type Dealer inventory type. Allowed values are - new / used / certified
|
46
|
+
# @param [Hash] opts the optional parameters
|
47
|
+
# @option opts [Float] :rows Number of results to return. Default is 10. Max is 50
|
48
|
+
# @option opts [Float] :start Offset for the search results. Default is 1.
|
49
|
+
# @return [Array<(Array<Dealer>, Fixnum, Hash)>] Array<Dealer> data, response status code and response headers
|
50
|
+
def dealer_search_with_http_info(api_key, latitude, longitude, radius, type, opts = {})
|
51
|
+
if @api_client.config.debugging
|
52
|
+
@api_client.config.logger.debug "Calling API: DealerApi#dealer_search ..."
|
53
|
+
end
|
54
|
+
|
55
|
+
# verify the required parameter 'api_key' is set
|
56
|
+
fail "Missing the required parameter 'api_key' when calling dealer_search" if api_key.nil?
|
57
|
+
|
58
|
+
# verify the required parameter 'latitude' is set
|
59
|
+
fail "Missing the required parameter 'latitude' when calling dealer_search" if latitude.nil?
|
60
|
+
|
61
|
+
# verify the required parameter 'longitude' is set
|
62
|
+
fail "Missing the required parameter 'longitude' when calling dealer_search" if longitude.nil?
|
63
|
+
|
64
|
+
# verify the required parameter 'radius' is set
|
65
|
+
fail "Missing the required parameter 'radius' when calling dealer_search" if radius.nil?
|
66
|
+
|
67
|
+
# verify the required parameter 'type' is set
|
68
|
+
fail "Missing the required parameter 'type' when calling dealer_search" if type.nil?
|
69
|
+
|
70
|
+
# resource path
|
71
|
+
local_var_path = "/dealers".sub('{format}','json')
|
72
|
+
|
73
|
+
# query parameters
|
74
|
+
query_params = {}
|
75
|
+
query_params[:'api_key'] = api_key
|
76
|
+
query_params[:'latitude'] = latitude
|
77
|
+
query_params[:'longitude'] = longitude
|
78
|
+
query_params[:'radius'] = radius
|
79
|
+
query_params[:'type'] = type
|
80
|
+
query_params[:'rows'] = opts[:'rows'] if opts[:'rows']
|
81
|
+
query_params[:'start'] = opts[:'start'] if opts[:'start']
|
82
|
+
|
83
|
+
# header parameters
|
84
|
+
header_params = {}
|
85
|
+
|
86
|
+
# HTTP header 'Accept' (if needed)
|
87
|
+
_header_accept = ['application/json']
|
88
|
+
_header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
|
89
|
+
|
90
|
+
# HTTP header 'Content-Type'
|
91
|
+
_header_content_type = []
|
92
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
|
93
|
+
|
94
|
+
# form parameters
|
95
|
+
form_params = {}
|
96
|
+
|
97
|
+
# http body (model)
|
98
|
+
post_body = nil
|
99
|
+
|
100
|
+
auth_names = []
|
101
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
102
|
+
:header_params => header_params,
|
103
|
+
:query_params => query_params,
|
104
|
+
:form_params => form_params,
|
105
|
+
:body => post_body,
|
106
|
+
:auth_names => auth_names,
|
107
|
+
:return_type => 'Array<Dealer>')
|
108
|
+
if @api_client.config.debugging
|
109
|
+
@api_client.config.logger.debug "API called: DealerApi#dealer_search\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
110
|
+
end
|
111
|
+
return data, status_code, headers
|
112
|
+
end
|
113
|
+
|
114
|
+
# Dealer by id
|
115
|
+
# Get a particular dealer's information by its id
|
116
|
+
# @param api_key The API Authentication Key. Mandatory with all API calls.
|
117
|
+
# @param id Dealer id to get all the dealer info attributes
|
118
|
+
# @param [Hash] opts the optional parameters
|
119
|
+
# @return [Dealer]
|
120
|
+
def get_dealer(api_key, id, opts = {})
|
121
|
+
data, status_code, headers = get_dealer_with_http_info(api_key, id, opts)
|
122
|
+
return data
|
123
|
+
end
|
124
|
+
|
125
|
+
# Dealer by id
|
126
|
+
# Get a particular dealer's information by its id
|
127
|
+
# @param api_key The API Authentication Key. Mandatory with all API calls.
|
128
|
+
# @param id Dealer id to get all the dealer info attributes
|
129
|
+
# @param [Hash] opts the optional parameters
|
130
|
+
# @return [Array<(Dealer, Fixnum, Hash)>] Dealer data, response status code and response headers
|
131
|
+
def get_dealer_with_http_info(api_key, id, opts = {})
|
132
|
+
if @api_client.config.debugging
|
133
|
+
@api_client.config.logger.debug "Calling API: DealerApi#get_dealer ..."
|
134
|
+
end
|
135
|
+
|
136
|
+
# verify the required parameter 'api_key' is set
|
137
|
+
fail "Missing the required parameter 'api_key' when calling get_dealer" if api_key.nil?
|
138
|
+
|
139
|
+
# verify the required parameter 'id' is set
|
140
|
+
fail "Missing the required parameter 'id' when calling get_dealer" if id.nil?
|
141
|
+
|
142
|
+
# resource path
|
143
|
+
local_var_path = "/dealer/{id}".sub('{format}','json').sub('{' + 'id' + '}', id.to_s)
|
144
|
+
|
145
|
+
# query parameters
|
146
|
+
query_params = {}
|
147
|
+
query_params[:'api_key'] = api_key
|
148
|
+
|
149
|
+
# header parameters
|
150
|
+
header_params = {}
|
151
|
+
|
152
|
+
# HTTP header 'Accept' (if needed)
|
153
|
+
_header_accept = ['application/json']
|
154
|
+
_header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
|
155
|
+
|
156
|
+
# HTTP header 'Content-Type'
|
157
|
+
_header_content_type = []
|
158
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
|
159
|
+
|
160
|
+
# form parameters
|
161
|
+
form_params = {}
|
162
|
+
|
163
|
+
# http body (model)
|
164
|
+
post_body = nil
|
165
|
+
|
166
|
+
auth_names = []
|
167
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
168
|
+
:header_params => header_params,
|
169
|
+
:query_params => query_params,
|
170
|
+
:form_params => form_params,
|
171
|
+
:body => post_body,
|
172
|
+
:auth_names => auth_names,
|
173
|
+
:return_type => 'Dealer')
|
174
|
+
if @api_client.config.debugging
|
175
|
+
@api_client.config.logger.debug "API called: DealerApi#get_dealer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
176
|
+
end
|
177
|
+
return data, status_code, headers
|
178
|
+
end
|
179
|
+
|
180
|
+
# Dealer inventory
|
181
|
+
# Get a dealer's currently active inventory
|
182
|
+
# @param api_key The API Authentication Key. Mandatory with all API calls.
|
183
|
+
# @param dealer_id Id representing the dealer to fetch the active inventory for
|
184
|
+
# @param [Hash] opts the optional parameters
|
185
|
+
# @option opts [String] :rows Number of results to return. Default is 10. Max is 50
|
186
|
+
# @option opts [String] :start 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
|
187
|
+
# @return [BaseListing]
|
188
|
+
def get_dealer_active_inventory(api_key, dealer_id, opts = {})
|
189
|
+
data, status_code, headers = get_dealer_active_inventory_with_http_info(api_key, dealer_id, opts)
|
190
|
+
return data
|
191
|
+
end
|
192
|
+
|
193
|
+
# Dealer inventory
|
194
|
+
# Get a dealer's currently active inventory
|
195
|
+
# @param api_key The API Authentication Key. Mandatory with all API calls.
|
196
|
+
# @param dealer_id Id representing the dealer to fetch the active inventory for
|
197
|
+
# @param [Hash] opts the optional parameters
|
198
|
+
# @option opts [String] :rows Number of results to return. Default is 10. Max is 50
|
199
|
+
# @option opts [String] :start 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
|
200
|
+
# @return [Array<(BaseListing, Fixnum, Hash)>] BaseListing data, response status code and response headers
|
201
|
+
def get_dealer_active_inventory_with_http_info(api_key, dealer_id, opts = {})
|
202
|
+
if @api_client.config.debugging
|
203
|
+
@api_client.config.logger.debug "Calling API: DealerApi#get_dealer_active_inventory ..."
|
204
|
+
end
|
205
|
+
|
206
|
+
# verify the required parameter 'api_key' is set
|
207
|
+
fail "Missing the required parameter 'api_key' when calling get_dealer_active_inventory" if api_key.nil?
|
208
|
+
|
209
|
+
# verify the required parameter 'dealer_id' is set
|
210
|
+
fail "Missing the required parameter 'dealer_id' when calling get_dealer_active_inventory" if dealer_id.nil?
|
211
|
+
|
212
|
+
# resource path
|
213
|
+
local_var_path = "/dealer/{dealer_id}/active/inventory".sub('{format}','json').sub('{' + 'dealer_id' + '}', dealer_id.to_s)
|
214
|
+
|
215
|
+
# query parameters
|
216
|
+
query_params = {}
|
217
|
+
query_params[:'api_key'] = api_key
|
218
|
+
query_params[:'rows'] = opts[:'rows'] if opts[:'rows']
|
219
|
+
query_params[:'start'] = opts[:'start'] if opts[:'start']
|
220
|
+
|
221
|
+
# header parameters
|
222
|
+
header_params = {}
|
223
|
+
|
224
|
+
# HTTP header 'Accept' (if needed)
|
225
|
+
_header_accept = ['application/json']
|
226
|
+
_header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
|
227
|
+
|
228
|
+
# HTTP header 'Content-Type'
|
229
|
+
_header_content_type = []
|
230
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
|
231
|
+
|
232
|
+
# form parameters
|
233
|
+
form_params = {}
|
234
|
+
|
235
|
+
# http body (model)
|
236
|
+
post_body = nil
|
237
|
+
|
238
|
+
auth_names = []
|
239
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
240
|
+
:header_params => header_params,
|
241
|
+
:query_params => query_params,
|
242
|
+
:form_params => form_params,
|
243
|
+
:body => post_body,
|
244
|
+
:auth_names => auth_names,
|
245
|
+
:return_type => 'BaseListing')
|
246
|
+
if @api_client.config.debugging
|
247
|
+
@api_client.config.logger.debug "API called: DealerApi#get_dealer_active_inventory\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
248
|
+
end
|
249
|
+
return data, status_code, headers
|
250
|
+
end
|
251
|
+
|
252
|
+
# Dealer's historical inventory
|
253
|
+
# [v1 : Not Implemented Yet] - Get a dealer's historical inventory
|
254
|
+
# @param dealer_id Id representing the dealer to fetch the active inventory for
|
255
|
+
# @param [Hash] opts the optional parameters
|
256
|
+
# @return [BaseListing]
|
257
|
+
def get_dealer_historical_inventory(dealer_id, opts = {})
|
258
|
+
data, status_code, headers = get_dealer_historical_inventory_with_http_info(dealer_id, opts)
|
259
|
+
return data
|
260
|
+
end
|
261
|
+
|
262
|
+
# Dealer's historical inventory
|
263
|
+
# [v1 : Not Implemented Yet] - Get a dealer's historical inventory
|
264
|
+
# @param dealer_id Id representing the dealer to fetch the active inventory for
|
265
|
+
# @param [Hash] opts the optional parameters
|
266
|
+
# @return [Array<(BaseListing, Fixnum, Hash)>] BaseListing data, response status code and response headers
|
267
|
+
def get_dealer_historical_inventory_with_http_info(dealer_id, opts = {})
|
268
|
+
if @api_client.config.debugging
|
269
|
+
@api_client.config.logger.debug "Calling API: DealerApi#get_dealer_historical_inventory ..."
|
270
|
+
end
|
271
|
+
|
272
|
+
# verify the required parameter 'dealer_id' is set
|
273
|
+
fail "Missing the required parameter 'dealer_id' when calling get_dealer_historical_inventory" if dealer_id.nil?
|
274
|
+
|
275
|
+
# resource path
|
276
|
+
local_var_path = "/dealer/{dealer_id}/historical/inventory".sub('{format}','json').sub('{' + 'dealer_id' + '}', dealer_id.to_s)
|
277
|
+
|
278
|
+
# query parameters
|
279
|
+
query_params = {}
|
280
|
+
|
281
|
+
# header parameters
|
282
|
+
header_params = {}
|
283
|
+
|
284
|
+
# HTTP header 'Accept' (if needed)
|
285
|
+
_header_accept = ['application/json']
|
286
|
+
_header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
|
287
|
+
|
288
|
+
# HTTP header 'Content-Type'
|
289
|
+
_header_content_type = []
|
290
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
|
291
|
+
|
292
|
+
# form parameters
|
293
|
+
form_params = {}
|
294
|
+
|
295
|
+
# http body (model)
|
296
|
+
post_body = nil
|
297
|
+
|
298
|
+
auth_names = []
|
299
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
300
|
+
:header_params => header_params,
|
301
|
+
:query_params => query_params,
|
302
|
+
:form_params => form_params,
|
303
|
+
:body => post_body,
|
304
|
+
:auth_names => auth_names,
|
305
|
+
:return_type => 'BaseListing')
|
306
|
+
if @api_client.config.debugging
|
307
|
+
@api_client.config.logger.debug "API called: DealerApi#get_dealer_historical_inventory\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
308
|
+
end
|
309
|
+
return data, status_code, headers
|
310
|
+
end
|
311
|
+
end
|
312
|
+
end
|