patch_ruby 2.1.1 → 2.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -155,24 +155,24 @@ module Patch
155
155
  # @return Array for valid properties with the reasons
156
156
  def list_invalid_properties
157
157
  invalid_properties = Array.new
158
- if !@vintage_year.nil? && @vintage_year > 2100
159
- invalid_properties.push('invalid value for "vintage_year", must be smaller than or equal to 2100.')
158
+ if !@vintage_year.nil? && @vintage_year > 2225
159
+ invalid_properties.push('invalid value for "vintage_year", must be smaller than or equal to 2225.')
160
160
  end
161
161
 
162
162
  if !@vintage_year.nil? && @vintage_year < 1900
163
163
  invalid_properties.push('invalid value for "vintage_year", must be greater than or equal to 1900.')
164
164
  end
165
165
 
166
- if !@vintage_start_year.nil? && @vintage_start_year > 2100
167
- invalid_properties.push('invalid value for "vintage_start_year", must be smaller than or equal to 2100.')
166
+ if !@vintage_start_year.nil? && @vintage_start_year > 2225
167
+ invalid_properties.push('invalid value for "vintage_start_year", must be smaller than or equal to 2225.')
168
168
  end
169
169
 
170
170
  if !@vintage_start_year.nil? && @vintage_start_year < 1900
171
171
  invalid_properties.push('invalid value for "vintage_start_year", must be greater than or equal to 1900.')
172
172
  end
173
173
 
174
- if !@vintage_end_year.nil? && @vintage_end_year > 2100
175
- invalid_properties.push('invalid value for "vintage_end_year", must be smaller than or equal to 2100.')
174
+ if !@vintage_end_year.nil? && @vintage_end_year > 2225
175
+ invalid_properties.push('invalid value for "vintage_end_year", must be smaller than or equal to 2225.')
176
176
  end
177
177
 
178
178
  if !@vintage_end_year.nil? && @vintage_end_year < 1900
@@ -197,16 +197,16 @@ module Patch
197
197
  # Check to see if the all the properties in the model are valid
198
198
  # @return true if the model is valid
199
199
  def valid?
200
- return false if !@vintage_year.nil? && @vintage_year > 2100
200
+ return false if !@vintage_year.nil? && @vintage_year > 2225
201
201
  return false if !@vintage_year.nil? && @vintage_year < 1900
202
- return false if !@vintage_start_year.nil? && @vintage_start_year > 2100
202
+ return false if !@vintage_start_year.nil? && @vintage_start_year > 2225
203
203
  return false if !@vintage_start_year.nil? && @vintage_start_year < 1900
204
- return false if !@vintage_end_year.nil? && @vintage_end_year > 2100
204
+ return false if !@vintage_end_year.nil? && @vintage_end_year > 2225
205
205
  return false if !@vintage_end_year.nil? && @vintage_end_year < 1900
206
206
  return false if !@price.nil? && @price < 2
207
207
  return false if !@amount.nil? && @amount > 100000000000000
208
208
  return false if !@amount.nil? && @amount < 0
209
- unit_validator = EnumAttributeValidator.new('String', ["g", "Wh"])
209
+ unit_validator = EnumAttributeValidator.new('String', ["g"])
210
210
  return false unless unit_validator.valid?(@unit)
211
211
  true
212
212
  end
@@ -214,8 +214,8 @@ module Patch
214
214
  # Custom attribute writer method with validation
215
215
  # @param [Object] vintage_year Value to be assigned
216
216
  def vintage_year=(vintage_year)
217
- if !vintage_year.nil? && vintage_year > 2100
218
- fail ArgumentError, 'invalid value for "vintage_year", must be smaller than or equal to 2100.'
217
+ if !vintage_year.nil? && vintage_year > 2225
218
+ fail ArgumentError, 'invalid value for "vintage_year", must be smaller than or equal to 2225.'
219
219
  end
220
220
 
221
221
  if !vintage_year.nil? && vintage_year < 1900
@@ -228,8 +228,8 @@ module Patch
228
228
  # Custom attribute writer method with validation
229
229
  # @param [Object] vintage_start_year Value to be assigned
230
230
  def vintage_start_year=(vintage_start_year)
