@@ -17,6 +17,16 @@ module Patch
17
17
class CreateFlightEstimateRequest
18
18
attr_accessor :distance_m
19
19
20
+ attr_accessor :origin_airport
21
+
22
+ attr_accessor :destination_airport
23
+
24
+ attr_accessor :aircraft_code
25
+
26
+ attr_accessor :cabin_class
27
+
28
+ attr_accessor :passenger_count
29
+
20
30
attr_accessor :project_id
21
31
22
32
attr_accessor :create_order
@@ -25,6 +35,11 @@ class CreateFlightEstimateRequest
25
35
def self . attribute_map
26
36
{
27
37
:'distance_m' => :'distance_m' ,
38
+ :'origin_airport' => :'origin_airport' ,
39
+ :'destination_airport' => :'destination_airport' ,
40
+ :'aircraft_code' => :'aircraft_code' ,
41
+ :'cabin_class' => :'cabin_class' ,
42
+ :'passenger_count' => :'passenger_count' ,
28
43
:'project_id' => :'project_id' ,
29
44
:'create_order' => :'create_order'
30
45
}
@@ -39,6 +54,11 @@ def self.acceptable_attributes
39
54
def self . openapi_types
40
55
{
41
56
:'distance_m' => :'Integer' ,
57
+ :'origin_airport' => :'String' ,
58
+ :'destination_airport' => :'String' ,
59
+ :'aircraft_code' => :'String' ,
60
+ :'cabin_class' => :'String' ,
61
+ :'passenger_count' => :'Integer' ,
42
62
:'project_id' => :'String' ,
43
63
:'create_order' => :'Boolean'
44
64
}
@@ -47,6 +67,12 @@ def self.openapi_types
47
67
# List of attributes with nullable: true
48
68
def self . openapi_nullable
49
69
Set . new ( [
70
+ :'distance_m' ,
71
+ :'origin_airport' ,
72
+ :'destination_airport' ,
73
+ :'aircraft_code' ,
74
+ :'cabin_class' ,
75
+ :'passenger_count' ,
50
76
:'project_id' ,
51
77
:'create_order'
52
78
] )
@@ -83,6 +109,26 @@ def initialize(attributes = {})
83
109
self . distance_m = attributes [ :'distance_m' ]
84
110
end
85
111
112
+ if attributes . key? ( :'origin_airport' )
113
+ self . origin_airport = attributes [ :'origin_airport' ]
114
+ end
115
+
116
+ if attributes . key? ( :'destination_airport' )
117
+ self . destination_airport = attributes [ :'destination_airport' ]
118
+ end
119
+
120
+ if attributes . key? ( :'aircraft_code' )
121
+ self . aircraft_code = attributes [ :'aircraft_code' ]
122
+ end
123
+
124
+ if attributes . key? ( :'cabin_class' )
125
+ self . cabin_class = attributes [ :'cabin_class' ]
126
+ end
127
+
128
+ if attributes . key? ( :'passenger_count' )
129
+ self . passenger_count = attributes [ :'passenger_count' ]
130
+ end
131
+
86
132
if attributes . key? ( :'project_id' )
87
133
self . project_id = attributes [ :'project_id' ]
88
134
end
@@ -96,15 +142,11 @@ def initialize(attributes = {})
96
142
# @return Array for valid properties with the reasons
97
143
def list_invalid_properties
98
144
invalid_properties = Array . new
99
- if @distance_m . nil?
100
- invalid_properties . push ( 'invalid value for "distance_m", distance_m cannot be nil.' )
101
- end
102
-
103
- if @distance_m > 400000000
145
+ if !@distance_m . nil? && @distance_m > 400000000
104
146
invalid_properties . push ( 'invalid value for "distance_m", must be smaller than or equal to 400000000.' )
105
147
end
106
148
107
- if @distance_m < 0
149
+ if ! @distance_m . nil? && @distance_m < 0
108
150
invalid_properties . push ( 'invalid value for "distance_m", must be greater than or equal to 0.' )
109
151
end
110
152
@@ -114,24 +156,19 @@ def list_invalid_properties
114
156
# Check to see if the all the properties in the model are valid
115
157
# @return true if the model is valid
116
158
def valid?
117
- return false if @distance_m . nil?
118
- return false if @distance_m > 400000000
119
- return false if @distance_m < 0
159
+ return false if !@distance_m . nil? && @distance_m > 400000000
160
+ return false if !@distance_m . nil? && @distance_m < 0
120
161
true
121
162
end
122
163
123
164
# Custom attribute writer method with validation
124
165
# @param [Object] distance_m Value to be assigned
125
166
def distance_m = ( distance_m )
126
- if distance_m . nil?
127
- fail ArgumentError , 'distance_m cannot be nil'
128
- end
129
-
130
- if distance_m > 400000000
167
+ if !distance_m . nil? && distance_m > 400000000
131
168
fail ArgumentError , 'invalid value for "distance_m", must be smaller than or equal to 400000000.'
132
169
end
133
170
134
- if distance_m < 0
171
+ if ! distance_m . nil? && distance_m < 0
135
172
fail ArgumentError , 'invalid value for "distance_m", must be greater than or equal to 0.'
136
173
end
137
174
@@ -144,6 +181,11 @@ def ==(o)
144
181
return true if self . equal? ( o )
145
182
self . class == o . class &&
146
183
distance_m == o . distance_m &&
184
+ origin_airport == o . origin_airport &&
185
+ destination_airport == o . destination_airport &&
186
+ aircraft_code == o . aircraft_code &&
187
+ cabin_class == o . cabin_class &&
188
+ passenger_count == o . passenger_count &&
147
189
project_id == o . project_id &&
148
190
create_order == o . create_order
149
191
end
@@ -157,7 +199,7 @@ def eql?(o)
157
199
# Calculates hash code according to all attributes.
158
200
# @return [Integer] Hash code
159
201
def hash
160
- [ distance_m , project_id , create_order ] . hash
202
+ [ distance_m , origin_airport , destination_airport , aircraft_code , cabin_class , passenger_count , project_id , create_order ] . hash
161
203
end
162
204
163
205
# Builds the object from hash
0 commit comments