Class: SwaggerClient::InventoryApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ InventoryApi

Returns a new instance of InventoryApi.



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

def api_client
  @api_client
end

Instance Method Details

#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:



31
32
33
34
# File 'lib/swagger_client/api/inventory_api.rb', line 31

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



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
88
89
90
91
92
93
# File 'lib/swagger_client/api/inventory_api.rb', line 44

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: InventoryApi#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: InventoryApi#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:



100
101
102
103
# File 'lib/swagger_client/api/inventory_api.rb', line 100

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



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/inventory_api.rb', line 110

def get_dealer_historical_inventory_with_http_info(dealer_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: InventoryApi#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: InventoryApi#get_dealer_historical_inventory\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end