1515module Patch
1616 class EstimatesApi
1717 OPERATIONS = [
18+ :create_air_shipping_estimate ,
1819 :create_bitcoin_estimate ,
1920 :create_ethereum_estimate ,
2021 :create_flight_estimate ,
2122 :create_hotel_estimate ,
2223 :create_mass_estimate ,
24+ :create_rail_shipping_estimate ,
25+ :create_road_shipping_estimate ,
26+ :create_sea_shipping_estimate ,
2327 :create_shipping_estimate ,
2428 :create_vehicle_estimate ,
2529 :retrieve_estimate ,
@@ -31,6 +35,75 @@ class EstimatesApi
3135 def initialize ( api_client = ApiClient . default )
3236 @api_client = api_client
3337 end
38+ # Creates a GLEC air shipping estimate given freight mass and logistics
39+ # Creates a GLEC air shipping 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.
40+ # @param create_air_shipping_estimate_request [CreateAirShippingEstimateRequest]
41+ # @param [Hash] opts the optional parameters
42+ # @return [EstimateResponse]
43+ def create_air_shipping_estimate ( create_air_shipping_estimate_request = { } , opts = { } )
44+ _create_air_shipping_estimate_request = Patch ::CreateAirShippingEstimateRequest . new ( create_air_shipping_estimate_request )
45+ data , _status_code , _headers = create_air_shipping_estimate_with_http_info ( _create_air_shipping_estimate_request , opts )
46+ data
47+ end
48+
49+ # Creates a GLEC air shipping estimate given freight mass and logistics
50+ # Creates a GLEC air shipping 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.
51+ # @param create_air_shipping_estimate_request [CreateAirShippingEstimateRequest]
52+ # @param [Hash] opts the optional parameters
53+ # @return [Array<(EstimateResponse, Integer, Hash)>] EstimateResponse data, response status code and response headers
54+ def create_air_shipping_estimate_with_http_info ( create_air_shipping_estimate_request , opts = { } )
55+ if @api_client . config . debugging
56+ @api_client . config . logger . debug 'Calling API: EstimatesApi.create_air_shipping_estimate ...'
57+ end
58+ # verify the required parameter 'create_air_shipping_estimate_request' is set
59+ if @api_client . config . client_side_validation && create_air_shipping_estimate_request . nil?
60+ fail ArgumentError , "Missing the required parameter 'create_air_shipping_estimate_request' when calling EstimatesApi.create_air_shipping_estimate"
61+ end
62+ # resource path
63+ local_var_path = '/v1/estimates/shipping/air'
64+
65+ # query parameters
66+ query_params = opts [ :query_params ] || { }
67+
68+ # header parameters
69+ header_params = opts [ :header_params ] || { }
70+ # HTTP header 'Accept' (if needed)
71+ header_params [ 'Accept' ] = @api_client . select_header_accept ( [ 'application/json' ] )
72+ # HTTP header 'Content-Type'
73+ content_type = @api_client . select_header_content_type ( [ 'application/json' ] )
74+ if !content_type . nil?
75+ header_params [ 'Content-Type' ] = content_type
76+ end
77+
78+ # form parameters
79+ form_params = opts [ :form_params ] || { }
80+
81+ # http body (model)
82+ post_body = opts [ :debug_body ] || @api_client . object_to_http_body ( create_air_shipping_estimate_request )
83+
84+ # return_type
85+ return_type = opts [ :debug_return_type ] || 'EstimateResponse'
86+
87+ # auth_names
88+ auth_names = opts [ :debug_auth_names ] || [ 'bearer_auth' ]
89+
90+ new_options = opts . merge (
91+ :operation => :"EstimatesApi.create_air_shipping_estimate" ,
92+ :header_params => header_params ,
93+ :query_params => query_params ,
94+ :form_params => form_params ,
95+ :body => post_body ,
96+ :auth_names => auth_names ,
97+ :return_type => return_type
98+ )
99+
100+ data , status_code , headers = @api_client . call_api ( :POST , local_var_path , new_options )
101+ if @api_client . config . debugging
102+ @api_client . config . logger . debug "API called: EstimatesApi#create_air_shipping_estimate\n Data: #{ data . inspect } \n Status code: #{ status_code } \n Headers: #{ headers } "
103+ end
104+ return data , status_code , headers
105+ end
106+
34107 # Create a bitcoin estimate given a timestamp and transaction value
35108 # Creates a bitcoin 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.
36109 # @param create_bitcoin_estimate_request [CreateBitcoinEstimateRequest]
@@ -376,6 +449,213 @@ def create_mass_estimate_with_http_info(create_mass_estimate_request, opts = {})
376449 return data , status_code , headers
377450 end
378451
452+ # Creates a GLEC rail shipping estimate given freight mass and logistics
453+ # Creates a GLEC rail shipping 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.
454+ # @param create_rail_shipping_estimate_request [CreateRailShippingEstimateRequest]
455+ # @param [Hash] opts the optional parameters
456+ # @return [EstimateResponse]
457+ def create_rail_shipping_estimate ( create_rail_shipping_estimate_request = { } , opts = { } )
458+ _create_rail_shipping_estimate_request = Patch ::CreateRailShippingEstimateRequest . new ( create_rail_shipping_estimate_request )
459+ data , _status_code , _headers = create_rail_shipping_estimate_with_http_info ( _create_rail_shipping_estimate_request , opts )
460+ data
461+ end
462+
463+ # Creates a GLEC rail shipping estimate given freight mass and logistics
464+ # Creates a GLEC rail shipping 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.
465+ # @param create_rail_shipping_estimate_request [CreateRailShippingEstimateRequest]
466+ # @param [Hash] opts the optional parameters
467+ # @return [Array<(EstimateResponse, Integer, Hash)>] EstimateResponse data, response status code and response headers
468+ def create_rail_shipping_estimate_with_http_info ( create_rail_shipping_estimate_request , opts = { } )
469+ if @api_client . config . debugging
470+ @api_client . config . logger . debug 'Calling API: EstimatesApi.create_rail_shipping_estimate ...'
471+ end
472+ # verify the required parameter 'create_rail_shipping_estimate_request' is set
473+ if @api_client . config . client_side_validation && create_rail_shipping_estimate_request . nil?
474+ fail ArgumentError , "Missing the required parameter 'create_rail_shipping_estimate_request' when calling EstimatesApi.create_rail_shipping_estimate"
475+ end
476+ # resource path
477+ local_var_path = '/v1/estimates/shipping/rail'
478+
479+ # query parameters
480+ query_params = opts [ :query_params ] || { }
481+
482+ # header parameters
483+ header_params = opts [ :header_params ] || { }
484+ # HTTP header 'Accept' (if needed)
485+ header_params [ 'Accept' ] = @api_client . select_header_accept ( [ 'application/json' ] )
486+ # HTTP header 'Content-Type'
487+ content_type = @api_client . select_header_content_type ( [ 'application/json' ] )
488+ if !content_type . nil?
489+ header_params [ 'Content-Type' ] = content_type
490+ end
491+
492+ # form parameters
493+ form_params = opts [ :form_params ] || { }
494+
495+ # http body (model)
496+ post_body = opts [ :debug_body ] || @api_client . object_to_http_body ( create_rail_shipping_estimate_request )
497+
498+ # return_type
499+ return_type = opts [ :debug_return_type ] || 'EstimateResponse'
500+
501+ # auth_names
502+ auth_names = opts [ :debug_auth_names ] || [ 'bearer_auth' ]
503+
504+ new_options = opts . merge (
505+ :operation => :"EstimatesApi.create_rail_shipping_estimate" ,
506+ :header_params => header_params ,
507+ :query_params => query_params ,
508+ :form_params => form_params ,
509+ :body => post_body ,
510+ :auth_names => auth_names ,
511+ :return_type => return_type
512+ )
513+
514+ data , status_code , headers = @api_client . call_api ( :POST , local_var_path , new_options )
515+ if @api_client . config . debugging
516+ @api_client . config . logger . debug "API called: EstimatesApi#create_rail_shipping_estimate\n Data: #{ data . inspect } \n Status code: #{ status_code } \n Headers: #{ headers } "
517+ end
518+ return data , status_code , headers
519+ end
520+
521+ # Creates a GLEC road shipping estimate given freight mass and logistics
522+ # Creates a GLEC road shipping 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.
523+ # @param create_road_shipping_estimate_request [CreateRoadShippingEstimateRequest]
524+ # @param [Hash] opts the optional parameters
525+ # @return [EstimateResponse]
526+ def create_road_shipping_estimate ( create_road_shipping_estimate_request = { } , opts = { } )
527+ _create_road_shipping_estimate_request = Patch ::CreateRoadShippingEstimateRequest . new ( create_road_shipping_estimate_request )
528+ data , _status_code , _headers = create_road_shipping_estimate_with_http_info ( _create_road_shipping_estimate_request , opts )
529+ data
530+ end
531+
532+ # Creates a GLEC road shipping estimate given freight mass and logistics
533+ # Creates a GLEC road shipping 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.
534+ # @param create_road_shipping_estimate_request [CreateRoadShippingEstimateRequest]
535+ # @param [Hash] opts the optional parameters
536+ # @return [Array<(EstimateResponse, Integer, Hash)>] EstimateResponse data, response status code and response headers
537+ def create_road_shipping_estimate_with_http_info ( create_road_shipping_estimate_request , opts = { } )
538+ if @api_client . config . debugging
539+ @api_client . config . logger . debug 'Calling API: EstimatesApi.create_road_shipping_estimate ...'
540+ end
541+ # verify the required parameter 'create_road_shipping_estimate_request' is set
542+ if @api_client . config . client_side_validation && create_road_shipping_estimate_request . nil?
543+ fail ArgumentError , "Missing the required parameter 'create_road_shipping_estimate_request' when calling EstimatesApi.create_road_shipping_estimate"
544+ end
545+ # resource path
546+ local_var_path = '/v1/estimates/shipping/road'
547+
548+ # query parameters
549+ query_params = opts [ :query_params ] || { }
550+
551+ # header parameters
552+ header_params = opts [ :header_params ] || { }
553+ # HTTP header 'Accept' (if needed)
554+ header_params [ 'Accept' ] = @api_client . select_header_accept ( [ 'application/json' ] )
555+ # HTTP header 'Content-Type'
556+ content_type = @api_client . select_header_content_type ( [ 'application/json' ] )
557+ if !content_type . nil?
558+ header_params [ 'Content-Type' ] = content_type
559+ end
560+
561+ # form parameters
562+ form_params = opts [ :form_params ] || { }
563+
564+ # http body (model)
565+ post_body = opts [ :debug_body ] || @api_client . object_to_http_body ( create_road_shipping_estimate_request )
566+
567+ # return_type
568+ return_type = opts [ :debug_return_type ] || 'EstimateResponse'
569+
570+ # auth_names
571+ auth_names = opts [ :debug_auth_names ] || [ 'bearer_auth' ]
572+
573+ new_options = opts . merge (
574+ :operation => :"EstimatesApi.create_road_shipping_estimate" ,
575+ :header_params => header_params ,
576+ :query_params => query_params ,
577+ :form_params => form_params ,
578+ :body => post_body ,
579+ :auth_names => auth_names ,
580+ :return_type => return_type
581+ )
582+
583+ data , status_code , headers = @api_client . call_api ( :POST , local_var_path , new_options )
584+ if @api_client . config . debugging
585+ @api_client . config . logger . debug "API called: EstimatesApi#create_road_shipping_estimate\n Data: #{ data . inspect } \n Status code: #{ status_code } \n Headers: #{ headers } "
586+ end
587+ return data , status_code , headers
588+ end
589+
590+ # Creates a GLEC sea shipping estimate given freight mass and logistics
591+ # Creates a GLEC sea shipping 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.
592+ # @param create_sea_shipping_estimate_request [CreateSeaShippingEstimateRequest]
593+ # @param [Hash] opts the optional parameters
594+ # @return [EstimateResponse]
595+ def create_sea_shipping_estimate ( create_sea_shipping_estimate_request = { } , opts = { } )
596+ _create_sea_shipping_estimate_request = Patch ::CreateSeaShippingEstimateRequest . new ( create_sea_shipping_estimate_request )
597+ data , _status_code , _headers = create_sea_shipping_estimate_with_http_info ( _create_sea_shipping_estimate_request , opts )
598+ data
599+ end
600+
601+ # Creates a GLEC sea shipping estimate given freight mass and logistics
602+ # Creates a GLEC sea shipping 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.
603+ # @param create_sea_shipping_estimate_request [CreateSeaShippingEstimateRequest]
604+ # @param [Hash] opts the optional parameters
605+ # @return [Array<(EstimateResponse, Integer, Hash)>] EstimateResponse data, response status code and response headers
606+ def create_sea_shipping_estimate_with_http_info ( create_sea_shipping_estimate_request , opts = { } )
607+ if @api_client . config . debugging
608+ @api_client . config . logger . debug 'Calling API: EstimatesApi.create_sea_shipping_estimate ...'
609+ end
610+ # verify the required parameter 'create_sea_shipping_estimate_request' is set
611+ if @api_client . config . client_side_validation && create_sea_shipping_estimate_request . nil?
612+ fail ArgumentError , "Missing the required parameter 'create_sea_shipping_estimate_request' when calling EstimatesApi.create_sea_shipping_estimate"
613+ end
614+ # resource path
615+ local_var_path = '/v1/estimates/shipping/sea'
616+
617+ # query parameters
618+ query_params = opts [ :query_params ] || { }
619+
620+ # header parameters
621+ header_params = opts [ :header_params ] || { }
622+ # HTTP header 'Accept' (if needed)
623+ header_params [ 'Accept' ] = @api_client . select_header_accept ( [ 'application/json' ] )
624+ # HTTP header 'Content-Type'
625+ content_type = @api_client . select_header_content_type ( [ 'application/json' ] )
626+ if !content_type . nil?
627+ header_params [ 'Content-Type' ] = content_type
628+ end
629+
630+ # form parameters
631+ form_params = opts [ :form_params ] || { }
632+
633+ # http body (model)
634+ post_body = opts [ :debug_body ] || @api_client . object_to_http_body ( create_sea_shipping_estimate_request )
635+
636+ # return_type
637+ return_type = opts [ :debug_return_type ] || 'EstimateResponse'
638+
639+ # auth_names
640+ auth_names = opts [ :debug_auth_names ] || [ 'bearer_auth' ]
641+
642+ new_options = opts . merge (
643+ :operation => :"EstimatesApi.create_sea_shipping_estimate" ,
644+ :header_params => header_params ,
645+ :query_params => query_params ,
646+ :form_params => form_params ,
647+ :body => post_body ,
648+ :auth_names => auth_names ,
649+ :return_type => return_type
650+ )
651+
652+ data , status_code , headers = @api_client . call_api ( :POST , local_var_path , new_options )
653+ if @api_client . config . debugging
654+ @api_client . config . logger . debug "API called: EstimatesApi#create_sea_shipping_estimate\n Data: #{ data . inspect } \n Status code: #{ status_code } \n Headers: #{ headers } "
655+ end
656+ return data , status_code , headers
657+ end
658+
379659 # Create a shipping estimate given the distance traveled in meters, package weight, and transportation method.
380660 # Creates a shipping estimate for the amount of CO2 to be compensated. An order in the `draft` state may be created based on the parameters.
381661 # @param create_shipping_estimate_request [CreateShippingEstimateRequest]
0 commit comments