Class: SwaggerClient::VINDecoderApi
- Inherits:
-
Object
- Object
- SwaggerClient::VINDecoderApi
- Defined in:
- lib/swagger_client/api/vin_decoder_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#decode(api_key, vin, opts = {}) ⇒ Build
VIN Decoder Get the basic information on specifications for a car identified by a valid VIN.
-
#decode_with_http_info(api_key, vin, opts = {}) ⇒ Array<(Build, Fixnum, Hash)>
VIN Decoder Get the basic information on specifications for a car identified by a valid VIN.
-
#initialize(api_client = ApiClient.default) ⇒ VINDecoderApi
constructor
A new instance of VINDecoderApi.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ VINDecoderApi
Returns a new instance of VINDecoderApi.
19 20 21 |
# File 'lib/swagger_client/api/vin_decoder_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/vin_decoder_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#decode(api_key, vin, opts = {}) ⇒ Build
VIN Decoder Get the basic information on specifications for a car identified by a valid VIN
29 30 31 32 |
# File 'lib/swagger_client/api/vin_decoder_api.rb', line 29 def decode(api_key, vin, opts = {}) data, status_code, headers = decode_with_http_info(api_key, vin, opts) return data end |
#decode_with_http_info(api_key, vin, opts = {}) ⇒ Array<(Build, Fixnum, Hash)>
VIN Decoder Get the basic information on specifications for a car identified by a valid VIN
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/vin_decoder_api.rb', line 40 def decode_with_http_info(api_key, vin, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: VINDecoderApi#decode ..." end # verify the required parameter 'api_key' is set fail "Missing the required parameter 'api_key' when calling decode" if api_key.nil? # verify the required parameter 'vin' is set fail "Missing the required parameter 'vin' when calling decode" if vin.nil? # resource path local_var_path = "/vin/{vin}/specs".sub('{format}','json').sub('{' + 'vin' + '}', vin.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 => 'Build') if @api_client.config.debugging @api_client.config.logger.debug "API called: VINDecoderApi#decode\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |