Skip to content

Commit f8dccdf

Browse files
authored
Remove unused estimates endpoint (#77)
1 parent 6274ccb commit f8dccdf

21 files changed

+69
-1342
lines changed

.rubocop.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Style/HashSyntax:
5151
# extra level of indentation.
5252
Layout/IndentationConsistency:
5353
Enabled: true
54-
EnforcedStyle: indented_internal_methods
54+
EnforcedStyle: normal
5555

5656
# Two spaces, no tabs (for indentation).
5757
Layout/IndentationWidth:

Gemfile.lock

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
patch_ruby (2.1.1)
4+
patch_ruby (2.3.0)
55
typhoeus (~> 1.0, >= 1.0.1)
66

77
GEM
@@ -21,10 +21,10 @@ GEM
2121
ffi (>= 1.15.0)
2222
factory_bot (6.2.0)
2323
activesupport (>= 5.0.0)
24-
ffi (1.15.5)
24+
ffi (1.17.1)
2525
i18n (1.12.0)
2626
concurrent-ruby (~> 1.0)
27-
jaro_winkler (1.5.4)
27+
jaro_winkler (1.5.6)
2828
method_source (1.0.0)
2929
minitest (5.18.0)
3030
parallel (1.20.1)
@@ -61,7 +61,7 @@ GEM
6161
ruby-progressbar (~> 1.7)
6262
unicode-display_width (>= 1.4.0, < 1.6)
6363
ruby-progressbar (1.11.0)
64-
typhoeus (1.4.0)
64+
typhoeus (1.4.1)
6565
ethon (>= 0.9.0)
6666
tzinfo (2.0.6)
6767
concurrent-ruby (~> 1.0)
@@ -71,6 +71,7 @@ PLATFORMS
7171
arm64-darwin-20
7272
arm64-darwin-21
7373
arm64-darwin-22
74+
arm64-darwin-24
7475
x86_64-darwin-20
7576
x86_64-darwin-21
7677
x86_64-linux

lib/patch_ruby.rb

-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
require 'patch_ruby/models/create_air_shipping_estimate_request'
2121
require 'patch_ruby/models/create_bitcoin_estimate_request'
2222
require 'patch_ruby/models/create_ecommerce_estimate_request'
23-
require 'patch_ruby/models/create_ethereum_estimate_request'
2423
require 'patch_ruby/models/create_flight_estimate_request'
2524
require 'patch_ruby/models/create_hotel_estimate_request'
2625
require 'patch_ruby/models/create_mass_estimate_request'
@@ -29,9 +28,7 @@
2928
require 'patch_ruby/models/create_rail_shipping_estimate_request'
3029
require 'patch_ruby/models/create_road_shipping_estimate_request'
3130
require 'patch_ruby/models/create_sea_shipping_estimate_request'
32-
require 'patch_ruby/models/create_shipping_estimate_request'
3331
require 'patch_ruby/models/create_success_response'
34-
require 'patch_ruby/models/create_vehicle_estimate_request'
3532
require 'patch_ruby/models/delete_order_line_item_response'
3633
require 'patch_ruby/models/delete_order_response'
3734
require 'patch_ruby/models/disclaimer'

lib/patch_ruby/api/estimates_api.rb

+1-226
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,12 @@ class EstimatesApi
1818
:create_air_shipping_estimate,
1919
:create_bitcoin_estimate,
2020
:create_ecommerce_estimate,
21-
:create_ethereum_estimate,
2221
:create_flight_estimate,
2322
:create_hotel_estimate,
2423
:create_mass_estimate,
2524
:create_rail_shipping_estimate,
2625
:create_road_shipping_estimate,
2726
:create_sea_shipping_estimate,
28-
:create_shipping_estimate,
29-
:create_vehicle_estimate,
3027
:retrieve_estimate,
3128
:retrieve_estimates,
3229
]
@@ -258,80 +255,6 @@ def create_ecommerce_estimate_with_http_info(create_ecommerce_estimate_request,
258255
return data, status_code, headers
259256
end
260257

261-
# Create an ethereum estimate
262-
# Creates an ethereum 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.
263-
# @param create_ethereum_estimate_request [CreateEthereumEstimateRequest]
264-
# @param [Hash] opts the optional parameters
265-
# @option opts [Integer] :patch_version
266-
# @return [EstimateResponse]
267-
def create_ethereum_estimate(create_ethereum_estimate_request = {}, opts = {})
268-
_create_ethereum_estimate_request = Patch::CreateEthereumEstimateRequest.new(create_ethereum_estimate_request)
269-
data, _status_code, _headers = create_ethereum_estimate_with_http_info(_create_ethereum_estimate_request, opts)
270-
data
271-
end
272-
273-
# Create an ethereum estimate
274-
# Creates an ethereum 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.
275-
# @param create_ethereum_estimate_request [CreateEthereumEstimateRequest]
276-
# @param [Hash] opts the optional parameters
277-
# @option opts [Integer] :patch_version
278-
# @return [Array<(EstimateResponse, Integer, Hash)>] EstimateResponse data, response status code and response headers
279-
def create_ethereum_estimate_with_http_info(create_ethereum_estimate_request, opts = {})
280-
if @api_client.config.debugging
281-
@api_client.config.logger.debug 'Calling API: EstimatesApi.create_ethereum_estimate ...'
282-
end
283-
# verify the required parameter 'create_ethereum_estimate_request' is set
284-
if @api_client.config.client_side_validation && create_ethereum_estimate_request.nil?
285-
fail ArgumentError, "Missing the required parameter 'create_ethereum_estimate_request' when calling EstimatesApi.create_ethereum_estimate"
286-
end
287-
# resource path
288-
local_var_path = '/v1/estimates/crypto/eth'
289-
290-
# query parameters
291-
query_params = opts[:query_params] || {}
292-
293-
# header parameters
294-
header_params = opts[:header_params] || {}
295-
296-
# HTTP header 'Accept' (if needed)
297-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
298-
# HTTP header 'Content-Type'
299-
content_type = @api_client.select_header_content_type(['application/json'])
300-
if !content_type.nil?
301-
header_params['Content-Type'] = content_type
302-
end
303-
header_params['Patch-Version'] = 2
304-
header_params[:'Patch-Version'] = opts[:'patch_version'] if !opts[:'patch_version'].nil?
305-
306-
# form parameters
307-
form_params = opts[:form_params] || {}
308-
309-
# http body (model)
310-
post_body = opts[:debug_body] || @api_client.object_to_http_body(create_ethereum_estimate_request)
311-
312-
# return_type
313-
return_type = opts[:debug_return_type] || 'EstimateResponse'
314-
315-
# auth_names
316-
auth_names = opts[:debug_auth_names] || ['bearer_auth']
317-
318-
new_options = opts.merge(
319-
:operation => :"EstimatesApi.create_ethereum_estimate",
320-
:header_params => header_params,
321-
:query_params => query_params,
322-
:form_params => form_params,
323-
:body => post_body,
324-
:auth_names => auth_names,
325-
:return_type => return_type
326-
)
327-
328-
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
329-
if @api_client.config.debugging
330-
@api_client.config.logger.debug "API called: EstimatesApi#create_ethereum_estimate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
331-
end
332-
return data, status_code, headers
333-
end
334-
335258
# Create a flight estimate given the distance traveled in meters
336259
# 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.
337260
# @param create_flight_estimate_request [CreateFlightEstimateRequest]
@@ -776,154 +699,6 @@ def create_sea_shipping_estimate_with_http_info(create_sea_shipping_estimate_req
776699
return data, status_code, headers
777700
end
778701

779-
# Create a shipping estimate given the distance traveled in meters, package weight, and transportation method.
780-
# 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.
781-
# @param create_shipping_estimate_request [CreateShippingEstimateRequest]
782-
# @param [Hash] opts the optional parameters
783-
# @option opts [Integer] :patch_version
784-
# @return [EstimateResponse]
785-
def create_shipping_estimate(create_shipping_estimate_request = {}, opts = {})
786-
_create_shipping_estimate_request = Patch::CreateShippingEstimateRequest.new(create_shipping_estimate_request)
787-
data, _status_code, _headers = create_shipping_estimate_with_http_info(_create_shipping_estimate_request, opts)
788-
data
789-
end
790-
791-
# Create a shipping estimate given the distance traveled in meters, package weight, and transportation method.
792-
# 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.
793-
# @param create_shipping_estimate_request [CreateShippingEstimateRequest]
794-
# @param [Hash] opts the optional parameters
795-
# @option opts [Integer] :patch_version
796-
# @return [Array<(EstimateResponse, Integer, Hash)>] EstimateResponse data, response status code and response headers
797-
def create_shipping_estimate_with_http_info(create_shipping_estimate_request, opts = {})
798-
if @api_client.config.debugging
799-
@api_client.config.logger.debug 'Calling API: EstimatesApi.create_shipping_estimate ...'
800-
end
801-
# verify the required parameter 'create_shipping_estimate_request' is set
802-
if @api_client.config.client_side_validation && create_shipping_estimate_request.nil?
803-
fail ArgumentError, "Missing the required parameter 'create_shipping_estimate_request' when calling EstimatesApi.create_shipping_estimate"
804-
end
805-
# resource path
806-
local_var_path = '/v1/estimates/shipping'
807-
808-
# query parameters
809-
query_params = opts[:query_params] || {}
810-
811-
# header parameters
812-
header_params = opts[:header_params] || {}
813-
814-
# HTTP header 'Accept' (if needed)
815-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
816-
# HTTP header 'Content-Type'
817-
content_type = @api_client.select_header_content_type(['application/json'])
818-
if !content_type.nil?
819-
header_params['Content-Type'] = content_type
820-
end
821-
header_params['Patch-Version'] = 2
822-
header_params[:'Patch-Version'] = opts[:'patch_version'] if !opts[:'patch_version'].nil?
823-
824-
# form parameters
825-
form_params = opts[:form_params] || {}
826-
827-
# http body (model)
828-
post_body = opts[:debug_body] || @api_client.object_to_http_body(create_shipping_estimate_request)
829-
830-
# return_type
831-
return_type = opts[:debug_return_type] || 'EstimateResponse'
832-
833-
# auth_names
834-
auth_names = opts[:debug_auth_names] || ['bearer_auth']
835-
836-
new_options = opts.merge(
837-
:operation => :"EstimatesApi.create_shipping_estimate",
838-
:header_params => header_params,
839-
:query_params => query_params,
840-
:form_params => form_params,
841-
:body => post_body,
842-
:auth_names => auth_names,
843-
:return_type => return_type
844-
)
845-
846-
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
847-
if @api_client.config.debugging
848-
@api_client.config.logger.debug "API called: EstimatesApi#create_shipping_estimate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
849-
end
850-
return data, status_code, headers
851-
end
852-
853-
# Create a vehicle estimate given the distance traveled in meters and the type of vehicle
854-
# Creates an estimate and calculates the amount of CO2 to be compensated depending on the distance and the vehicle. An order in the `draft` state may be created based on the parameters, linked to the estimate.
855-
# @param create_vehicle_estimate_request [CreateVehicleEstimateRequest]
856-
# @param [Hash] opts the optional parameters
857-
# @option opts [Integer] :patch_version
858-
# @return [EstimateResponse]
859-
def create_vehicle_estimate(create_vehicle_estimate_request = {}, opts = {})
860-
_create_vehicle_estimate_request = Patch::CreateVehicleEstimateRequest.new(create_vehicle_estimate_request)
861-
data, _status_code, _headers = create_vehicle_estimate_with_http_info(_create_vehicle_estimate_request, opts)
862-
data
863-
end
864-
865-
# Create a vehicle estimate given the distance traveled in meters and the type of vehicle
866-
# Creates an estimate and calculates the amount of CO2 to be compensated depending on the distance and the vehicle. An order in the `draft` state may be created based on the parameters, linked to the estimate.
867-
# @param create_vehicle_estimate_request [CreateVehicleEstimateRequest]
868-
# @param [Hash] opts the optional parameters
869-
# @option opts [Integer] :patch_version
870-
# @return [Array<(EstimateResponse, Integer, Hash)>] EstimateResponse data, response status code and response headers
871-
def create_vehicle_estimate_with_http_info(create_vehicle_estimate_request, opts = {})
872-
if @api_client.config.debugging
873-
@api_client.config.logger.debug 'Calling API: EstimatesApi.create_vehicle_estimate ...'
874-
end
875-
# verify the required parameter 'create_vehicle_estimate_request' is set
876-
if @api_client.config.client_side_validation && create_vehicle_estimate_request.nil?
877-
fail ArgumentError, "Missing the required parameter 'create_vehicle_estimate_request' when calling EstimatesApi.create_vehicle_estimate"
878-
end
879-
# resource path
880-
local_var_path = '/v1/estimates/vehicle'
881-
882-
# query parameters
883-
query_params = opts[:query_params] || {}
884-
885-
# header parameters
886-
header_params = opts[:header_params] || {}
887-
888-
# HTTP header 'Accept' (if needed)
889-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
890-
# HTTP header 'Content-Type'
891-
content_type = @api_client.select_header_content_type(['application/json'])
892-
if !content_type.nil?
893-
header_params['Content-Type'] = content_type
894-
end
895-
header_params['Patch-Version'] = 2
896-
header_params[:'Patch-Version'] = opts[:'patch_version'] if !opts[:'patch_version'].nil?
897-
898-
# form parameters
899-
form_params = opts[:form_params] || {}
900-
901-
# http body (model)
902-
post_body = opts[:debug_body] || @api_client.object_to_http_body(create_vehicle_estimate_request)
903-
904-
# return_type
905-
return_type = opts[:debug_return_type] || 'EstimateResponse'
906-
907-
# auth_names
908-
auth_names = opts[:debug_auth_names] || ['bearer_auth']
909-
910-
new_options = opts.merge(
911-
:operation => :"EstimatesApi.create_vehicle_estimate",
912-
:header_params => header_params,
913-
:query_params => query_params,
914-
:form_params => form_params,
915-
:body => post_body,
916-
:auth_names => auth_names,
917-
:return_type => return_type
918-
)
919-
920-
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
921-
if @api_client.config.debugging
922-
@api_client.config.logger.debug "API called: EstimatesApi#create_vehicle_estimate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
923-
end
924-
return data, status_code, headers
925-
end
926-
927702
# Retrieves an estimate
928703
# Retrieves a given estimate and its associated order. You can only retrieve estimates associated with the organization you are querying for.
929704
# @param id [String]
@@ -1059,4 +834,4 @@ def retrieve_estimates_with_http_info(opts = {})
1059834
return data, status_code, headers
1060835
end
1061836
end
1062-
end
837+
end

lib/patch_ruby/api/order_line_items_api.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -266,4 +266,4 @@ def update_order_line_item_with_http_info(order_id, serial_number, update_order_
266266
return data, status_code, headers
267267
end
268268
end
269-
end
269+
end

lib/patch_ruby/api/orders_api.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -460,4 +460,4 @@ def retrieve_orders_with_http_info(opts = {})
460460
return data, status_code, headers
461461
end
462462
end
463-
end
463+
end

lib/patch_ruby/api/projects_api.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -174,4 +174,4 @@ def retrieve_projects_with_http_info(opts = {})
174174
return data, status_code, headers
175175
end
176176
end
177-
end
177+
end

lib/patch_ruby/api/technology_types_api.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,4 +86,4 @@ def retrieve_technology_types_with_http_info(opts = {})
8686
return data, status_code, headers
8787
end
8888
end
89-
end
89+
end

lib/patch_ruby/api_client.rb

+1-1
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.1.1"
34+
@user_agent = "patch-ruby/2.3.0"
3535
@default_headers = {
3636
'Content-Type' => 'application/json',
3737
'User-Agent' => @user_agent

lib/patch_ruby/configuration.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,8 @@ def server_settings
242242
end
243243

244244
def operation_server_settings
245-
{}
245+
{
246+
}
246247
end
247248

248249
# Returns URL based on server settings

0 commit comments

Comments
 (0)