231
- if !vintage_start_year.nil? && vintage_start_year > 2100
232
- fail ArgumentError, 'invalid value for "vintage_start_year", must be smaller than or equal to 2100.'
231
+ if !vintage_start_year.nil? && vintage_start_year > 2225
232
+ fail ArgumentError, 'invalid value for "vintage_start_year", must be smaller than or equal to 2225.'
233
233
  end
234
234
 
235
235
  if !vintage_start_year.nil? && vintage_start_year < 1900
@@ -242,8 +242,8 @@ module Patch
242
242
  # Custom attribute writer method with validation
243
243
  # @param [Object] vintage_end_year Value to be assigned
244
244
  def vintage_end_year=(vintage_end_year)
245
- if !vintage_end_year.nil? && vintage_end_year > 2100
246
- fail ArgumentError, 'invalid value for "vintage_end_year", must be smaller than or equal to 2100.'
245
+ if !vintage_end_year.nil? && vintage_end_year > 2225
246
+ fail ArgumentError, 'invalid value for "vintage_end_year", must be smaller than or equal to 2225.'
247
247
  end
248
248
 
249
249
  if !vintage_end_year.nil? && vintage_end_year < 1900
@@ -280,7 +280,7 @@ module Patch
280
280
  # Custom attribute writer method checking allowed values (enum).
281
281
  # @param [Object] unit Object to be assigned
282
282
  def unit=(unit)
283
- validator = EnumAttributeValidator.new('String', ["g", "Wh"])
283
+ validator = EnumAttributeValidator.new('String', ["g"])
284
284
  unless validator.valid?(unit)
285
285
  fail ArgumentError, "invalid value for \"unit\", must be one of #{validator.allowable_values}."
286
286
  end
@@ -11,5 +11,5 @@ OpenAPI Generator version: 5.3.1
11
11
  =end
12
12
 
13
13
  module Patch
14
- VERSION = '2.1.1'
14
+ VERSION = '2.3.1'
15
15
  end
data/lib/patch_ruby.rb CHANGED
@@ -19,8 +19,6 @@ require 'patch_ruby/configuration'
19
19
  # Models
20
20
  require 'patch_ruby/models/create_air_shipping_estimate_request'
21
21
  require 'patch_ruby/models/create_bitcoin_estimate_request'
22
- require 'patch_ruby/models/create_ecommerce_estimate_request'
23
- require 'patch_ruby/models/create_ethereum_estimate_request'
24
22
  require 'patch_ruby/models/create_flight_estimate_request'
25
23
  require 'patch_ruby/models/create_hotel_estimate_request'
26
24
  require 'patch_ruby/models/create_mass_estimate_request'
@@ -29,9 +27,7 @@ require 'patch_ruby/models/create_order_request'
29
27
  require 'patch_ruby/models/create_rail_shipping_estimate_request'
30
28
  require 'patch_ruby/models/create_road_shipping_estimate_request'
31
29
  require 'patch_ruby/models/create_sea_shipping_estimate_request'
32
- require 'patch_ruby/models/create_shipping_estimate_request'
33
30
  require 'patch_ruby/models/create_success_response'
34
- require 'patch_ruby/models/create_vehicle_estimate_request'
35
31
  require 'patch_ruby/models/delete_order_line_item_response'
36
32
  require 'patch_ruby/models/delete_order_response'
37
33
  require 'patch_ruby/models/disclaimer'
@@ -45,51 +45,6 @@ RSpec.describe 'Estimates Integration' do
45
45
  expect(flight_estimate_longer.data.mass_g).to be > 2 * flight_estimate.data.mass_g
46
46
  end
47
47
 
48
- it 'supports creating vehicle estimates' do
49
- distance_m = 10_000
50
- make = "Toyota"
51
- model = "Corolla"
52
- year = 2000
53
-
54
- vehicle_estimate = Patch::Estimate.create_vehicle_estimate(
55
- distance_m: distance_m,
56
- make: make,
57
- model: model,
58
- year: year,
59
- create_order: true
60
- )
61
-
62
- expect(vehicle_estimate.data.type).to eq 'vehicle'
63
- expect(vehicle_estimate.data.mass_g).to be >= 1_000
64
- expect(vehicle_estimate.data.order.amount).to be >= 1_000
65
- end
66
-
67
- it 'supports creating vehicle estimates with partial information' do
68
- distance_m = 10_000
69
-
70
- vehicle_estimate = Patch::Estimate.create_vehicle_estimate(
71
- distance_m: distance_m,
72
- create_order: false
73
- )
74
-
75
- expect(vehicle_estimate.data.type).to eq 'vehicle'
76
- expect(vehicle_estimate.data.mass_g).to eq 2_132
77
- end
78
-
79
- it 'supports creating shipping estimates' do
80
- distance_m = 100_000_000
81
- package_mass_g = 10_000
82
- create_estimate_response = Patch::Estimate.create_shipping_estimate(
83
- distance_m: distance_m,
84
- package_mass_g: package_mass_g,
85
- transportation_method: 'rail',
86
- create_order: false
87
- )
88
-
89
- expect(create_estimate_response.data.type).to eq 'ecommerce'
90
- expect(create_estimate_response.data.mass_g).to be >= 10_000
91
- end
92
-
93
48
  it 'supports creating bitcoin estimates with partial information' do
