| 1 | // |
| 2 | // AUTO-GENERATED FILE, DO NOT MODIFY! |
| 3 | // |
| 4 | |
| 5 | // ignore_for_file: unused_element |
| 6 | import 'package:built_collection/built_collection.dart'; |
| 7 | import 'package:built_value/built_value.dart'; |
| 8 | import 'package:built_value/serializer.dart'; |
| 9 | |
| 10 | part 'create_flight_booking_dto.g.dart'; |
| 11 | |
| 12 | /// CreateFlightBookingDTO |
| 13 | /// |
| 14 | /// Properties: |
| 15 | /// * [flightId] - Flight ID to associate the booking with |
| 16 | /// * [bookingCode] - Booking code/confirmation code (e.g., \"ABC123\") |
| 17 | /// * [seatNumber] - Seat number (e.g., \"12A\", \"1F\") |
| 18 | /// * [seatType] - Type of seat position |
| 19 | /// * [seatingClass] - Class of service |
| 20 | /// * [reason] - Reason for the flight |
| 21 | /// * [notes] - Additional notes about the booking |
| 22 | @BuiltValue() |
| 23 | abstract class CreateFlightBookingDTO implements |
| 24 | /// Flight ID to associate the booking with |
| 25 | @BuiltValueField(wireName: r'flightId') |
| 26 | String get flightId; |
| 27 | |
| 28 | /// Booking code/confirmation code (e.g., \"ABC123\") |
| 29 | @BuiltValueField(wireName: r'bookingCode') |
| 30 | String? get bookingCode; |
| 31 | |
| 32 | /// Seat number (e.g., \"12A\", \"1F\") |
| 33 | @BuiltValueField(wireName: r'seatNumber') |
| 34 | String? get seatNumber; |
| 35 | |
| 36 | /// Type of seat position |
| 37 | @BuiltValueField(wireName: r'seatType') |
| 38 | CreateFlightBookingDTOSeatTypeEnum? get seatType; |
| 39 | // enum seatTypeEnum { window, middle, aisle, jumpseat, captain, pilot, copilot, flight_engineer, flight_attendant, observer, other, }; |
| 40 | |
| 41 | /// Class of service |
| 42 | @BuiltValueField(wireName: r'seatingClass') |
| 43 | CreateFlightBookingDTOSeatingClassEnum? get seatingClass; |
| 44 | // enum seatingClassEnum { economy, premium_economy, business, first, private, other, }; |
| 45 | |
| 46 | /// Reason for the flight |
| 47 | @BuiltValueField(wireName: r'reason') |
| 48 | CreateFlightBookingDTOReasonEnum? get reason; |
| 49 | // enum reasonEnum { personal, business, crew, training, repositioning, other, }; |
| 50 | |
| 51 | /// Additional notes about the booking |
| 52 | @BuiltValueField(wireName: r'notes') |
| 53 | String? get notes; |
| 54 | |
| 55 | CreateFlightBookingDTO._(); |
| 56 | |
| 57 | factory CreateFlightBookingDTO([void |
| 58 | |
| 59 | @BuiltValueHook(initializeBuilder: true) |
| 60 | static void _defaults |
| 61 | ..reason = CreateFlightBookingDTOReasonEnum.personal |
| 62 | |
| 63 | @BuiltValueSerializer(custom: true) |
| 64 | static Serializer<CreateFlightBookingDTO |
| 65 | } |
| 66 | |
| 67 | class _$CreateFlightBookingDTOSerializer implements PrimitiveSerializer |
| 68 | @override |
| 69 | final Iterable<Type |
| 70 | |
| 71 | @override |
| 72 | final String wireName = |
| 73 | |
| 74 | Iterable<Object?> _serializeProperties |
| 75 | Serializers serializers, |
| 76 | CreateFlightBookingDTO object, { |
| 77 | FullType specifiedType = FullType. |
| 78 | }) sync* { |
| 79 | yield r'flightId'; |
| 80 | yield serializers.serialize( |
| 81 | object.flightId, |
| 82 | specifiedType: const FullType( |
| 83 | ); |
| 84 | if (object.bookingCode != null) { |
| 85 | yield r'bookingCode'; |
| 86 | yield serializers.serialize( |
| 87 | object.bookingCode, |
| 88 | specifiedType: const FullType( |
| 89 | ); |
| 90 | } |
| 91 | if (object.seatNumber != null) { |
| 92 | yield r'seatNumber'; |
| 93 | yield serializers.serialize( |
| 94 | object.seatNumber, |
| 95 | specifiedType: const FullType( |
| 96 | ); |
| 97 | } |
| 98 | if (object.seatType != null) { |
| 99 | yield r'seatType'; |
| 100 | yield serializers.serialize( |
| 101 | object.seatType, |
| 102 | specifiedType: const FullType( |
| 103 | ); |
| 104 | } |
| 105 | if (object.seatingClass != null) { |
| 106 | yield r'seatingClass'; |
| 107 | yield serializers.serialize( |
| 108 | object.seatingClass, |
| 109 | specifiedType: const FullType( |
| 110 | ); |
| 111 | } |
| 112 | if (object.reason != null) { |
| 113 | yield r'reason'; |
| 114 | yield serializers.serialize( |
| 115 | object.reason, |
| 116 | specifiedType: const FullType( |
| 117 | ); |
| 118 | } |
| 119 | if (object.notes != null) { |
| 120 | yield r'notes'; |
| 121 | yield serializers.serialize( |
| 122 | object.notes, |
| 123 | specifiedType: const FullType( |
| 124 | ); |
| 125 | } |
| 126 | } |
| 127 | |
| 128 | @override |
| 129 | Object serialize( |
| 130 | Serializers serializers, |
| 131 | CreateFlightBookingDTO object, { |
| 132 | FullType specifiedType = FullType. |
| 133 | }) { |
| 134 | return _serializeProperties(serializers, object |
| 135 | } |
| 136 | |
| 137 | void _deserializeProperties( |
| 138 | Serializers serializers, |
| 139 | Object serialized, { |
| 140 | FullType specifiedType = FullType. |
| 141 | required List<Object |
| 142 | required CreateFlightBookingDTOBuilder result, |
| 143 | required List<Object |
| 144 | }) { |
| 145 | for (var i = 0 |
| 146 | final key = serializedList[i] as String |
| 147 | final value = serializedList[i + 1 |
| 148 | switch (key) { |
| 149 | case r'flightId': |
| 150 | final valueDes = serializers.deserialize |
| 151 | value, |
| 152 | specifiedType: const FullType( |
| 153 | ) as String; |
| 154 | result.flightId = valueDes; |
| 155 | break; |
| 156 | case r'bookingCode': |
| 157 | final valueDes = serializers.deserialize |
| 158 | value, |
| 159 | specifiedType: const FullType( |
| 160 | ) as String; |
| 161 | result.bookingCode = valueDes; |
| 162 | break; |
| 163 | case r'seatNumber': |
| 164 | final valueDes = serializers.deserialize |
| 165 | value, |
| 166 | specifiedType: const FullType( |
| 167 | ) as String; |
| 168 | result.seatNumber = valueDes; |
| 169 | break; |
| 170 | case r'seatType': |
| 171 | final valueDes = serializers.deserialize |
| 172 | value, |
| 173 | specifiedType: const FullType( |
| 174 | ) as CreateFlightBookingDTOSeatTypeEnum; |
| 175 | result.seatType = valueDes; |
| 176 | break; |
| 177 | case r'seatingClass': |
| 178 | final valueDes = serializers.deserialize |
| 179 | value, |
| 180 | specifiedType: const FullType( |
| 181 | ) as CreateFlightBookingDTOSeatingClassEnum; |
| 182 | result.seatingClass = valueDes; |
| 183 | break; |
| 184 | case r'reason': |
| 185 | final valueDes = serializers.deserialize |
| 186 | value, |
| 187 | specifiedType: const FullType( |
| 188 | ) as CreateFlightBookingDTOReasonEnum; |
| 189 | result.reason = valueDes; |
| 190 | break; |
| 191 | case r'notes': |
| 192 | final valueDes = serializers.deserialize |
| 193 | value, |
| 194 | specifiedType: const FullType( |
| 195 | ) as String; |
| 196 | result.notes = valueDes; |
| 197 | break; |
| 198 | default: |
| 199 | unhandled.add(key); |
| 200 | unhandled.add(value); |
| 201 | break; |
| 202 | } |
| 203 | } |
| 204 | } |
| 205 | |
| 206 | @override |
| 207 | CreateFlightBookingDTO deserialize( |
| 208 | Serializers serializers, |
| 209 | Object serialized, { |
| 210 | FullType specifiedType = FullType. |
| 211 | }) { |
| 212 | final result = CreateFlightBookingDTOBuilder() |
| 213 | final serializedList = (serialized as Iterable |
| 214 | final unhandled = <Object |
| 215 | _deserializeProperties( |
| 216 | serializers, |
| 217 | serialized, |
| 218 | specifiedType: specifiedType, |
| 219 | serializedList: serializedList, |
| 220 | unhandled: unhandled, |
| 221 | result: result, |
| 222 | ); |
| 223 | return result.build(); |
| 224 | } |
| 225 | } |
| 226 | |
| 227 | class CreateFlightBookingDTOSeatTypeEnum extends EnumClass |
| 228 | |
| 229 | /// Type of seat position |
| 230 | @BuiltValueEnumConst(wireName: r'window') |
| 231 | static const CreateFlightBookingDTOSeatTypeEnum |
| 232 | /// Type of seat position |
| 233 | @BuiltValueEnumConst(wireName: r'middle') |
| 234 | static const CreateFlightBookingDTOSeatTypeEnum |
| 235 | /// Type of seat position |
| 236 | @BuiltValueEnumConst(wireName: r'aisle') |
| 237 | static const CreateFlightBookingDTOSeatTypeEnum |
| 238 | /// Type of seat position |
| 239 | @BuiltValueEnumConst(wireName: r'jumpseat') |
| 240 | static const CreateFlightBookingDTOSeatTypeEnum |
| 241 | /// Type of seat position |
| 242 | @BuiltValueEnumConst(wireName: r'captain') |
| 243 | static const CreateFlightBookingDTOSeatTypeEnum |
| 244 | /// Type of seat position |
| 245 | @BuiltValueEnumConst(wireName: r'pilot') |
| 246 | static const CreateFlightBookingDTOSeatTypeEnum |
| 247 | /// Type of seat position |
| 248 | @BuiltValueEnumConst(wireName: r'copilot') |
| 249 | static const CreateFlightBookingDTOSeatTypeEnum |
| 250 | /// Type of seat position |
| 251 | @BuiltValueEnumConst(wireName: r'flight_engineer') |
| 252 | static const CreateFlightBookingDTOSeatTypeEnum |
| 253 | /// Type of seat position |
| 254 | @BuiltValueEnumConst(wireName: r'flight_attendant') |
| 255 | static const CreateFlightBookingDTOSeatTypeEnum |
| 256 | /// Type of seat position |
| 257 | @BuiltValueEnumConst(wireName: r'observer') |
| 258 | static const CreateFlightBookingDTOSeatTypeEnum |
| 259 | /// Type of seat position |
| 260 | @BuiltValueEnumConst(wireName: r'other') |
| 261 | static const CreateFlightBookingDTOSeatTypeEnum |
| 262 | |
| 263 | static Serializer<CreateFlightBookingDTOSeatTypeEnum |
| 264 | |
| 265 | const CreateFlightBookingDTOSeatTypeEnum._(String |
| 266 | |
| 267 | static BuiltSet<CreateFlightBookingDTOSeatTypeEnum |
| 268 | static CreateFlightBookingDTOSeatTypeEnum valueOf |
| 269 | } |
| 270 | |
| 271 | class CreateFlightBookingDTOSeatingClassEnum extends EnumClass |
| 272 | |
| 273 | /// Class of service |
| 274 | @BuiltValueEnumConst(wireName: r'economy') |
| 275 | static const CreateFlightBookingDTOSeatingClassEnum |
| 276 | /// Class of service |
| 277 | @BuiltValueEnumConst(wireName: r'premium_economy') |
| 278 | static const CreateFlightBookingDTOSeatingClassEnum |
| 279 | /// Class of service |
| 280 | @BuiltValueEnumConst(wireName: r'business') |
| 281 | static const CreateFlightBookingDTOSeatingClassEnum |
| 282 | /// Class of service |
| 283 | @BuiltValueEnumConst(wireName: r'first') |
| 284 | static const CreateFlightBookingDTOSeatingClassEnum |
| 285 | /// Class of service |
| 286 | @BuiltValueEnumConst(wireName: r'private') |
| 287 | static const CreateFlightBookingDTOSeatingClassEnum |
| 288 | /// Class of service |
| 289 | @BuiltValueEnumConst(wireName: r'other') |
| 290 | static const CreateFlightBookingDTOSeatingClassEnum |
| 291 | |
| 292 | static Serializer<CreateFlightBookingDTOSeatingClassEnum |
| 293 | |
| 294 | const CreateFlightBookingDTOSeatingClassEnum._(String |
| 295 | |
| 296 | static BuiltSet<CreateFlightBookingDTOSeatingClassEnum |
| 297 | static CreateFlightBookingDTOSeatingClassEnum valueOf |
| 298 | } |
| 299 | |
| 300 | class CreateFlightBookingDTOReasonEnum extends EnumClass |
| 301 | |
| 302 | /// Reason for the flight |
| 303 | @BuiltValueEnumConst(wireName: r'personal') |
| 304 | static const CreateFlightBookingDTOReasonEnum |
| 305 | /// Reason for the flight |
| 306 | @BuiltValueEnumConst(wireName: r'business') |
| 307 | static const CreateFlightBookingDTOReasonEnum |
| 308 | /// Reason for the flight |
| 309 | @BuiltValueEnumConst(wireName: r'crew') |
| 310 | static const CreateFlightBookingDTOReasonEnum |
| 311 | /// Reason for the flight |
| 312 | @BuiltValueEnumConst(wireName: r'training') |
| 313 | static const CreateFlightBookingDTOReasonEnum |
| 314 | /// Reason for the flight |
| 315 | @BuiltValueEnumConst(wireName: r'repositioning') |
| 316 | static const CreateFlightBookingDTOReasonEnum |
| 317 | /// Reason for the flight |
| 318 | @BuiltValueEnumConst(wireName: r'other') |
| 319 | static const CreateFlightBookingDTOReasonEnum |
| 320 | |
| 321 | static Serializer<CreateFlightBookingDTOReasonEnum |
| 322 | |
| 323 | const CreateFlightBookingDTOReasonEnum._(String |
| 324 | |
| 325 | static BuiltSet<CreateFlightBookingDTOReasonEnum |
| 326 | static CreateFlightBookingDTOReasonEnum valueOf |
| 327 | } |
| 328 | |