@@ -16,6 +16,8 @@ module Patch
16
16
class CreateOrderRequest
17
17
attr_accessor :mass_g
18
18
19
+ attr_accessor :total_price_cents_usd
20
+
19
21
attr_accessor :project_id
20
22
21
23
attr_accessor :metadata
@@ -24,6 +26,7 @@ class CreateOrderRequest
24
26
def self . attribute_map
25
27
{
26
28
:'mass_g' => :'mass_g' ,
29
+ :'total_price_cents_usd' => :'total_price_cents_usd' ,
27
30
:'project_id' => :'project_id' ,
28
31
:'metadata' => :'metadata'
29
32
}
@@ -33,6 +36,7 @@ def self.attribute_map
33
36
def self . openapi_types
34
37
{
35
38
:'mass_g' => :'Integer' ,
39
+ :'total_price_cents_usd' => :'Integer' ,
36
40
:'project_id' => :'String' ,
37
41
:'metadata' => :'Object'
38
42
}
@@ -68,6 +72,10 @@ def initialize(attributes = {})
68
72
self . mass_g = attributes [ :'mass_g' ]
69
73
end
70
74
75
+ if attributes . key? ( :'total_price_cents_usd' )
76
+ self . total_price_cents_usd = attributes [ :'total_price_cents_usd' ]
77
+ end
78
+
71
79
if attributes . key? ( :'project_id' )
72
80
self . project_id = attributes [ :'project_id' ]
73
81
end
@@ -81,54 +89,61 @@ def initialize(attributes = {})
81
89
# @return Array for valid properties with the reasons
82
90
def list_invalid_properties
83
91
invalid_properties = Array . new
84
- if @mass_g . nil?
85
- invalid_properties . push ( 'invalid value for "mass_g", mass_g cannot be nil.' )
86
- end
87
-
88
- if @mass_g > 2000000000
92
+ if !@mass_g . nil? && @mass_g > 2000000000
89
93
invalid_properties . push ( 'invalid value for "mass_g", must be smaller than or equal to 2000000000.' )
90
94
end
91
95
92
- if @mass_g < 1
96
+ if ! @mass_g . nil? && @mass_g < 1
93
97
invalid_properties . push ( 'invalid value for "mass_g", must be greater than or equal to 1.' )
94
98
end
95
99
100
+ if !@total_price_cents_usd . nil? && @total_price_cents_usd < 1
101
+ invalid_properties . push ( 'invalid value for "total_price_cents_usd", must be greater than or equal to 1.' )
102
+ end
103
+
96
104
invalid_properties
97
105
end
98
106
99
107
# Check to see if the all the properties in the model are valid
100
108
# @return true if the model is valid
101
109
def valid?
102
- return false if @mass_g . nil?
103
- return false if @mass_g > 2000000000
104
- return false if @mass_g < 1
110
+ return false if ! @mass_g . nil? && @mass_g > 2000000000
111
+ return false if ! @mass_g . nil? && @mass_g < 1
112
+ return false if ! @total_price_cents_usd . nil? && @total_price_cents_usd < 1
105
113
true
106
114
end
107
115
108
116
# Custom attribute writer method with validation
109
117
# @param [Object] mass_g Value to be assigned
110
118
def mass_g = ( mass_g )
111
- if mass_g . nil?
112
- fail ArgumentError , 'mass_g cannot be nil'
113
- end
114
-
115
- if mass_g > 2000000000
119
+ if !mass_g . nil? && mass_g > 2000000000
116
120
fail ArgumentError , 'invalid value for "mass_g", must be smaller than or equal to 2000000000.'
117
121
end
118
122
119
- if mass_g < 1
123
+ if ! mass_g . nil? && mass_g < 1
120
124
fail ArgumentError , 'invalid value for "mass_g", must be greater than or equal to 1.'
121
125
end
122
126
123
127
@mass_g = mass_g
124
128
end
125
129
130
+ # Custom attribute writer method with validation
131
+ # @param [Object] total_price_cents_usd Value to be assigned
132
+ def total_price_cents_usd = ( total_price_cents_usd )
133
+ if !total_price_cents_usd . nil? && total_price_cents_usd < 1
134
+ fail ArgumentError , 'invalid value for "total_price_cents_usd", must be greater than or equal to 1.'
135
+ end
136
+
137
+ @total_price_cents_usd = total_price_cents_usd
138
+ end
139
+
126
140
# Checks equality by comparing each attribute.
127
141
# @param [Object] Object to be compared
128
142
def ==( o )
129
143
return true if self . equal? ( o )
130
144
self . class == o . class &&
131
145
mass_g == o . mass_g &&
146
+ total_price_cents_usd == o . total_price_cents_usd &&
132
147
project_id == o . project_id &&
133
148
metadata == o . metadata
134
149
end
@@ -142,7 +157,7 @@ def eql?(o)
142
157
# Calculates hash code according to all attributes.
143
158
# @return [Integer] Hash code
144
159
def hash
145
- [ mass_g , project_id , metadata ] . hash
160
+ [ mass_g , total_price_cents_usd , project_id , metadata ] . hash
146
161
end
147
162
148
163
# Builds the object from hash
0 commit comments