94
49
  bitcoin_estimate = Patch::Estimate.create_bitcoin_estimate()
95
50
 
@@ -136,26 +91,6 @@ RSpec.describe 'Estimates Integration' do
136
91
  expect(bitcoin_estimate_1.data.mass_g).to be < bitcoin_estimate_2.data.mass_g
137
92
  end
138
93
 
139
- it 'supports creating ethereum estimates with a gas amount' do
140
- ethereum_estimate = Patch::Estimate.create_ethereum_estimate(
141
- gas_used: 100
142
- )
143
-
144
- ethereum_estimate_2 = Patch::Estimate.create_ethereum_estimate(
145
- gas_used: 1000
146
- )
147
-
148
- expect(ethereum_estimate.data.type).to eq 'ethereum'
149
- expect(ethereum_estimate.data.mass_g).to be < ethereum_estimate_2.data.mass_g
150
- end
151
-
152
- it 'supports creating ethereum estimates with partial information' do
153
- ethereum_estimate = Patch::Estimate.create_ethereum_estimate({ create_order: false })
154
-
155
- expect(ethereum_estimate.data.type).to eq 'ethereum'
156
- expect(ethereum_estimate.data.mass_g).to be >= 2_000
157
- end
158
-
159
94
  it 'supports creating hotel estimates' do
