@@ -464,6 +464,196 @@ def create_bitcoin_estimate_with_http_info(
464464 collection_formats = collection_formats ,
465465 )
466466
467+ def create_ecommerce_estimate (
468+ self , create_ecommerce_estimate_request = {}, ** kwargs
469+ ): # noqa: E501
470+ """Create an e-commerce estimate given the distance traveled in meters, package weight, and transportation method. # noqa: E501
471+
472+ 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. # noqa: E501
473+ This method makes a synchronous HTTP request by default. To make an
474+ asynchronous HTTP request, please pass async_req=True
475+ >>> thread = api.create_ecommerce_estimate(create_ecommerce_estimate_request, async_req=True)
476+ >>> result = thread.get()
477+
478+ :param async_req bool: execute request asynchronously
479+ :param CreateEcommerceEstimateRequest create_ecommerce_estimate_request: (required)
480+ :param _preload_content: if False, the urllib3.HTTPResponse object will
481+ be returned without reading/decoding response
482+ data. Default is True.
483+ :param _request_timeout: timeout setting for this request. If one
484+ number provided, it will be total request
485+ timeout. It can also be a pair (tuple) of
486+ (connection, read) timeouts.
487+ :return: EstimateResponse
488+ If the method is called asynchronously,
489+ returns the request thread.
490+ """
491+ kwargs ["_return_http_data_only" ] = True
492+ return self .create_ecommerce_estimate_with_http_info (
493+ create_ecommerce_estimate_request , ** kwargs
494+ ) # noqa: E501
495+
496+ def create_ecommerce_estimate_with_http_info (
497+ self , create_ecommerce_estimate_request , ** kwargs
498+ ): # noqa: E501
499+ """Create an e-commerce estimate given the distance traveled in meters, package weight, and transportation method. # noqa: E501
500+
501+ 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. # noqa: E501
502+ This method makes a synchronous HTTP request by default. To make an
503+ asynchronous HTTP request, please pass async_req=True
504+ >>> thread = api.create_ecommerce_estimate_with_http_info(create_ecommerce_estimate_request, async_req=True)
505+ >>> result = thread.get()
506+
507+ :param async_req bool: execute request asynchronously
508+ :param CreateEcommerceEstimateRequest create_ecommerce_estimate_request: (required)
509+ :param _return_http_data_only: response data without head status code
510+ and headers
511+ :param _preload_content: if False, the urllib3.HTTPResponse object will
512+ be returned without reading/decoding response
513+ data. Default is True.
514+ :param _request_timeout: timeout setting for this request. If one
515+ number provided, it will be total request
516+ timeout. It can also be a pair (tuple) of
517+ (connection, read) timeouts.
518+ :return: tuple(EstimateResponse, status_code(int), headers(HTTPHeaderDict))
519+ If the method is called asynchronously,
520+ returns the request thread.
521+ """
522+
523+ local_var_params = locals ()
524+
525+ all_params = ["create_ecommerce_estimate_request" ] # noqa: E501
526+ all_params .append ("async_req" )
527+ all_params .append ("_return_http_data_only" )
528+ all_params .append ("_preload_content" )
529+ all_params .append ("_request_timeout" )
530+ all_params .append ("mass_g" )
531+ all_params .append ("total_price_cents_usd" )
532+ all_params .append ("project_id" )
533+ all_params .append ("metadata" )
534+ all_params .append ("distance_m" )
535+ all_params .append ("transportation_method" )
536+ all_params .append ("package_mass_g" )
537+ all_params .append ("create_order" )
538+ all_params .append ("make" )
539+ all_params .append ("model" )
540+ all_params .append ("year" )
541+ all_params .append ("transaction_value_btc_sats" )
542+ all_params .append ("transaction_value_eth_gwei" )
543+ all_params .append ("gas_used" )
544+ all_params .append ("transaction_value_btc_sats" )
545+ all_params .append ("average_daily_balance_btc_sats" )
546+ all_params .append ("average_daily_balance_eth_gwei" )
547+ all_params .append ("timestamp" )
548+ all_params .append ("origin_airport" )
549+ all_params .append ("destination_airport" )
550+ all_params .append ("aircraft_code" )
551+ all_params .append ("cabin_class" )
552+ all_params .append ("passenger_count" )
553+ all_params .append ("state" )
554+ all_params .append ("country_code" )
555+ all_params .append ("city" )
556+ all_params .append ("region" )
557+ all_params .append ("star_rating" )
558+ all_params .append ("number_of_nights" )
559+ all_params .append ("number_of_rooms" )
560+ all_params .append ("vintage_year" )
561+ all_params .append ("total_price" )
562+ all_params .append ("currency" )
563+ all_params .append ("amount" )
564+ all_params .append ("unit" )
565+ all_params .append ("issued_to" )
566+ all_params .append ("cargo_type" )
567+ all_params .append ("container_size_code" )
568+ all_params .append ("destination_country_code" )
569+ all_params .append ("destination_locode" )
570+ all_params .append ("destination_postal_code" )
571+ all_params .append ("emissions_scope" )
572+ all_params .append ("freight_mass_g" )
573+ all_params .append ("freight_volume_cubic_m" )
574+ all_params .append ("fuel_type" )
575+ all_params .append ("number_of_containers" )
576+ all_params .append ("origin_country_code" )
577+ all_params .append ("origin_locode" )
578+ all_params .append ("origin_postal_code" )
579+ all_params .append ("truck_weight_t" )
580+ all_params .append ("vessel_imo" )
581+
582+ for key , val in six .iteritems (local_var_params ["kwargs" ]):
583+ if key not in all_params :
584+ raise ApiTypeError (
585+ "Got an unexpected keyword argument '%s'"
586+ " to method create_ecommerce_estimate" % key
587+ )
588+ local_var_params [key ] = val
589+ del local_var_params ["kwargs" ]
590+ # verify the required parameter 'create_ecommerce_estimate_request' is set
591+ if (
592+ "create_ecommerce_estimate_request" not in local_var_params
593+ or local_var_params ["create_ecommerce_estimate_request" ] is None
594+ ):
595+ raise ApiValueError (
596+ "Missing the required parameter `create_ecommerce_estimate_request` when calling `create_ecommerce_estimate`"
597+ ) # noqa: E501
598+
599+ collection_formats = {}
600+
601+ path_params = {}
602+
603+ query_params = []
604+
605+ # do not add duplicate keys to query_params list
606+ existing_keys = []
607+ for param in query_params :
608+ existing_keys .append (param [0 ])
609+
610+ for key in kwargs :
611+ if key not in existing_keys :
612+ query_params .append ([key , kwargs .get (key )])
613+
614+ header_params = {}
615+
616+ form_params = []
617+ local_var_files = {}
618+
619+ body_params = None
620+ if "create_ecommerce_estimate_request" in local_var_params :
621+ body_params = local_var_params ["create_ecommerce_estimate_request" ]
622+ # HTTP header `Accept`
623+ header_params ["Accept" ] = self .api_client .select_header_accept (
624+ ["application/json" ]
625+ ) # noqa: E501
626+
627+ # HTTP header `Content-Type`
628+ header_params [
629+ "Content-Type"
630+ ] = self .api_client .select_header_content_type ( # noqa: E501
631+ ["application/json" ]
632+ ) # noqa: E501
633+
634+ # Authentication setting
635+ auth_settings = ["bearer_auth" ] # noqa: E501
636+
637+ return self .api_client .call_api (
638+ "/v1/estimates/ecommerce" ,
639+ "POST" ,
640+ path_params ,
641+ query_params ,
642+ header_params ,
643+ body = body_params ,
644+ post_params = form_params ,
645+ files = local_var_files ,
646+ response_type = "EstimateResponse" , # noqa: E501
647+ auth_settings = auth_settings ,
648+ async_req = local_var_params .get ("async_req" ),
649+ _return_http_data_only = local_var_params .get (
650+ "_return_http_data_only"
651+ ), # noqa: E501
652+ _preload_content = local_var_params .get ("_preload_content" , True ),
653+ _request_timeout = local_var_params .get ("_request_timeout" ),
654+ collection_formats = collection_formats ,
655+ )
656+
467657 def create_ethereum_estimate (
468658 self , create_ethereum_estimate_request = {}, ** kwargs
469659 ): # noqa: E501
0 commit comments