@@ -683,204 +683,6 @@ def create_flight_estimate_with_http_info(
683
683
collection_formats = collection_formats ,
684
684
)
685
685
686
- def create_hotel_estimate (
687
- self , create_hotel_estimate_request = {}, ** kwargs
688
- ): # noqa: E501
689
- """Create a hotel estimate. # noqa: E501
690
-
691
- Creates a hotel estimate for the amount of CO2 to be compensated. An order in the `draft` state may be created based on the parameters. # noqa: E501
692
- This method makes a synchronous HTTP request by default. To make an
693
- asynchronous HTTP request, please pass async_req=True
694
- >>> thread = api.create_hotel_estimate(create_hotel_estimate_request, async_req=True)
695
- >>> result = thread.get()
696
-
697
- :param async_req bool: execute request asynchronously
698
- :param CreateHotelEstimateRequest create_hotel_estimate_request: (required)
699
- :param int patch_version:
700
- :param _preload_content: if False, the urllib3.HTTPResponse object will
701
- be returned without reading/decoding response
702
- data. Default is True.
703
- :param _request_timeout: timeout setting for this request. If one
704
- number provided, it will be total request
705
- timeout. It can also be a pair (tuple) of
706
- (connection, read) timeouts.
707
- :return: EstimateResponse
708
- If the method is called asynchronously,
709
- returns the request thread.
710
- """
711
- kwargs ["_return_http_data_only" ] = True
712
- return self .create_hotel_estimate_with_http_info (
713
- create_hotel_estimate_request , ** kwargs
714
- ) # noqa: E501
715
-
716
- def create_hotel_estimate_with_http_info (
717
- self , create_hotel_estimate_request , ** kwargs
718
- ): # noqa: E501
719
- """Create a hotel estimate. # noqa: E501
720
-
721
- Creates a hotel estimate for the amount of CO2 to be compensated. An order in the `draft` state may be created based on the parameters. # noqa: E501
722
- This method makes a synchronous HTTP request by default. To make an
723
- asynchronous HTTP request, please pass async_req=True
724
- >>> thread = api.create_hotel_estimate_with_http_info(create_hotel_estimate_request, async_req=True)
725
- >>> result = thread.get()
726
-
727
- :param async_req bool: execute request asynchronously
728
- :param CreateHotelEstimateRequest create_hotel_estimate_request: (required)
729
- :param int patch_version:
730
- :param _return_http_data_only: response data without head status code
731
- and headers
732
- :param _preload_content: if False, the urllib3.HTTPResponse object will
733
- be returned without reading/decoding response
734
- data. Default is True.
735
- :param _request_timeout: timeout setting for this request. If one
736
- number provided, it will be total request
737
- timeout. It can also be a pair (tuple) of
738
- (connection, read) timeouts.
739
- :return: tuple(EstimateResponse, status_code(int), headers(HTTPHeaderDict))
740
- If the method is called asynchronously,
741
- returns the request thread.
742
- """
743
-
744
- local_var_params = locals ()
745
-
746
- all_params = ["create_hotel_estimate_request" , "patch_version" ] # noqa: E501
747
- all_params .append ("async_req" )
748
- all_params .append ("_return_http_data_only" )
749
- all_params .append ("_preload_content" )
750
- all_params .append ("_request_timeout" )
751
- all_params .append ("mass_g" )
752
- all_params .append ("total_price_cents_usd" )
753
- all_params .append ("project_id" )
754
- all_params .append ("metadata" )
755
- all_params .append ("distance_m" )
756
- all_params .append ("transportation_method" )
757
- all_params .append ("package_mass_g" )
758
- all_params .append ("create_order" )
759
- all_params .append ("make" )
760
- all_params .append ("model" )
761
- all_params .append ("year" )
762
- all_params .append ("transaction_value_btc_sats" )
763
- all_params .append ("transaction_value_eth_gwei" )
764
- all_params .append ("gas_used" )
765
- all_params .append ("transaction_value_btc_sats" )
766
- all_params .append ("average_daily_balance_btc_sats" )
767
- all_params .append ("average_daily_balance_eth_gwei" )
768
- all_params .append ("timestamp" )
769
- all_params .append ("origin_airport" )
770
- all_params .append ("destination_airport" )
771
- all_params .append ("aircraft_code" )
772
- all_params .append ("cabin_class" )
773
- all_params .append ("passenger_count" )
774
- all_params .append ("state" )
775
- all_params .append ("country_code" )
776
- all_params .append ("city" )
777
- all_params .append ("region" )
778
- all_params .append ("star_rating" )
779
- all_params .append ("number_of_nights" )
780
- all_params .append ("number_of_rooms" )
781
- all_params .append ("vintage_year" )
782
- all_params .append ("total_price" )
783
- all_params .append ("currency" )
784
- all_params .append ("amount" )
785
- all_params .append ("unit" )
786
- all_params .append ("issued_to" )
787
- all_params .append ("cargo_type" )
788
- all_params .append ("container_size_code" )
789
- all_params .append ("destination_country_code" )
790
- all_params .append ("destination_locode" )
791
- all_params .append ("destination_postal_code" )
792
- all_params .append ("emissions_scope" )
793
- all_params .append ("freight_mass_g" )
794
- all_params .append ("freight_volume_cubic_m" )
795
- all_params .append ("fuel_type" )
796
- all_params .append ("number_of_containers" )
797
- all_params .append ("origin_country_code" )
798
- all_params .append ("origin_locode" )
799
- all_params .append ("origin_postal_code" )
800
- all_params .append ("truck_weight_t" )
801
- all_params .append ("vessel_imo" )
802
- all_params .append ("vintage_start_year" )
803
- all_params .append ("vintage_end_year" )
804
-
805
- for key , val in six .iteritems (local_var_params ["kwargs" ]):
806
- if key not in all_params :
807
- raise ApiTypeError (
808
- "Got an unexpected keyword argument '%s'"
809
- " to method create_hotel_estimate" % key
810
- )
811
- local_var_params [key ] = val
812
- del local_var_params ["kwargs" ]
813
- # verify the required parameter 'create_hotel_estimate_request' is set
814
- if (
815
- "create_hotel_estimate_request" not in local_var_params
816
- or local_var_params ["create_hotel_estimate_request" ] is None
817
- ):
818
- raise ApiValueError (
819
- "Missing the required parameter `create_hotel_estimate_request` when calling `create_hotel_estimate`"
820
- ) # noqa: E501
821
-
822
- collection_formats = {}
823
-
824
- path_params = {}
825
-
826
- query_params = []
827
-
828
- # do not add duplicate keys to query_params list
829
- existing_keys = []
830
- for param in query_params :
831
- existing_keys .append (param [0 ])
832
-
833
- for key in kwargs :
834
- if key not in existing_keys :
835
- query_params .append ([key , kwargs .get (key )])
836
-
837
- header_params = {}
838
- if "patch_version" in local_var_params :
839
- header_params ["Patch-Version" ] = local_var_params [
840
- "patch_version"
841
- ] # noqa: E501
842
-
843
- form_params = []
844
- local_var_files = {}
845
-
846
- body_params = None
847
- if "create_hotel_estimate_request" in local_var_params :
848
- body_params = local_var_params ["create_hotel_estimate_request" ]
849
- # HTTP header `Accept`
850
- header_params ["Accept" ] = self .api_client .select_header_accept (
851
- ["application/json" ]
852
- ) # noqa: E501
853
-
854
- # HTTP header `Content-Type`
855
- header_params ["Content-Type" ] = (
856
- self .api_client .select_header_content_type ( # noqa: E501
857
- ["application/json" ]
858
- )
859
- ) # noqa: E501
860
-
861
- # Authentication setting
862
- auth_settings = ["bearer_auth" ] # noqa: E501
863
-
864
- return self .api_client .call_api (
865
- "/v1/estimates/hotel" ,
866
- "POST" ,
867
- path_params ,
868
- query_params ,
869
- header_params ,
870
- body = body_params ,
871
- post_params = form_params ,
872
- files = local_var_files ,
873
- response_type = "EstimateResponse" , # noqa: E501
874
- auth_settings = auth_settings ,
875
- async_req = local_var_params .get ("async_req" ),
876
- _return_http_data_only = local_var_params .get (
877
- "_return_http_data_only"
878
- ), # noqa: E501
879
- _preload_content = local_var_params .get ("_preload_content" , True ),
880
- _request_timeout = local_var_params .get ("_request_timeout" ),
881
- collection_formats = collection_formats ,
882
- )
883
-
884
686
def create_mass_estimate (
885
687
self , create_mass_estimate_request = {}, ** kwargs
886
688
): # noqa: E501
0 commit comments