patch_ruby 2.0.0 → 2.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +19 -0
- data/Gemfile.lock +13 -13
- data/lib/patch_ruby/api/estimates_api.rb +1 -226
- data/lib/patch_ruby/api/order_line_items_api.rb +1 -1
- data/lib/patch_ruby/api/orders_api.rb +1 -1
- data/lib/patch_ruby/api/projects_api.rb +1 -1
- data/lib/patch_ruby/api/technology_types_api.rb +1 -1
- data/lib/patch_ruby/api_client.rb +1 -1
- data/lib/patch_ruby/models/create_mass_estimate_request.rb +5 -5
- data/lib/patch_ruby/models/create_order_line_item_request.rb +81 -13
- data/lib/patch_ruby/models/create_order_request.rb +81 -13
- data/lib/patch_ruby/models/create_road_shipping_estimate_request.rb +11 -1
- data/lib/patch_ruby/models/{create_ethereum_estimate_request.rb → disclaimer.rb} +54 -53
- data/lib/patch_ruby/models/estimate.rb +1 -1
- data/lib/patch_ruby/models/inventory.rb +31 -1
- data/lib/patch_ruby/models/order.rb +6 -6
- data/lib/patch_ruby/models/order_line_item.rb +31 -1
- data/lib/patch_ruby/models/project.rb +61 -5
- data/lib/patch_ruby/models/update_order_line_item_request.rb +81 -13
- data/lib/patch_ruby/version.rb +1 -1
- data/lib/patch_ruby.rb +1 -3
- data/patch_ruby.gemspec +1 -1
- data/spec/integration/estimates_spec.rb +0 -65
- data/spec/integration/orders_spec.rb +36 -0
- data/spec/integration/projects_spec.rb +17 -3
- data/spec/models/create_order_request_spec.rb +1 -1
- metadata +27 -29
- data/lib/patch_ruby/models/create_shipping_estimate_request.rb +0 -373
- data/lib/patch_ruby/models/create_vehicle_estimate_request.rb +0 -328
@@ -23,6 +23,10 @@ module Patch
|
|
23
23
|
|
24
24
|
attr_accessor :vintage_year
|
25
25
|
|
26
|
+
attr_accessor :vintage_start_year
|
27
|
+
|
28
|
+
attr_accessor :vintage_end_year
|
29
|
+
|
26
30
|
attr_accessor :total_price
|
27
31
|
|
28
32
|
attr_accessor :currency
|
@@ -62,6 +66,8 @@ module Patch
|
|
62
66
|
:'metadata' => :'metadata',
|
63
67
|
:'state' => :'state',
|
64
68
|
:'vintage_year' => :'vintage_year',
|
69
|
+
:'vintage_start_year' => :'vintage_start_year',
|
70
|
+
:'vintage_end_year' => :'vintage_end_year',
|
65
71
|
:'total_price' => :'total_price',
|
66
72
|
:'currency' => :'currency',
|
67
73
|
:'amount' => :'amount',
|
@@ -82,6 +88,8 @@ module Patch
|
|
82
88
|
:'metadata' => :'Object',
|
83
89
|
:'state' => :'String',
|
84
90
|
:'vintage_year' => :'Integer',
|
91
|
+
:'vintage_start_year' => :'Integer',
|
92
|
+
:'vintage_end_year' => :'Integer',
|
85
93
|
:'total_price' => :'Integer',
|
86
94
|
:'currency' => :'String',
|
87
95
|
:'amount' => :'Integer',
|
@@ -97,6 +105,8 @@ module Patch
|
|
97
105
|
:'metadata',
|
98
106
|
:'state',
|
99
107
|
:'vintage_year',
|
108
|
+
:'vintage_start_year',
|
109
|
+
:'vintage_end_year',
|
100
110
|
:'total_price',
|
101
111
|
:'currency',
|
102
112
|
:'amount',
|
@@ -147,6 +157,14 @@ module Patch
|
|
147
157
|
self.vintage_year = attributes[:'vintage_year']
|
148
158
|
end
|
149
159
|
|
160
|
+
if attributes.key?(:'vintage_start_year')
|
161
|
+
self.vintage_start_year = attributes[:'vintage_start_year']
|
162
|
+
end
|
163
|
+
|
164
|
+
if attributes.key?(:'vintage_end_year')
|
165
|
+
self.vintage_end_year = attributes[:'vintage_end_year']
|
166
|
+
end
|
167
|
+
|
150
168
|
if attributes.key?(:'total_price')
|
151
169
|
self.total_price = attributes[:'total_price']
|
152
170
|
end
|
@@ -172,20 +190,36 @@ module Patch
|
|
172
190
|
# @return Array for valid properties with the reasons
|
173
191
|
def list_invalid_properties
|
174
192
|
invalid_properties = Array.new
|
175
|
-
if !@vintage_year.nil? && @vintage_year >
|
176
|
-
invalid_properties.push('invalid value for "vintage_year", must be smaller than or equal to
|
193
|
+
if !@vintage_year.nil? && @vintage_year > 2225
|
194
|
+
invalid_properties.push('invalid value for "vintage_year", must be smaller than or equal to 2225.')
|
177
195
|
end
|
178
196
|
|
179
197
|
if !@vintage_year.nil? && @vintage_year < 1900
|
180
198
|
invalid_properties.push('invalid value for "vintage_year", must be greater than or equal to 1900.')
|
181
199
|
end
|
182
200
|
|
201
|
+
if !@vintage_start_year.nil? && @vintage_start_year > 2225
|
202
|
+
invalid_properties.push('invalid value for "vintage_start_year", must be smaller than or equal to 2225.')
|
203
|
+
end
|
204
|
+
|
205
|
+
if !@vintage_start_year.nil? && @vintage_start_year < 1900
|
206
|
+
invalid_properties.push('invalid value for "vintage_start_year", must be greater than or equal to 1900.')
|
207
|
+
end
|
208
|
+
|
209
|
+
if !@vintage_end_year.nil? && @vintage_end_year > 2225
|
210
|
+
invalid_properties.push('invalid value for "vintage_end_year", must be smaller than or equal to 2225.')
|
211
|
+
end
|
212
|
+
|
213
|
+
if !@vintage_end_year.nil? && @vintage_end_year < 1900
|
214
|
+
invalid_properties.push('invalid value for "vintage_end_year", must be greater than or equal to 1900.')
|
215
|
+
end
|
216
|
+
|
183
217
|
if !@total_price.nil? && @total_price < 2
|
184
218
|
invalid_properties.push('invalid value for "total_price", must be greater than or equal to 2.')
|
185
219
|
end
|
186
220
|
|
187
|
-
if !@amount.nil? && @amount >
|
188
|
-
invalid_properties.push('invalid value for "amount", must be smaller than or equal to
|
221
|
+
if !@amount.nil? && @amount > 100000000000000
|
222
|
+
invalid_properties.push('invalid value for "amount", must be smaller than or equal to 100000000000000.')
|
189
223
|
end
|
190
224
|
|
191
225
|
if !@amount.nil? && @amount < 0
|
@@ -200,12 +234,16 @@ module Patch
|
|
200
234
|
def valid?
|
201
235
|
state_validator = EnumAttributeValidator.new('String', ["draft", "reserved", "placed"])
|
202
236
|
return false unless state_validator.valid?(@state)
|
203
|
-
return false if !@vintage_year.nil? && @vintage_year >
|
237
|
+
return false if !@vintage_year.nil? && @vintage_year > 2225
|
204
238
|
return false if !@vintage_year.nil? && @vintage_year < 1900
|
239
|
+
return false if !@vintage_start_year.nil? && @vintage_start_year > 2225
|
240
|
+
return false if !@vintage_start_year.nil? && @vintage_start_year < 1900
|
241
|
+
return false if !@vintage_end_year.nil? && @vintage_end_year > 2225
|
242
|
+
return false if !@vintage_end_year.nil? && @vintage_end_year < 1900
|
205
243
|
return false if !@total_price.nil? && @total_price < 2
|
206
|
-
return false if !@amount.nil? && @amount >
|
244
|
+
return false if !@amount.nil? && @amount > 100000000000000
|
207
245
|
return false if !@amount.nil? && @amount < 0
|
208
|
-
unit_validator = EnumAttributeValidator.new('String', ["g"
|
246
|
+
unit_validator = EnumAttributeValidator.new('String', ["g"])
|
209
247
|
return false unless unit_validator.valid?(@unit)
|
210
248
|
true
|
211
249
|
end
|
@@ -223,8 +261,8 @@ module Patch
|
|
223
261
|
# Custom attribute writer method with validation
|
224
262
|
# @param [Object] vintage_year Value to be assigned
|
225
263
|
def vintage_year=(vintage_year)
|
226
|
-
if !vintage_year.nil? && vintage_year >
|
227
|
-
fail ArgumentError, 'invalid value for "vintage_year", must be smaller than or equal to
|
264
|
+
if !vintage_year.nil? && vintage_year > 2225
|
265
|
+
fail ArgumentError, 'invalid value for "vintage_year", must be smaller than or equal to 2225.'
|
228
266
|
end
|
229
267
|
|
230
268
|
if !vintage_year.nil? && vintage_year < 1900
|
@@ -234,6 +272,34 @@ module Patch
|
|
234
272
|
@vintage_year = vintage_year
|
235
273
|
end
|
236
274
|
|
275
|
+
# Custom attribute writer method with validation
|
276
|
+
# @param [Object] vintage_start_year Value to be assigned
|
277
|
+
def vintage_start_year=(vintage_start_year)
|
278
|
+
if !vintage_start_year.nil? && vintage_start_year > 2225
|
279
|
+
fail ArgumentError, 'invalid value for "vintage_start_year", must be smaller than or equal to 2225.'
|
280
|
+
end
|
281
|
+
|
282
|
+
if !vintage_start_year.nil? && vintage_start_year < 1900
|
283
|
+
fail ArgumentError, 'invalid value for "vintage_start_year", must be greater than or equal to 1900.'
|
284
|
+
end
|
285
|
+
|
286
|
+
@vintage_start_year = vintage_start_year
|
287
|
+
end
|
288
|
+
|
289
|
+
# Custom attribute writer method with validation
|
290
|
+
# @param [Object] vintage_end_year Value to be assigned
|
291
|
+
def vintage_end_year=(vintage_end_year)
|
292
|
+
if !vintage_end_year.nil? && vintage_end_year > 2225
|
293
|
+
fail ArgumentError, 'invalid value for "vintage_end_year", must be smaller than or equal to 2225.'
|
294
|
+
end
|
295
|
+
|
296
|
+
if !vintage_end_year.nil? && vintage_end_year < 1900
|
297
|
+
fail ArgumentError, 'invalid value for "vintage_end_year", must be greater than or equal to 1900.'
|
298
|
+
end
|
299
|
+
|
300
|
+
@vintage_end_year = vintage_end_year
|
301
|
+
end
|
302
|
+
|
237
303
|
# Custom attribute writer method with validation
|
238
304
|
# @param [Object] total_price Value to be assigned
|
239
305
|
def total_price=(total_price)
|
@@ -247,8 +313,8 @@ module Patch
|
|
247
313
|
# Custom attribute writer method with validation
|
248
314
|
# @param [Object] amount Value to be assigned
|
249
315
|
def amount=(amount)
|
250
|
-
if !amount.nil? && amount >
|
251
|
-
fail ArgumentError, 'invalid value for "amount", must be smaller than or equal to
|
316
|
+
if !amount.nil? && amount > 100000000000000
|
317
|
+
fail ArgumentError, 'invalid value for "amount", must be smaller than or equal to 100000000000000.'
|
252
318
|
end
|
253
319
|
|
254
320
|
if !amount.nil? && amount < 0
|
@@ -261,7 +327,7 @@ module Patch
|
|
261
327
|
# Custom attribute writer method checking allowed values (enum).
|
262
328
|
# @param [Object] unit Object to be assigned
|
263
329
|
def unit=(unit)
|
264
|
-
validator = EnumAttributeValidator.new('String', ["g"
|
330
|
+
validator = EnumAttributeValidator.new('String', ["g"])
|
265
331
|
unless validator.valid?(unit)
|
266
332
|
fail ArgumentError, "invalid value for \"unit\", must be one of #{validator.allowable_values}."
|
267
333
|
end
|
@@ -277,6 +343,8 @@ module Patch
|
|
277
343
|
metadata == o.metadata &&
|
278
344
|
state == o.state &&
|
279
345
|
vintage_year == o.vintage_year &&
|
346
|
+
vintage_start_year == o.vintage_start_year &&
|
347
|
+
vintage_end_year == o.vintage_end_year &&
|
280
348
|
total_price == o.total_price &&
|
281
349
|
currency == o.currency &&
|
282
350
|
amount == o.amount &&
|
@@ -293,7 +361,7 @@ module Patch
|
|
293
361
|
# Calculates hash code according to all attributes.
|
294
362
|
# @return [Integer] Hash code
|
295
363
|
def hash
|
296
|
-
[project_id, metadata, state, vintage_year, total_price, currency, amount, unit, issued_to].hash
|
364
|
+
[project_id, metadata, state, vintage_year, vintage_start_year, vintage_end_year, total_price, currency, amount, unit, issued_to].hash
|
297
365
|
end
|
298
366
|
|
299
367
|
# Builds the object from hash
|
@@ -41,6 +41,8 @@ module Patch
|
|
41
41
|
|
42
42
|
attr_accessor :truck_weight_t
|
43
43
|
|
44
|
+
attr_accessor :carrier_scac
|
45
|
+
|
44
46
|
attr_accessor :project_id
|
45
47
|
|
46
48
|
attr_accessor :create_order
|
@@ -83,6 +85,7 @@ module Patch
|
|
83
85
|
:'fuel_type' => :'fuel_type',
|
84
86
|
:'number_of_containers' => :'number_of_containers',
|
85
87
|
:'truck_weight_t' => :'truck_weight_t',
|
88
|
+
:'carrier_scac' => :'carrier_scac',
|
86
89
|
:'project_id' => :'project_id',
|
87
90
|
:'create_order' => :'create_order'
|
88
91
|
}
|
@@ -109,6 +112,7 @@ module Patch
|
|
109
112
|
:'fuel_type' => :'String',
|
110
113
|
:'number_of_containers' => :'Integer',
|
111
114
|
:'truck_weight_t' => :'Integer',
|
115
|
+
:'carrier_scac' => :'String',
|
112
116
|
:'project_id' => :'String',
|
113
117
|
:'create_order' => :'Boolean'
|
114
118
|
}
|
@@ -127,6 +131,7 @@ module Patch
|
|
127
131
|
:'fuel_type',
|
128
132
|
:'number_of_containers',
|
129
133
|
:'truck_weight_t',
|
134
|
+
:'carrier_scac',
|
130
135
|
:'project_id',
|
131
136
|
:'create_order'
|
132
137
|
])
|
@@ -217,6 +222,10 @@ module Patch
|
|
217
222
|
self.truck_weight_t = attributes[:'truck_weight_t']
|
218
223
|
end
|
219
224
|
|
225
|
+
if attributes.key?(:'carrier_scac')
|
226
|
+
self.carrier_scac = attributes[:'carrier_scac']
|
227
|
+
end
|
228
|
+
|
220
229
|
if attributes.key?(:'project_id')
|
221
230
|
self.project_id = attributes[:'project_id']
|
222
231
|
end
|
@@ -370,6 +379,7 @@ module Patch
|
|
370
379
|
fuel_type == o.fuel_type &&
|
371
380
|
number_of_containers == o.number_of_containers &&
|
372
381
|
truck_weight_t == o.truck_weight_t &&
|
382
|
+
carrier_scac == o.carrier_scac &&
|
373
383
|
project_id == o.project_id &&
|
374
384
|
create_order == o.create_order
|
375
385
|
end
|
@@ -383,7 +393,7 @@ module Patch
|
|
383
393
|
# Calculates hash code according to all attributes.
|
384
394
|
# @return [Integer] Hash code
|
385
395
|
def hash
|
386
|
-
[destination_country_code, destination_locode, destination_postal_code, origin_country_code, origin_locode, origin_postal_code, cargo_type, container_size_code, emissions_scope, freight_mass_g, fuel_type, number_of_containers, truck_weight_t, project_id, create_order].hash
|
396
|
+
[destination_country_code, destination_locode, destination_postal_code, origin_country_code, origin_locode, origin_postal_code, cargo_type, container_size_code, emissions_scope, freight_mass_g, fuel_type, number_of_containers, truck_weight_t, carrier_scac, project_id, create_order].hash
|
387
397
|
end
|
388
398
|
|
389
399
|
# Builds the object from hash
|
@@ -14,28 +14,30 @@ require 'date'
|
|
14
14
|
require 'time'
|
15
15
|
|
16
16
|
module Patch
|
17
|
-
class
|
18
|
-
|
17
|
+
class Disclaimer
|
18
|
+
# The body of the disclaimer.
|
19
|
+
attr_accessor :body
|
19
20
|
|
20
|
-
|
21
|
+
# The header for the disclaimer.
|
22
|
+
attr_accessor :header
|
21
23
|
|
22
|
-
|
24
|
+
# The severity of the disclaimer.
|
25
|
+
attr_accessor :severity
|
23
26
|
|
24
|
-
|
27
|
+
# The text for the provided link.
|
28
|
+
attr_accessor :link_text
|
25
29
|
|
26
|
-
|
27
|
-
|
28
|
-
attr_accessor :create_order
|
30
|
+
# The destination of the provided link.
|
31
|
+
attr_accessor :link_destination
|
29
32
|
|
30
33
|
# Attribute mapping from ruby-style variable name to JSON key.
|
31
34
|
def self.attribute_map
|
32
35
|
{
|
33
|
-
:'
|
34
|
-
:'
|
35
|
-
:'
|
36
|
-
:'
|
37
|
-
:'
|
38
|
-
:'create_order' => :'create_order'
|
36
|
+
:'body' => :'body',
|
37
|
+
:'header' => :'header',
|
38
|
+
:'severity' => :'severity',
|
39
|
+
:'link_text' => :'link_text',
|
40
|
+
:'link_destination' => :'link_destination'
|
39
41
|
}
|
40
42
|
end
|
41
43
|
|
@@ -47,24 +49,20 @@ module Patch
|
|
47
49
|
# Attribute type mapping.
|
48
50
|
def self.openapi_types
|
49
51
|
{
|
50
|
-
:'
|
51
|
-
:'
|
52
|
-
:'
|
53
|
-
:'
|
54
|
-
:'
|
55
|
-
:'create_order' => :'Boolean'
|
52
|
+
:'body' => :'String',
|
53
|
+
:'header' => :'String',
|
54
|
+
:'severity' => :'String',
|
55
|
+
:'link_text' => :'String',
|
56
|
+
:'link_destination' => :'String'
|
56
57
|
}
|
57
58
|
end
|
58
59
|
|
59
60
|
# List of attributes with nullable: true
|
60
61
|
def self.openapi_nullable
|
61
62
|
Set.new([
|
62
|
-
:'
|
63
|
-
:'
|
64
|
-
:'
|
65
|
-
:'average_daily_balance_eth_gwei',
|
66
|
-
:'project_id',
|
67
|
-
:'create_order'
|
63
|
+
:'body',
|
64
|
+
:'link_text',
|
65
|
+
:'link_destination'
|
68
66
|
])
|
69
67
|
end
|
70
68
|
|
@@ -73,8 +71,8 @@ module Patch
|
|
73
71
|
# Exposes Model.operation_id which delegates to ModelsApi.new.operation_id
|
74
72
|
# Eg. Order.create_order delegates to OrdersApi.new.create_order
|
75
73
|
def self.method_missing(message, *args, &block)
|
76
|
-
if Object.const_defined?('Patch::
|
77
|
-
Patch::
|
74
|
+
if Object.const_defined?('Patch::DisclaimersApi::OPERATIONS') && Patch::DisclaimersApi::OPERATIONS.include?(message)
|
75
|
+
Patch::DisclaimersApi.new.send(message, *args)
|
78
76
|
else
|
79
77
|
super
|
80
78
|
end
|
@@ -84,41 +82,35 @@ module Patch
|
|
84
82
|
# @param [Hash] attributes Model attributes in the form of hash
|
85
83
|
def initialize(attributes = {})
|
86
84
|
if (!attributes.is_a?(Hash))
|
87
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `Patch::
|
85
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Patch::Disclaimer` initialize method"
|
88
86
|
end
|
89
87
|
|
90
88
|
# check to see if the attribute exists and convert string to symbol for hash key
|
91
89
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
92
90
|
if (!self.class.attribute_map.key?(k.to_sym))
|
93
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Patch::
|
91
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Patch::Disclaimer`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
94
92
|
end
|
95
93
|
h[k.to_sym] = v
|
96
94
|
}
|
97
95
|
|
98
|
-
if attributes.key?(:'
|
99
|
-
self.
|
100
|
-
end
|
101
|
-
|
102
|
-
if attributes.key?(:'gas_used')
|
103
|
-
self.gas_used = attributes[:'gas_used']
|
96
|
+
if attributes.key?(:'body')
|
97
|
+
self.body = attributes[:'body']
|
104
98
|
end
|
105
99
|
|
106
|
-
if attributes.key?(:'
|
107
|
-
self.
|
100
|
+
if attributes.key?(:'header')
|
101
|
+
self.header = attributes[:'header']
|
108
102
|
end
|
109
103
|
|
110
|
-
if attributes.key?(:'
|
111
|
-
self.
|
104
|
+
if attributes.key?(:'severity')
|
105
|
+
self.severity = attributes[:'severity']
|
112
106
|
end
|
113
107
|
|
114
|
-
if attributes.key?(:'
|
115
|
-
self.
|
108
|
+
if attributes.key?(:'link_text')
|
109
|
+
self.link_text = attributes[:'link_text']
|
116
110
|
end
|
117
111
|
|
118
|
-
if attributes.key?(:'
|
119
|
-
self.
|
120
|
-
else
|
121
|
-
self.create_order = false
|
112
|
+
if attributes.key?(:'link_destination')
|
113
|
+
self.link_destination = attributes[:'link_destination']
|
122
114
|
end
|
123
115
|
end
|
124
116
|
|
@@ -126,12 +118,22 @@ module Patch
|
|
126
118
|
# @return Array for valid properties with the reasons
|
127
119
|
def list_invalid_properties
|
128
120
|
invalid_properties = Array.new
|
121
|
+
if @header.nil?
|
122
|
+
invalid_properties.push('invalid value for "header", header cannot be nil.')
|
123
|
+
end
|
124
|
+
|
125
|
+
if @severity.nil?
|
126
|
+
invalid_properties.push('invalid value for "severity", severity cannot be nil.')
|
127
|
+
end
|
128
|
+
|
129
129
|
invalid_properties
|
130
130
|
end
|
131
131
|
|
132
132
|
# Check to see if the all the properties in the model are valid
|
133
133
|
# @return true if the model is valid
|
134
134
|
def valid?
|
135
|
+
return false if @header.nil?
|
136
|
+
return false if @severity.nil?
|
135
137
|
true
|
136
138
|
end
|
137
139
|
|
@@ -140,12 +142,11 @@ module Patch
|
|
140
142
|
def ==(o)
|
141
143
|
return true if self.equal?(o)
|
142
144
|
self.class == o.class &&
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
create_order == o.create_order
|
145
|
+
body == o.body &&
|
146
|
+
header == o.header &&
|
147
|
+
severity == o.severity &&
|
148
|
+
link_text == o.link_text &&
|
149
|
+
link_destination == o.link_destination
|
149
150
|
end
|
150
151
|
|
151
152
|
# @see the `==` method
|
@@ -157,7 +158,7 @@ module Patch
|
|
157
158
|
# Calculates hash code according to all attributes.
|
158
159
|
# @return [Integer] Hash code
|
159
160
|
def hash
|
160
|
-
[
|
161
|
+
[body, header, severity, link_text, link_destination].hash
|
161
162
|
end
|
162
163
|
|
163
164
|
# Builds the object from hash
|
@@ -21,7 +21,7 @@ module Patch
|
|
21
21
|
# A boolean indicating if this estimate is a production or demo mode estimate.
|
22
22
|
attr_accessor :production
|
23
23
|
|
24
|
-
# The type of estimate. Available types are mass, flight, shipping,
|
24
|
+
# The type of estimate. Available types are mass, flight, shipping, and crypto.
|
25
25
|
attr_accessor :type
|
26
26
|
|
27
27
|
# The estimated mass in grams for this estimate.
|
@@ -18,6 +18,12 @@ module Patch
|
|
18
18
|
# The year in which the climate impacts of the project occurred, or will occur.
|
19
19
|
attr_accessor :vintage_year
|
20
20
|
|
21
|
+
# The starting year in which the climate impacts of the project occurred, or will occur.
|
22
|
+
attr_accessor :vintage_start_year
|
23
|
+
|
24
|
+
# The ending year in which the climate impacts of the project occurred, or will occur.
|
25
|
+
attr_accessor :vintage_end_year
|
26
|
+
|
21
27
|
# The amount available for this vintage year.
|
22
28
|
attr_accessor :amount_available
|
23
29
|
|
@@ -34,6 +40,8 @@ module Patch
|
|
34
40
|
def self.attribute_map
|
35
41
|
{
|
36
42
|
:'vintage_year' => :'vintage_year',
|
43
|
+
:'vintage_start_year' => :'vintage_start_year',
|
44
|
+
:'vintage_end_year' => :'vintage_end_year',
|
37
45
|
:'amount_available' => :'amount_available',
|
38
46
|
:'price' => :'price',
|
39
47
|
:'currency' => :'currency',
|
@@ -50,6 +58,8 @@ module Patch
|
|
50
58
|
def self.openapi_types
|
51
59
|
{
|
52
60
|
:'vintage_year' => :'Integer',
|
61
|
+
:'vintage_start_year' => :'Integer',
|
62
|
+
:'vintage_end_year' => :'Integer',
|
53
63
|
:'amount_available' => :'Integer',
|
54
64
|
:'price' => :'Integer',
|
55
65
|
:'currency' => :'String',
|
@@ -94,6 +104,14 @@ module Patch
|
|
94
104
|
self.vintage_year = attributes[:'vintage_year']
|
95
105
|
end
|
96
106
|
|
107
|
+
if attributes.key?(:'vintage_start_year')
|
108
|
+
self.vintage_start_year = attributes[:'vintage_start_year']
|
109
|
+
end
|
110
|
+
|
111
|
+
if attributes.key?(:'vintage_end_year')
|
112
|
+
self.vintage_end_year = attributes[:'vintage_end_year']
|
113
|
+
end
|
114
|
+
|
97
115
|
if attributes.key?(:'amount_available')
|
98
116
|
self.amount_available = attributes[:'amount_available']
|
99
117
|
end
|
@@ -119,6 +137,14 @@ module Patch
|
|
119
137
|
invalid_properties.push('invalid value for "vintage_year", vintage_year cannot be nil.')
|
120
138
|
end
|
121
139
|
|
140
|
+
if @vintage_start_year.nil?
|
141
|
+
invalid_properties.push('invalid value for "vintage_start_year", vintage_start_year cannot be nil.')
|
142
|
+
end
|
143
|
+
|
144
|
+
if @vintage_end_year.nil?
|
145
|
+
invalid_properties.push('invalid value for "vintage_end_year", vintage_end_year cannot be nil.')
|
146
|
+
end
|
147
|
+
|
122
148
|
if @amount_available.nil?
|
123
149
|
invalid_properties.push('invalid value for "amount_available", amount_available cannot be nil.')
|
124
150
|
end
|
@@ -142,6 +168,8 @@ module Patch
|
|
142
168
|
# @return true if the model is valid
|
143
169
|
def valid?
|
144
170
|
return false if @vintage_year.nil?
|
171
|
+
return false if @vintage_start_year.nil?
|
172
|
+
return false if @vintage_end_year.nil?
|
145
173
|
return false if @amount_available.nil?
|
146
174
|
return false if @price.nil?
|
147
175
|
return false if @currency.nil?
|
@@ -155,6 +183,8 @@ module Patch
|
|
155
183
|
return true if self.equal?(o)
|
156
184
|
self.class == o.class &&
|
157
185
|
vintage_year == o.vintage_year &&
|
186
|
+
vintage_start_year == o.vintage_start_year &&
|
187
|
+
vintage_end_year == o.vintage_end_year &&
|
158
188
|
amount_available == o.amount_available &&
|
159
189
|
price == o.price &&
|
160
190
|
currency == o.currency &&
|
@@ -170,7 +200,7 @@ module Patch
|
|
170
200
|
# Calculates hash code according to all attributes.
|
171
201
|
# @return [Integer] Hash code
|
172
202
|
def hash
|
173
|
-
[vintage_year, amount_available, price, currency, unit].hash
|
203
|
+
[vintage_year, vintage_start_year, vintage_end_year, amount_available, price, currency, unit].hash
|
174
204
|
end
|
175
205
|
|
176
206
|
# Builds the object from hash
|
@@ -42,7 +42,7 @@ module Patch
|
|
42
42
|
# The currency code for the `price` and `patch_fee`.
|
43
43
|
attr_accessor :currency
|
44
44
|
|
45
|
-
# The
|
45
|
+
# The URL of this order in the public registry. Use this URL to access the order's accompanying certificate.
|
46
46
|
attr_accessor :registry_url
|
47
47
|
|
48
48
|
# An optional JSON object containing metadata for this order.
|
@@ -230,8 +230,8 @@ module Patch
|
|
230
230
|
invalid_properties.push('invalid value for "amount", amount cannot be nil.')
|
231
231
|
end
|
232
232
|
|
233
|
-
if @amount >
|
234
|
-
invalid_properties.push('invalid value for "amount", must be smaller than or equal to
|
233
|
+
if @amount > 100000000000000
|
234
|
+
invalid_properties.push('invalid value for "amount", must be smaller than or equal to 100000000000000.')
|
235
235
|
end
|
236
236
|
|
237
237
|
if @amount < 0
|
@@ -270,7 +270,7 @@ module Patch
|
|
270
270
|
state_validator = EnumAttributeValidator.new('String', ["draft", "reserved", "placed", "processing", "complete", "cancelled"])
|
271
271
|
return false unless state_validator.valid?(@state)
|
272
272
|
return false if @amount.nil?
|
273
|
-
return false if @amount >
|
273
|
+
return false if @amount > 100000000000000
|
274
274
|
return false if @amount < 0
|
275
275
|
return false if @unit.nil?
|
276
276
|
return false if @price.nil?
|
@@ -297,8 +297,8 @@ module Patch
|
|
297
297
|
fail ArgumentError, 'amount cannot be nil'
|
298
298
|
end
|
299
299
|
|
300
|
-
if amount >
|
301
|
-
fail ArgumentError, 'invalid value for "amount", must be smaller than or equal to
|
300
|
+
if amount > 100000000000000
|
301
|
+
fail ArgumentError, 'invalid value for "amount", must be smaller than or equal to 100000000000000.'
|
302
302
|
end
|
303
303
|
|
304
304
|
if amount < 0
|
@@ -24,6 +24,12 @@ module Patch
|
|
24
24
|
# The year in which the climate impacts of the project occurred, or will occur.
|
25
25
|
attr_accessor :vintage_year
|
26
26
|
|
27
|
+
# The starting year in which the climate impacts of the project occurred, or will occur.
|
28
|
+
attr_accessor :vintage_start_year
|
29
|
+
|
30
|
+
# The ending year in which the climate impacts of the project occurred, or will occur.
|
31
|
+
attr_accessor :vintage_end_year
|
32
|
+
|
27
33
|
# The amount ordered for the given project and vintage year.
|
28
34
|
attr_accessor :amount
|
29
35
|
|
@@ -42,6 +48,8 @@ module Patch
|
|
42
48
|
:'id' => :'id',
|
43
49
|
:'project' => :'project',
|
44
50
|
:'vintage_year' => :'vintage_year',
|
51
|
+
:'vintage_start_year' => :'vintage_start_year',
|
52
|
+
:'vintage_end_year' => :'vintage_end_year',
|
45
53
|
:'amount' => :'amount',
|
46
54
|
:'unit' => :'unit',
|
47
55
|
:'price' => :'price',
|
@@ -60,6 +68,8 @@ module Patch
|
|
60
68
|
:'id' => :'String',
|
61
69
|
:'project' => :'OrderLineItemProject',
|
62
70
|
:'vintage_year' => :'Integer',
|
71
|
+
:'vintage_start_year' => :'Integer',
|
72
|
+
:'vintage_end_year' => :'Integer',
|
63
73
|
:'amount' => :'Integer',
|
64
74
|
:'unit' => :'String',
|
65
75
|
:'price' => :'Integer',
|
@@ -115,6 +125,14 @@ module Patch
|
|
115
125
|
self.vintage_year = attributes[:'vintage_year']
|
116
126
|
end
|
117
127
|
|
128
|
+
if attributes.key?(:'vintage_start_year')
|
129
|
+
self.vintage_start_year = attributes[:'vintage_start_year']
|
130
|
+
end
|
131
|
+
|
132
|
+
if attributes.key?(:'vintage_end_year')
|
133
|
+
self.vintage_end_year = attributes[:'vintage_end_year']
|
134
|
+
end
|
135
|
+
|
118
136
|
if attributes.key?(:'amount')
|
119
137
|
self.amount = attributes[:'amount']
|
120
138
|
end
|
@@ -144,6 +162,14 @@ module Patch
|
|
144
162
|
invalid_properties.push('invalid value for "vintage_year", vintage_year cannot be nil.')
|
145
163
|
end
|
146
164
|
|
165
|
+
if @vintage_start_year.nil?
|
166
|
+
invalid_properties.push('invalid value for "vintage_start_year", vintage_start_year cannot be nil.')
|
167
|
+
end
|
168
|
+
|
169
|
+
if @vintage_end_year.nil?
|
170
|
+
invalid_properties.push('invalid value for "vintage_end_year", vintage_end_year cannot be nil.')
|
171
|
+
end
|
172
|
+
|
147
173
|
if @amount.nil?
|
148
174
|
invalid_properties.push('invalid value for "amount", amount cannot be nil.')
|
149
175
|
end
|
@@ -168,6 +194,8 @@ module Patch
|
|
168
194
|
def valid?
|
169
195
|
return false if @project.nil?
|
170
196
|
return false if @vintage_year.nil?
|
197
|
+
return false if @vintage_start_year.nil?
|
198
|
+
return false if @vintage_end_year.nil?
|
171
199
|
return false if @amount.nil?
|
172
200
|
return false if @unit.nil?
|
173
201
|
return false if @price.nil?
|
@@ -183,6 +211,8 @@ module Patch
|
|
183
211
|
id == o.id &&
|
184
212
|
project == o.project &&
|
185
213
|
vintage_year == o.vintage_year &&
|
214
|
+
vintage_start_year == o.vintage_start_year &&
|
215
|
+
vintage_end_year == o.vintage_end_year &&
|
186
216
|
amount == o.amount &&
|
187
217
|
unit == o.unit &&
|
188
218
|
price == o.price &&
|
@@ -198,7 +228,7 @@ module Patch
|
|
198
228
|
# Calculates hash code according to all attributes.
|
199
229
|
# @return [Integer] Hash code
|
200
230
|
def hash
|
201
|
-
[id, project, vintage_year, amount, unit, price, currency].hash
|
231
|
+
[id, project, vintage_year, vintage_start_year, vintage_end_year, amount, unit, price, currency].hash
|
202
232
|
end
|
203
233
|
|
204
234
|
# Builds the object from hash
|