Skip to content

Commit 260a4fe

Browse files
authored
Remove flight estimates (#81)
1 parent c8a4e0a commit 260a4fe

File tree

10 files changed

+10
-435
lines changed

10 files changed

+10
-435
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [2.5.0] - 2025-08-19
9+
10+
### Removed
11+
12+
- Removes `create_flight_estimate_request` method
13+
814
## [2.4.0] - 2025-05-16
915

1016
### Removed

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
patch_ruby (2.4.0)
4+
patch_ruby (2.5.0)
55
typhoeus (~> 1.0, >= 1.0.1)
66

77
GEM

README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,6 @@ Estimates allow API users to get a quote for the cost of compensating a certain
123123
mass = 1_000_000 # Pass in the mass in grams (i.e. 1 metric tonne)
124124
Patch::Estimate.create_mass_estimate(mass_g: mass)
125125

126-
# Create a flight estimate
127-
distance_m = 1_000_000 # Pass in the distance traveled in meters
128-
Patch::Estimate.create_flight_estimate(distance_m: distance_m)
129-
130126
# Create a vehicle estimate
131127
distance_m = 1_000_000 # Pass in the shipping distance in meters
132128
make = "Toyota" # Pass in the car make

lib/patch_ruby.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
# Models
2020
require 'patch_ruby/models/create_air_shipping_estimate_request'
2121
require 'patch_ruby/models/create_bitcoin_estimate_request'
22-
require 'patch_ruby/models/create_flight_estimate_request'
2322
require 'patch_ruby/models/create_mass_estimate_request'
2423
require 'patch_ruby/models/create_order_line_item_request'
2524
require 'patch_ruby/models/create_order_request'

lib/patch_ruby/api/estimates_api.rb

Lines changed: 0 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ class EstimatesApi
1717
OPERATIONS = [
1818
:create_air_shipping_estimate,
1919
:create_bitcoin_estimate,
20-
:create_flight_estimate,
2120
:create_mass_estimate,
2221
:create_rail_shipping_estimate,
2322
:create_road_shipping_estimate,
@@ -179,80 +178,6 @@ def create_bitcoin_estimate_with_http_info(create_bitcoin_estimate_request, opts
179178
return data, status_code, headers
180179
end
181180

182-
# Create a flight estimate given the distance traveled in meters
183-
# 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.
184-
# @param create_flight_estimate_request [CreateFlightEstimateRequest]
185-
# @param [Hash] opts the optional parameters
186-
# @option opts [Integer] :patch_version
187-
# @return [EstimateResponse]
188-
def create_flight_estimate(create_flight_estimate_request = {}, opts = {})
189-
_create_flight_estimate_request = Patch::CreateFlightEstimateRequest.new(create_flight_estimate_request)
190-
data, _status_code, _headers = create_flight_estimate_with_http_info(_create_flight_estimate_request, opts)
191-
data
192-
end
193-
194-
# Create a flight estimate given the distance traveled in meters
195-
# 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.
196-
# @param create_flight_estimate_request [CreateFlightEstimateRequest]
197-
# @param [Hash] opts the optional parameters
198-
# @option opts [Integer] :patch_version
199-
# @return [Array<(EstimateResponse, Integer, Hash)>] EstimateResponse data, response status code and response headers
200-
def create_flight_estimate_with_http_info(create_flight_estimate_request, opts = {})
201-
if @api_client.config.debugging
202-
@api_client.config.logger.debug 'Calling API: EstimatesApi.create_flight_estimate ...'
203-
end
204-
# verify the required parameter 'create_flight_estimate_request' is set
205-
if @api_client.config.client_side_validation && create_flight_estimate_request.nil?
206-
fail ArgumentError, "Missing the required parameter 'create_flight_estimate_request' when calling EstimatesApi.create_flight_estimate"
207-
end
208-
# resource path
209-
local_var_path = '/v1/estimates/flight'
210-
211-
# query parameters
212-
query_params = opts[:query_params] || {}
213-
214-
# header parameters
215-
header_params = opts[:header_params] || {}
216-
217-
# HTTP header 'Accept' (if needed)
218-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
219-
# HTTP header 'Content-Type'
220-
content_type = @api_client.select_header_content_type(['application/json'])
221-
if !content_type.nil?
222-
header_params['Content-Type'] = content_type
223-
end
224-
header_params['Patch-Version'] = 2
225-
header_params[:'Patch-Version'] = opts[:'patch_version'] if !opts[:'patch_version'].nil?
226-
227-
# form parameters
228-
form_params = opts[:form_params] || {}
229-
230-
# http body (model)
231-
post_body = opts[:debug_body] || @api_client.object_to_http_body(create_flight_estimate_request)
232-
233-
# return_type
234-
return_type = opts[:debug_return_type] || 'EstimateResponse'
235-
236-
# auth_names
237-
auth_names = opts[:debug_auth_names] || ['bearer_auth']
238-
239-
new_options = opts.merge(
240-
:operation => :"EstimatesApi.create_flight_estimate",
241-
:header_params => header_params,
242-
:query_params => query_params,
243-
:form_params => form_params,
244-
:body => post_body,
245-
:auth_names => auth_names,
246-
:return_type => return_type
247-
)
248-
249-
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
250-
if @api_client.config.debugging
251-
@api_client.config.logger.debug "API called: EstimatesApi#create_flight_estimate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
252-
end
253-
return data, status_code, headers
254-
end
255-
256181
# Create an estimate based on mass of CO2
257182
# Creates an estimate for the mass of CO2 to be compensated. An order in the `draft` state will also be created, linked to the estimate.
258183
# @param create_mass_estimate_request [CreateMassEstimateRequest]

lib/patch_ruby/api_client.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class ApiClient
3131
# @option config [Configuration] Configuration for initializing the object, default to Configuration.default
3232
def initialize(config = Configuration.default)
3333
@config = config
34-
@user_agent = "patch-ruby/2.4.0"
34+
@user_agent = "patch-ruby/2.5.0"
3535
@default_headers = {
3636
'Content-Type' => 'application/json',
3737
'User-Agent' => @user_agent

0 commit comments

Comments
 (0)