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