@@ -485,204 +485,6 @@ def create_bitcoin_estimate_with_http_info(
485
485
collection_formats = collection_formats ,
486
486
)
487
487
488
- def create_flight_estimate (
489
- self , create_flight_estimate_request = {}, ** kwargs
490
- ): # noqa: E501
491
- """Create a flight estimate given the distance traveled in meters # noqa: E501
492
-
493
- Creates a flight 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. # 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_flight_estimate(create_flight_estimate_request, async_req=True)
497
- >>> result = thread.get()
498
-
499
- :param async_req bool: execute request asynchronously
500
- :param CreateFlightEstimateRequest create_flight_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_flight_estimate_with_http_info (
515
- create_flight_estimate_request , ** kwargs
516
- ) # noqa: E501
517
-
518
- def create_flight_estimate_with_http_info (
519
- self , create_flight_estimate_request , ** kwargs
520
- ): # noqa: E501
521
- """Create a flight estimate given the distance traveled in meters # noqa: E501
522
-
523
- Creates a flight 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. # 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_flight_estimate_with_http_info(create_flight_estimate_request, async_req=True)
527
- >>> result = thread.get()
528
-
529
- :param async_req bool: execute request asynchronously
530
- :param CreateFlightEstimateRequest create_flight_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 = ["create_flight_estimate_request" , "patch_version" ] # noqa: E501
549
- all_params .append ("async_req" )
550
- all_params .append ("_return_http_data_only" )
551
- all_params .append ("_preload_content" )
552
- all_params .append ("_request_timeout" )
553
- all_params .append ("mass_g" )
554
- all_params .append ("total_price_cents_usd" )
555
- all_params .append ("project_id" )
556
- all_params .append ("metadata" )
557
- all_params .append ("distance_m" )
558
- all_params .append ("transportation_method" )
559
- all_params .append ("package_mass_g" )
560
- all_params .append ("create_order" )
561
- all_params .append ("make" )
562
- all_params .append ("model" )
563
- all_params .append ("year" )
564
- all_params .append ("transaction_value_btc_sats" )
565
- all_params .append ("transaction_value_eth_gwei" )
566
- all_params .append ("gas_used" )
567
- all_params .append ("transaction_value_btc_sats" )
568
- all_params .append ("average_daily_balance_btc_sats" )
569
- all_params .append ("average_daily_balance_eth_gwei" )
570
- all_params .append ("timestamp" )
571
- all_params .append ("origin_airport" )
572
- all_params .append ("destination_airport" )
573
- all_params .append ("aircraft_code" )
574
- all_params .append ("cabin_class" )
575
- all_params .append ("passenger_count" )
576
- all_params .append ("state" )
577
- all_params .append ("country_code" )
578
- all_params .append ("city" )
579
- all_params .append ("region" )
580
- all_params .append ("star_rating" )
581
- all_params .append ("number_of_nights" )
582
- all_params .append ("number_of_rooms" )
583
- all_params .append ("vintage_year" )
584
- all_params .append ("total_price" )
585
- all_params .append ("currency" )
586
- all_params .append ("amount" )
587
- all_params .append ("unit" )
588
- all_params .append ("issued_to" )
589
- all_params .append ("cargo_type" )
590
- all_params .append ("container_size_code" )
591
- all_params .append ("destination_country_code" )
592
- all_params .append ("destination_locode" )
593
- all_params .append ("destination_postal_code" )
594
- all_params .append ("emissions_scope" )
595
- all_params .append ("freight_mass_g" )
596
- all_params .append ("freight_volume_cubic_m" )
597
- all_params .append ("fuel_type" )
598
- all_params .append ("number_of_containers" )
599
- all_params .append ("origin_country_code" )
600
- all_params .append ("origin_locode" )
601
- all_params .append ("origin_postal_code" )
602
- all_params .append ("truck_weight_t" )
603
- all_params .append ("vessel_imo" )
604
- all_params .append ("vintage_start_year" )
605
- all_params .append ("vintage_end_year" )
606
-
607
- for key , val in six .iteritems (local_var_params ["kwargs" ]):
608
- if key not in all_params :
609
- raise ApiTypeError (
610
- "Got an unexpected keyword argument '%s'"
611
- " to method create_flight_estimate" % key
612
- )
613
- local_var_params [key ] = val
614
- del local_var_params ["kwargs" ]
615
- # verify the required parameter 'create_flight_estimate_request' is set
616
- if (
617
- "create_flight_estimate_request" not in local_var_params
618
- or local_var_params ["create_flight_estimate_request" ] is None
619
- ):
620
- raise ApiValueError (
621
- "Missing the required parameter `create_flight_estimate_request` when calling `create_flight_estimate`"
622
- ) # noqa: E501
623
-
624
- collection_formats = {}
625
-
626
- path_params = {}
627
-
628
- query_params = []
629
-
630
- # do not add duplicate keys to query_params list
631
- existing_keys = []
632
- for param in query_params :
633
- existing_keys .append (param [0 ])
634
-
635
- for key in kwargs :
636
- if key not in existing_keys :
637
- query_params .append ([key , kwargs .get (key )])
638
-
639
- header_params = {}
640
- if "patch_version" in local_var_params :
641
- header_params ["Patch-Version" ] = local_var_params [
642
- "patch_version"
643
- ] # noqa: E501
644
-
645
- form_params = []
646
- local_var_files = {}
647
-
648
- body_params = None
649
- if "create_flight_estimate_request" in local_var_params :
650
- body_params = local_var_params ["create_flight_estimate_request" ]
651
- # HTTP header `Accept`
652
- header_params ["Accept" ] = self .api_client .select_header_accept (
653
- ["application/json" ]
654
- ) # noqa: E501
655
-
656
- # HTTP header `Content-Type`
657
- header_params ["Content-Type" ] = (
658
- self .api_client .select_header_content_type ( # noqa: E501
659
- ["application/json" ]
660
- )
661
- ) # noqa: E501
662
-
663
- # Authentication setting
664
- auth_settings = ["bearer_auth" ] # noqa: E501
665
-
666
- return self .api_client .call_api (
667
- "/v1/estimates/flight" ,
668
- "POST" ,
669
- path_params ,
670
- query_params ,
671
- header_params ,
672
- body = body_params ,
673
- post_params = form_params ,
674
- files = local_var_files ,
675
- response_type = "EstimateResponse" , # noqa: E501
676
- auth_settings = auth_settings ,
677
- async_req = local_var_params .get ("async_req" ),
678
- _return_http_data_only = local_var_params .get (
679
- "_return_http_data_only"
680
- ), # noqa: E501
681
- _preload_content = local_var_params .get ("_preload_content" , True ),
682
- _request_timeout = local_var_params .get ("_request_timeout" ),
683
- collection_formats = collection_formats ,
684
- )
685
-
686
488
def create_mass_estimate (
687
489
self , create_mass_estimate_request = {}, ** kwargs
688
490
): # noqa: E501
0 commit comments