@@ -17,6 +17,7 @@ class EstimatesApi
1717 OPERATIONS = [
1818 :create_air_shipping_estimate ,
1919 :create_bitcoin_estimate ,
20+ :create_ecommerce_estimate ,
2021 :create_ethereum_estimate ,
2122 :create_flight_estimate ,
2223 :create_hotel_estimate ,
@@ -173,6 +174,75 @@ def create_bitcoin_estimate_with_http_info(create_bitcoin_estimate_request, opts
173174 return data , status_code , headers
174175 end
175176
177+ # Create an e-commerce estimate given the distance traveled in meters, package weight, and transportation method.
178+ # Creates a e-commerce estimate for the amount of CO2 to be compensated. An order in the `draft` state may be created based on the parameters.
179+ # @param create_ecommerce_estimate_request [CreateEcommerceEstimateRequest]
180+ # @param [Hash] opts the optional parameters
181+ # @return [EstimateResponse]
182+ def create_ecommerce_estimate ( create_ecommerce_estimate_request = { } , opts = { } )
183+ _create_ecommerce_estimate_request = Patch ::CreateEcommerceEstimateRequest . new ( create_ecommerce_estimate_request )
184+ data , _status_code , _headers = create_ecommerce_estimate_with_http_info ( _create_ecommerce_estimate_request , opts )
185+ data
186+ end
187+
188+ # Create an e-commerce estimate given the distance traveled in meters, package weight, and transportation method.
189+ # Creates a e-commerce estimate for the amount of CO2 to be compensated. An order in the `draft` state may be created based on the parameters.
190+ # @param create_ecommerce_estimate_request [CreateEcommerceEstimateRequest]
191+ # @param [Hash] opts the optional parameters
192+ # @return [Array<(EstimateResponse, Integer, Hash)>] EstimateResponse data, response status code and response headers
193+ def create_ecommerce_estimate_with_http_info ( create_ecommerce_estimate_request , opts = { } )
194+ if @api_client . config . debugging
195+ @api_client . config . logger . debug 'Calling API: EstimatesApi.create_ecommerce_estimate ...'
196+ end
197+ # verify the required parameter 'create_ecommerce_estimate_request' is set
198+ if @api_client . config . client_side_validation && create_ecommerce_estimate_request . nil?
199+ fail ArgumentError , "Missing the required parameter 'create_ecommerce_estimate_request' when calling EstimatesApi.create_ecommerce_estimate"
200+ end
201+ # resource path
202+ local_var_path = '/v1/estimates/ecommerce'
203+
204+ # query parameters
205+ query_params = opts [ :query_params ] || { }
206+
207+ # header parameters
208+ header_params = opts [ :header_params ] || { }
209+ # HTTP header 'Accept' (if needed)
210+ header_params [ 'Accept' ] = @api_client . select_header_accept ( [ 'application/json' ] )
211+ # HTTP header 'Content-Type'
212+ content_type = @api_client . select_header_content_type ( [ 'application/json' ] )
213+ if !content_type . nil?
214+ header_params [ 'Content-Type' ] = content_type
215+ end
216+
217+ # form parameters
218+ form_params = opts [ :form_params ] || { }
219+
220+ # http body (model)
221+ post_body = opts [ :debug_body ] || @api_client . object_to_http_body ( create_ecommerce_estimate_request )
222+
223+ # return_type
224+ return_type = opts [ :debug_return_type ] || 'EstimateResponse'
225+
226+ # auth_names
227+ auth_names = opts [ :debug_auth_names ] || [ 'bearer_auth' ]
228+
229+ new_options = opts . merge (
230+ :operation => :"EstimatesApi.create_ecommerce_estimate" ,
231+ :header_params => header_params ,
232+ :query_params => query_params ,
233+ :form_params => form_params ,
234+ :body => post_body ,
235+ :auth_names => auth_names ,
236+ :return_type => return_type
237+ )
238+
239+ data , status_code , headers = @api_client . call_api ( :POST , local_var_path , new_options )
240+ if @api_client . config . debugging
241+ @api_client . config . logger . debug "API called: EstimatesApi#create_ecommerce_estimate\n Data: #{ data . inspect } \n Status code: #{ status_code } \n Headers: #{ headers } "
242+ end
243+ return data , status_code , headers
244+ end
245+
176246 # Create an ethereum estimate
177247 # Creates an ethereum estimate for the amount of CO2 to be compensated. An order in the `draft` state may be created based on the parameters, linked to the estimate.
178248 # @param create_ethereum_estimate_request [CreateEthereumEstimateRequest]
0 commit comments