Skip to content

Commit 4dc0c0e

Browse files
authored
Validate body parameters before making HTTP requests (#42)
* Add new flights * Fix * Validate params * Update changelog * Update changelog * Reduce blank
1 parent 4c820a7 commit 4dc0c0e

File tree

8 files changed

+44
-19
lines changed

8 files changed

+44
-19
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+
## [1.11.1] - 2021-09-07
9+
10+
### Changed
11+
12+
- Body parameters are validated before being sent to the API. This gives developers faster feedback as they develop their applications.
13+
814
## [1.11.0] - 2021-09-07
915

1016
### Added

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 (1.11.0)
4+
patch_ruby (1.11.1)
55
typhoeus (~> 1.0, >= 1.0.1)
66

77
GEM

lib/patch_ruby/api/estimates_api.rb

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@ def initialize(api_client = ApiClient.default)
3535
# @param create_bitcoin_estimate_request [CreateBitcoinEstimateRequest]
3636
# @param [Hash] opts the optional parameters
3737
# @return [EstimateResponse]
38-
def create_bitcoin_estimate(create_bitcoin_estimate_request, opts = {})
39-
data, _status_code, _headers = create_bitcoin_estimate_with_http_info(create_bitcoin_estimate_request, opts)
38+
def create_bitcoin_estimate(create_bitcoin_estimate_request = {}, opts = {})
39+
_create_bitcoin_estimate_request = Patch::CreateBitcoinEstimateRequest.new(create_bitcoin_estimate_request)
40+
data, _status_code, _headers = create_bitcoin_estimate_with_http_info(_create_bitcoin_estimate_request, opts)
4041
data
4142
end
4243

@@ -100,8 +101,9 @@ def create_bitcoin_estimate_with_http_info(create_bitcoin_estimate_request, opts
100101
# @param create_ethereum_estimate_request [CreateEthereumEstimateRequest]
101102
# @param [Hash] opts the optional parameters
102103
# @return [EstimateResponse]
103-
def create_ethereum_estimate(create_ethereum_estimate_request, opts = {})
104-
data, _status_code, _headers = create_ethereum_estimate_with_http_info(create_ethereum_estimate_request, opts)
104+
def create_ethereum_estimate(create_ethereum_estimate_request = {}, opts = {})
105+
_create_ethereum_estimate_request = Patch::CreateEthereumEstimateRequest.new(create_ethereum_estimate_request)
106+
data, _status_code, _headers = create_ethereum_estimate_with_http_info(_create_ethereum_estimate_request, opts)
105107
data
106108
end
107109

@@ -165,8 +167,9 @@ def create_ethereum_estimate_with_http_info(create_ethereum_estimate_request, op
165167
# @param create_flight_estimate_request [CreateFlightEstimateRequest]
166168
# @param [Hash] opts the optional parameters
167169
# @return [EstimateResponse]
168-
def create_flight_estimate(create_flight_estimate_request, opts = {})
169-
data, _status_code, _headers = create_flight_estimate_with_http_info(create_flight_estimate_request, opts)
170+
def create_flight_estimate(create_flight_estimate_request = {}, opts = {})
171+
_create_flight_estimate_request = Patch::CreateFlightEstimateRequest.new(create_flight_estimate_request)
172+
data, _status_code, _headers = create_flight_estimate_with_http_info(_create_flight_estimate_request, opts)
170173
data
171174
end
172175

@@ -230,8 +233,9 @@ def create_flight_estimate_with_http_info(create_flight_estimate_request, opts =
230233
# @param create_mass_estimate_request [CreateMassEstimateRequest]
231234
# @param [Hash] opts the optional parameters
232235
# @return [EstimateResponse]
233-
def create_mass_estimate(create_mass_estimate_request, opts = {})
234-
data, _status_code, _headers = create_mass_estimate_with_http_info(create_mass_estimate_request, opts)
236+
def create_mass_estimate(create_mass_estimate_request = {}, opts = {})
237+
_create_mass_estimate_request = Patch::CreateMassEstimateRequest.new(create_mass_estimate_request)
238+
data, _status_code, _headers = create_mass_estimate_with_http_info(_create_mass_estimate_request, opts)
235239
data
236240
end
237241

@@ -295,8 +299,9 @@ def create_mass_estimate_with_http_info(create_mass_estimate_request, opts = {})
295299
# @param create_shipping_estimate_request [CreateShippingEstimateRequest]
296300
# @param [Hash] opts the optional parameters
297301
# @return [EstimateResponse]
298-
def create_shipping_estimate(create_shipping_estimate_request, opts = {})
299-
data, _status_code, _headers = create_shipping_estimate_with_http_info(create_shipping_estimate_request, opts)
302+
def create_shipping_estimate(create_shipping_estimate_request = {}, opts = {})
303+
_create_shipping_estimate_request = Patch::CreateShippingEstimateRequest.new(create_shipping_estimate_request)
304+
data, _status_code, _headers = create_shipping_estimate_with_http_info(_create_shipping_estimate_request, opts)
300305
data
301306
end
302307

@@ -360,8 +365,9 @@ def create_shipping_estimate_with_http_info(create_shipping_estimate_request, op
360365
# @param create_vehicle_estimate_request [CreateVehicleEstimateRequest]
361366
# @param [Hash] opts the optional parameters
362367
# @return [EstimateResponse]
363-
def create_vehicle_estimate(create_vehicle_estimate_request, opts = {})
364-
data, _status_code, _headers = create_vehicle_estimate_with_http_info(create_vehicle_estimate_request, opts)
368+
def create_vehicle_estimate(create_vehicle_estimate_request = {}, opts = {})
369+
_create_vehicle_estimate_request = Patch::CreateVehicleEstimateRequest.new(create_vehicle_estimate_request)
370+
data, _status_code, _headers = create_vehicle_estimate_with_http_info(_create_vehicle_estimate_request, opts)
365371
data
366372
end
367373

@@ -426,6 +432,7 @@ def create_vehicle_estimate_with_http_info(create_vehicle_estimate_request, opts
426432
# @param [Hash] opts the optional parameters
427433
# @return [EstimateResponse]
428434
def retrieve_estimate(id, opts = {})
435+
429436
data, _status_code, _headers = retrieve_estimate_with_http_info(id, opts)
430437
data
431438
end
@@ -489,6 +496,7 @@ def retrieve_estimate_with_http_info(id, opts = {})
489496
# @option opts [Integer] :page
490497
# @return [EstimateListResponse]
491498
def retrieve_estimates(opts = {})
499+
492500
data, _status_code, _headers = retrieve_estimates_with_http_info(opts)
493501
data
494502
end

lib/patch_ruby/api/orders_api.rb

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ def initialize(api_client = ApiClient.default)
3333
# @param [Hash] opts the optional parameters
3434
# @return [OrderResponse]
3535
def cancel_order(id, opts = {})
36+
3637
data, _status_code, _headers = cancel_order_with_http_info(id, opts)
3738
data
3839
end
@@ -95,8 +96,9 @@ def cancel_order_with_http_info(id, opts = {})
9596
# @param create_order_request [CreateOrderRequest]
9697
# @param [Hash] opts the optional parameters
9798
# @return [OrderResponse]
98-
def create_order(create_order_request, opts = {})
99-
data, _status_code, _headers = create_order_with_http_info(create_order_request, opts)
99+
def create_order(create_order_request = {}, opts = {})
100+
_create_order_request = Patch::CreateOrderRequest.new(create_order_request)
101+
data, _status_code, _headers = create_order_with_http_info(_create_order_request, opts)
100102
data
101103
end
102104

@@ -161,6 +163,7 @@ def create_order_with_http_info(create_order_request, opts = {})
161163
# @param [Hash] opts the optional parameters
162164
# @return [OrderResponse]
163165
def place_order(id, opts = {})
166+
164167
data, _status_code, _headers = place_order_with_http_info(id, opts)
165168
data
166169
end
@@ -224,6 +227,7 @@ def place_order_with_http_info(id, opts = {})
224227
# @param [Hash] opts the optional parameters
225228
# @return [OrderResponse]
226229
def retrieve_order(id, opts = {})
230+
227231
data, _status_code, _headers = retrieve_order_with_http_info(id, opts)
228232
data
229233
end
@@ -290,6 +294,7 @@ def retrieve_order_with_http_info(id, opts = {})
290294
# @option opts [String] :metadata_example2
291295
# @return [OrderListResponse]
292296
def retrieve_orders(opts = {})
297+
293298
data, _status_code, _headers = retrieve_orders_with_http_info(opts)
294299
data
295300
end

lib/patch_ruby/api/preferences_api.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@ def initialize(api_client = ApiClient.default)
3131
# @param create_preference_request [CreatePreferenceRequest]
3232
# @param [Hash] opts the optional parameters
3333
# @return [PreferenceResponse]
34-
def create_preference(create_preference_request, opts = {})
35-
data, _status_code, _headers = create_preference_with_http_info(create_preference_request, opts)
34+
def create_preference(create_preference_request = {}, opts = {})
35+
_create_preference_request = Patch::CreatePreferenceRequest.new(create_preference_request)
36+
data, _status_code, _headers = create_preference_with_http_info(_create_preference_request, opts)
3637
data
3738
end
3839

@@ -97,6 +98,7 @@ def create_preference_with_http_info(create_preference_request, opts = {})
9798
# @param [Hash] opts the optional parameters
9899
# @return [PreferenceResponse]
99100
def delete_preference(id, opts = {})
101+
100102
data, _status_code, _headers = delete_preference_with_http_info(id, opts)
101103
data
102104
end
@@ -160,6 +162,7 @@ def delete_preference_with_http_info(id, opts = {})
160162
# @param [Hash] opts the optional parameters
161163
# @return [PreferenceResponse]
162164
def retrieve_preference(id, opts = {})
165+
163166
data, _status_code, _headers = retrieve_preference_with_http_info(id, opts)
164167
data
165168
end
@@ -223,6 +226,7 @@ def retrieve_preference_with_http_info(id, opts = {})
223226
# @option opts [Integer] :page
224227
# @return [PreferenceListResponse]
225228
def retrieve_preferences(opts = {})
229+
226230
data, _status_code, _headers = retrieve_preferences_with_http_info(opts)
227231
data
228232
end

lib/patch_ruby/api/projects_api.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ def initialize(api_client = ApiClient.default)
3030
# @param [Hash] opts the optional parameters
3131
# @return [ProjectResponse]
3232
def retrieve_project(id, opts = {})
33+
3334
data, _status_code, _headers = retrieve_project_with_http_info(id, opts)
3435
data
3536
end
@@ -96,6 +97,7 @@ def retrieve_project_with_http_info(id, opts = {})
9697
# @option opts [Integer] :minimum_available_mass
9798
# @return [ProjectListResponse]
9899
def retrieve_projects(opts = {})
100+
99101
data, _status_code, _headers = retrieve_projects_with_http_info(opts)
100102
data
101103
end

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

lib/patch_ruby/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111
=end
1212

1313
module Patch
14-
VERSION = '1.11.0'
14+
VERSION = '1.11.1'
1515
end

0 commit comments

Comments
 (0)