160
95
  create_estimate_response = Patch::Estimate.create_hotel_estimate(
161
96
  country_code: "US",
@@ -171,20 +106,6 @@ RSpec.describe 'Estimates Integration' do
171
106
  expect(create_estimate_response.data.id).not_to be_nil
172
107
  end
173
108
 
174
- it 'supports creating ecommerce estimates' do
175
- distance_m = 100_000_000
176
- package_mass_g = 10_000
177
- create_estimate_response = Patch::Estimate.create_ecommerce_estimate(
178
- distance_m: distance_m,
179
- package_mass_g: package_mass_g,
180
- transportation_method: 'rail',
181
- create_order: false
182
- )
183
-
184
- expect(create_estimate_response.data.type).to eq 'ecommerce'
185
- expect(create_estimate_response.data.mass_g).to be >= 10_000
186
- end
187
-
188
109
  context "when creating an air shipping estimate" do
189
110
  it "supports creating an estimate using airports" do
190
111
  air_shipping_estimate = Patch::Estimate.create_air_shipping_estimate(
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: patch_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patch Technology
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-18 00:00:00.000000000 Z
11
+ date: 2025-04-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -103,8 +103,6 @@ files:
103
103
  - lib/patch_ruby/configuration.rb
104
104
  - lib/patch_ruby/models/create_air_shipping_estimate_request.rb
105
105
  - lib/patch_ruby/models/create_bitcoin_estimate_request.rb
106
- - lib/patch_ruby/models/create_ecommerce_estimate_request.rb
107
- - lib/patch_ruby/models/create_ethereum_estimate_request.rb
108
106
  - lib/patch_ruby/models/create_flight_estimate_request.rb
109
107
  - lib/patch_ruby/models/create_hotel_estimate_request.rb
110
108
  - lib/patch_ruby/models/create_mass_estimate_request.rb
@@ -113,9 +111,7 @@ files:
113
111
  - lib/patch_ruby/models/create_rail_shipping_estimate_request.rb
114
112
  - lib/patch_ruby/models/create_road_shipping_estimate_request.rb
115
113
  - lib/patch_ruby/models/create_sea_shipping_estimate_request.rb
116
- - lib/patch_ruby/models/create_shipping_estimate_request.rb
117
114
  - lib/patch_ruby/models/create_success_response.rb
118
- - lib/patch_ruby/models/create_vehicle_estimate_request.rb
119
115
  - lib/patch_ruby/models/delete_order_line_item_response.rb
120
116
  - lib/patch_ruby/models/delete_order_response.rb
121
117
  - lib/patch_ruby/models/disclaimer.rb
@@ -194,7 +190,7 @@ homepage: https://www.patch.io
194
190
  licenses:
195
191
  - MIT
196
192
  metadata: {}
197
- post_install_message:
193
+ post_install_message:
198
194
  rdoc_options: []
199
195
  require_paths:
200
196
  - lib
@@ -210,51 +206,51 @@ required_rubygems_version: !ruby/object:Gem::Requirement
210
206
  version: '0'
211
207
  requirements: []
212
208
  rubygems_version: 3.1.2
213
- signing_key:
209
+ signing_key:
214
210
  specification_version: 4
215
211
  summary: Ruby wrapper for the Patch API
216
212
  test_files:
217
213
  - spec/api/projects_api_spec.rb
218
- - spec/api/estimates_api_spec.rb
219
214
  - spec/api/orders_api_spec.rb
220
215
  - spec/api/order_line_items_api_spec.rb
216
+ - spec/api/estimates_api_spec.rb
221
217
  - spec/api/technology_types_api_spec.rb
222
218
  - spec/api_client_spec.rb
223
219
  - spec/configuration_spec.rb
224
220
  - spec/constants.rb
225
- - spec/factories/meta_index_objects.rb
226
- - spec/factories/estimate_list_responses.rb
227
- - spec/factories/create_mass_estimate_requests.rb
228
- - spec/factories/projects.rb
229
221
  - spec/factories/order_list_responses.rb
230
- - spec/factories/technology_type.rb
231
- - spec/factories/estimates.rb
232
- - spec/factories/error_responses.rb
233
- - spec/factories/parent_technology_type.rb
234
222
  - spec/factories/project_responses.rb
235
- - spec/factories/create_order_requests.rb
223
+ - spec/factories/estimate_list_responses.rb
224
+ - spec/factories/projects.rb
236
225
  - spec/factories/orders.rb
237
- - spec/factories/sdgs.rb
226
+ - spec/factories/technology_type.rb
238
227
  - spec/factories/order_responses.rb
239
- - spec/factories/project_list_responses.rb
228
+ - spec/factories/create_mass_estimate_requests.rb
240
229
  - spec/factories/estimate_responses.rb
230
+ - spec/factories/create_order_requests.rb
231
+ - spec/factories/parent_technology_type.rb
232
+ - spec/factories/project_list_responses.rb
233
+ - spec/factories/error_responses.rb
234
+ - spec/factories/estimates.rb
235
+ - spec/factories/meta_index_objects.rb
236
+ - spec/factories/sdgs.rb
241
237
  - spec/integration/projects/technology_types_spec.rb
238
+ - spec/integration/orders_spec.rb
242
239
  - spec/integration/estimates_spec.rb
243
240
  - spec/integration/projects_spec.rb
244
- - spec/integration/orders_spec.rb
245
- - spec/models/order_response_spec.rb
246
- - spec/models/meta_index_object_spec.rb
247
- - spec/models/project_spec.rb
248
241
  - spec/models/create_order_request_spec.rb
249
- - spec/models/project_response_spec.rb
242
+ - spec/models/estimate_response_spec.rb
243
+ - spec/models/meta_index_object_spec.rb
250
244
  - spec/models/create_mass_estimate_request_spec.rb
251
- - spec/models/project_list_response_spec.rb
252
245
  - spec/models/order_spec.rb
253
246
  - spec/models/error_response_spec.rb
247
+ - spec/models/order_response_spec.rb
254
248
  - spec/models/estimate_spec.rb
255
- - spec/models/order_list_response_spec.rb
256
249
  - spec/models/estimate_list_response_spec.rb
257
- - spec/models/estimate_response_spec.rb
250
+ - spec/models/order_list_response_spec.rb
251
+ - spec/models/project_list_response_spec.rb
252
+ - spec/models/project_spec.rb
253
+ - spec/models/project_response_spec.rb
258
254
  - spec/patch_ruby_spec.rb
259
255
  - spec/spec_helper.rb
260
256
  - spec/support/shared/generated_classes.rb