| 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/json_object.dart'; |
| 8 | import 'package:built_value/built_value.dart'; |
| 9 | import 'package:built_value/serializer.dart'; |
| 10 | |
| 11 | part 'flight_booking_entity.g.dart'; |
| 12 | |
| 13 | /// FlightBookingEntity |
| 14 | /// |
| 15 | /// Properties: |
| 16 | /// * [id] - Unique booking identifier |
| 17 | /// * [bookingCode] - Booking code/confirmation code (e.g., \"ABC123\") |
| 18 | /// * [seatNumber] - Seat number (e.g., \"12A\", \"1F\") |
| 19 | /// * [seatType] - Type of seat position |
| 20 | /// * [seatingClass] - Class of service |
| 21 | /// * [reason] - Reason for the flight |
| 22 | /// * [notes] - Additional notes about the booking |
| 23 | /// * [flightId] - Flight ID associated with this booking |
| 24 | /// * [userId] - User ID who owns this booking |
| 25 | /// * [createdAt] - Date and time when the booking was created |
| 26 | /// * [updatedAt] - Date and time when the booking was last updated |
| 27 | @BuiltValue() |
| 28 | abstract class FlightBookingEntity implements |
| 29 | /// Unique booking identifier |
| 30 | @BuiltValueField(wireName: r'id') |
| 31 | String get id; |
| 32 | |
| 33 | /// Booking code/confirmation code (e.g., \"ABC123\") |
| 34 | @BuiltValueField(wireName: r'bookingCode') |
| 35 | JsonObject? get bookingCode; |
| 36 | |
| 37 | /// Seat number (e.g., \"12A\", \"1F\") |
| 38 | @BuiltValueField(wireName: r'seatNumber') |
| 39 | JsonObject? get seatNumber; |
| 40 | |
| 41 | /// Type of seat position |
| 42 | @BuiltValueField(wireName: r'seatType') |
| 43 | FlightBookingEntitySeatTypeEnum? get seatType; |
| 44 | // enum seatTypeEnum { window, middle, aisle, jumpseat, captain, pilot, copilot, flight_engineer, flight_attendant, observer, other, }; |
| 45 | |
| 46 | /// Class of service |
| 47 | @BuiltValueField(wireName: r'seatingClass') |
| 48 | FlightBookingEntitySeatingClassEnum? get seatingClass; |
| 49 | // enum seatingClassEnum { economy, premium_economy, business, first, private, other, }; |
| 50 | |
| 51 | /// Reason for the flight |
| 52 | @BuiltValueField(wireName: r'reason') |
| 53 | FlightBookingEntityReasonEnum? get reason; |
| 54 | // enum reasonEnum { personal, business, crew, training, repositioning, other, }; |
| 55 | |
| 56 | /// Additional notes about the booking |
| 57 | @BuiltValueField(wireName: r'notes') |
| 58 | JsonObject? get notes; |
| 59 | |
| 60 | /// Flight ID associated with this booking |
| 61 | @BuiltValueField(wireName: r'flightId') |
| 62 | String get flightId; |
| 63 | |
| 64 | /// User ID who owns this booking |
| 65 | @BuiltValueField(wireName: r'userId') |
| 66 | String get userId; |
| 67 | |
| 68 | /// Date and time when the booking was created |
| 69 | @BuiltValueField(wireName: r'createdAt') |
| 70 | DateTime get createdAt; |
| 71 | |
| 72 | /// Date and time when the booking was last updated |
| 73 | @BuiltValueField(wireName: r'updatedAt') |
| 74 | DateTime get updatedAt; |
| 75 | |
| 76 | FlightBookingEntity._(); |
| 77 | |
| 78 | factory FlightBookingEntity([void |
| 79 | |
| 80 | @BuiltValueHook(initializeBuilder: true) |
| 81 | static void _defaults |
| 82 | |
| 83 | @BuiltValueSerializer(custom: true) |
| 84 | static Serializer<FlightBookingEntity |
| 85 | } |
| 86 | |
| 87 | class _$FlightBookingEntitySerializer implements PrimitiveSerializer |
| 88 | @override |
| 89 | final Iterable<Type |
| 90 | |
| 91 | @override |
| 92 | final String wireName = |
| 93 | |
| 94 | Iterable<Object?> _serializeProperties |
| 95 | Serializers serializers, |
| 96 | FlightBookingEntity object, { |
| 97 | FullType specifiedType = FullType. |
| 98 | }) sync* { |
| 99 | yield r'id'; |
| 100 | yield serializers.serialize( |
| 101 | object.id, |
| 102 | specifiedType: const FullType( |
| 103 | ); |
| 104 | if (object.bookingCode != null) { |
| 105 | yield r'bookingCode'; |
| 106 | yield serializers.serialize( |
| 107 | object.bookingCode, |
| 108 | specifiedType: const FullType( |
| 109 | ); |
| 110 | } |
| 111 | if (object.seatNumber != null) { |
| 112 | yield r'seatNumber'; |
| 113 | yield serializers.serialize( |
| 114 | object.seatNumber, |
| 115 | specifiedType: const FullType( |
| 116 | ); |
| 117 | } |
| 118 | if (object.seatType != null) { |
| 119 | yield r'seatType'; |
| 120 | yield serializers.serialize( |
| 121 | object.seatType, |
| 122 | specifiedType: const FullType( |
| 123 | ); |
| 124 | } |
| 125 | if (object.seatingClass != null) { |
| 126 | yield r'seatingClass'; |
| 127 | yield serializers.serialize( |
| 128 | object.seatingClass, |
| 129 | specifiedType: const FullType( |
| 130 | ); |
| 131 | } |
| 132 | if (object.reason != null) { |
| 133 | yield r'reason'; |
| 134 | yield serializers.serialize( |
| 135 | object.reason, |
| 136 | specifiedType: const FullType( |
| 137 | ); |
| 138 | } |
| 139 | if (object.notes != null) { |
| 140 | yield r'notes'; |
| 141 | yield serializers.serialize( |
| 142 | object.notes, |
| 143 | specifiedType: const FullType( |
| 144 | ); |
| 145 | } |
| 146 | yield r'flightId'; |
| 147 | yield serializers.serialize( |
| 148 | object.flightId, |
| 149 | specifiedType: const FullType( |
| 150 | ); |
| 151 | yield r'userId'; |
| 152 | yield serializers.serialize( |
| 153 | object.userId, |
| 154 | specifiedType: const FullType( |
| 155 | ); |
| 156 | yield r'createdAt'; |
| 157 | yield serializers.serialize( |
| 158 | object.createdAt, |
| 159 | specifiedType: const FullType( |
| 160 | ); |
| 161 | yield r'updatedAt'; |
| 162 | yield serializers.serialize( |
| 163 | object.updatedAt, |
| 164 | specifiedType: const FullType( |
| 165 | ); |
| 166 | } |
| 167 | |
| 168 | @override |
| 169 | Object serialize( |
| 170 | Serializers serializers, |
| 171 | FlightBookingEntity object, { |
| 172 | FullType specifiedType = FullType. |
| 173 | }) { |
| 174 | return _serializeProperties(serializers, object |
| 175 | } |
| 176 | |
| 177 | void _deserializeProperties( |
| 178 | Serializers serializers, |
| 179 | Object serialized, { |
| 180 | FullType specifiedType = FullType. |
| 181 | required List<Object |
| 182 | required FlightBookingEntityBuilder result, |
| 183 | required List<Object |
| 184 | }) { |
| 185 | for (var i = 0 |
| 186 | final key = serializedList[i] as String |
| 187 | final value = serializedList[i + 1 |
| 188 | switch (key) { |
| 189 | case r'id': |
| 190 | final valueDes = serializers.deserialize |
| 191 | value, |
| 192 | specifiedType: const FullType( |
| 193 | ) as String; |
| 194 | result.id = valueDes; |
| 195 | break; |
| 196 | case r'bookingCode': |
| 197 | final valueDes = serializers.deserialize |
| 198 | value, |
| 199 | specifiedType: const FullType( |
| 200 | ) as JsonObject; |
| 201 | result.bookingCode = valueDes; |
| 202 | break; |
| 203 | case r'seatNumber': |
| 204 | final valueDes = serializers.deserialize |
| 205 | value, |
| 206 | specifiedType: const FullType( |
| 207 | ) as JsonObject; |
| 208 | result.seatNumber = valueDes; |
| 209 | break; |
| 210 | case r'seatType': |
| 211 | final valueDes = serializers.deserialize |
| 212 | value, |
| 213 | specifiedType: const FullType( |
| 214 | ) as FlightBookingEntitySeatTypeEnum; |
| 215 | result.seatType = valueDes; |
| 216 | break; |
| 217 | case r'seatingClass': |
| 218 | final valueDes = serializers.deserialize |
| 219 | value, |
| 220 | specifiedType: const FullType( |
| 221 | ) as FlightBookingEntitySeatingClassEnum; |
| 222 | result.seatingClass = valueDes; |
| 223 | break; |
| 224 | case r'reason': |
| 225 | final valueDes = serializers.deserialize |
| 226 | value, |
| 227 | specifiedType: const FullType( |
| 228 | ) as FlightBookingEntityReasonEnum; |
| 229 | result.reason = valueDes; |
| 230 | break; |
| 231 | case r'notes': |
| 232 | final valueDes = serializers.deserialize |
| 233 | value, |
| 234 | specifiedType: const FullType( |
| 235 | ) as JsonObject; |
| 236 | result.notes = valueDes; |
| 237 | break; |
| 238 | case r'flightId': |
| 239 | final valueDes = serializers.deserialize |
| 240 | value, |
| 241 | specifiedType: const FullType( |
| 242 | ) as String; |
| 243 | result.flightId = valueDes; |
| 244 | break; |
| 245 | case r'userId': |
| 246 | final valueDes = serializers.deserialize |
| 247 | value, |
| 248 | specifiedType: const FullType( |
| 249 | ) as String; |
| 250 | result.userId = valueDes; |
| 251 | break; |
| 252 | case r'createdAt': |
| 253 | final valueDes = serializers.deserialize |
| 254 | value, |
| 255 | specifiedType: const FullType( |
| 256 | ) as DateTime; |
| 257 | result.createdAt = valueDes; |
| 258 | break; |
| 259 | case r'updatedAt': |
| 260 | final valueDes = serializers.deserialize |
| 261 | value, |
| 262 | specifiedType: const FullType( |
| 263 | ) as DateTime; |
| 264 | result.updatedAt = valueDes; |
| 265 | break; |
| 266 | default: |
| 267 | unhandled.add(key); |
| 268 | unhandled.add(value); |
| 269 | break; |
| 270 | } |
| 271 | } |
| 272 | } |
| 273 | |
| 274 | @override |
| 275 | FlightBookingEntity deserialize( |
| 276 | Serializers serializers, |
| 277 | Object serialized, { |
| 278 | FullType specifiedType = FullType. |
| 279 | }) { |
| 280 | final result = FlightBookingEntityBuilder() |
| 281 | final serializedList = (serialized as Iterable |
| 282 | final unhandled = <Object |
| 283 | _deserializeProperties( |
| 284 | serializers, |
| 285 | serialized, |
| 286 | specifiedType: specifiedType, |
| 287 | serializedList: serializedList, |
| 288 | unhandled: unhandled, |
| 289 | result: result, |
| 290 | ); |
| 291 | return result.build(); |
| 292 | } |
| 293 | } |
| 294 | |
| 295 | class FlightBookingEntitySeatTypeEnum extends EnumClass |
| 296 | |
| 297 | /// Type of seat position |
| 298 | @BuiltValueEnumConst(wireName: r'window') |
| 299 | static const FlightBookingEntitySeatTypeEnum |
| 300 | /// Type of seat position |
| 301 | @BuiltValueEnumConst(wireName: r'middle') |
| 302 | static const FlightBookingEntitySeatTypeEnum |
| 303 | /// Type of seat position |
| 304 | @BuiltValueEnumConst(wireName: r'aisle') |
| 305 | static const FlightBookingEntitySeatTypeEnum |
| 306 | /// Type of seat position |
| 307 | @BuiltValueEnumConst(wireName: r'jumpseat') |
| 308 | static const FlightBookingEntitySeatTypeEnum |
| 309 | /// Type of seat position |
| 310 | @BuiltValueEnumConst(wireName: r'captain') |
| 311 | static const FlightBookingEntitySeatTypeEnum |
| 312 | /// Type of seat position |
| 313 | @BuiltValueEnumConst(wireName: r'pilot') |
| 314 | static const FlightBookingEntitySeatTypeEnum |
| 315 | /// Type of seat position |
| 316 | @BuiltValueEnumConst(wireName: r'copilot') |
| 317 | static const FlightBookingEntitySeatTypeEnum |
| 318 | /// Type of seat position |
| 319 | @BuiltValueEnumConst(wireName: r'flight_engineer') |
| 320 | static const FlightBookingEntitySeatTypeEnum |
| 321 | /// Type of seat position |
| 322 | @BuiltValueEnumConst(wireName: r'flight_attendant') |
| 323 | static const FlightBookingEntitySeatTypeEnum |
| 324 | /// Type of seat position |
| 325 | @BuiltValueEnumConst(wireName: r'observer') |
| 326 | static const FlightBookingEntitySeatTypeEnum |
| 327 | /// Type of seat position |
| 328 | @BuiltValueEnumConst(wireName: r'other') |
| 329 | static const FlightBookingEntitySeatTypeEnum |
| 330 | |
| 331 | static Serializer<FlightBookingEntitySeatTypeEnum |
| 332 | |
| 333 | const FlightBookingEntitySeatTypeEnum._(String |
| 334 | |
| 335 | static BuiltSet<FlightBookingEntitySeatTypeEnum |
| 336 | static FlightBookingEntitySeatTypeEnum valueOf |
| 337 | } |
| 338 | |
| 339 | class FlightBookingEntitySeatingClassEnum extends EnumClass |
| 340 | |
| 341 | /// Class of service |
| 342 | @BuiltValueEnumConst(wireName: r'economy') |
| 343 | static const FlightBookingEntitySeatingClassEnum |
| 344 | /// Class of service |
| 345 | @BuiltValueEnumConst(wireName: r'premium_economy') |
| 346 | static const FlightBookingEntitySeatingClassEnum |
| 347 | /// Class of service |
| 348 | @BuiltValueEnumConst(wireName: r'business') |
| 349 | static const FlightBookingEntitySeatingClassEnum |
| 350 | /// Class of service |
| 351 | @BuiltValueEnumConst(wireName: r'first') |
| 352 | static const FlightBookingEntitySeatingClassEnum |
| 353 | /// Class of service |
| 354 | @BuiltValueEnumConst(wireName: r'private') |
| 355 | static const FlightBookingEntitySeatingClassEnum |
| 356 | /// Class of service |
| 357 | @BuiltValueEnumConst(wireName: r'other') |
| 358 | static const FlightBookingEntitySeatingClassEnum |
| 359 | |
| 360 | static Serializer<FlightBookingEntitySeatingClassEnum |
| 361 | |
| 362 | const FlightBookingEntitySeatingClassEnum._(String |
| 363 | |
| 364 | static BuiltSet<FlightBookingEntitySeatingClassEnum |
| 365 | static FlightBookingEntitySeatingClassEnum valueOf |
| 366 | } |
| 367 | |
| 368 | class FlightBookingEntityReasonEnum extends EnumClass |
| 369 | |
| 370 | /// Reason for the flight |
| 371 | @BuiltValueEnumConst(wireName: r'personal') |
| 372 | static const FlightBookingEntityReasonEnum |
| 373 | /// Reason for the flight |
| 374 | @BuiltValueEnumConst(wireName: r'business') |
| 375 | static const FlightBookingEntityReasonEnum |
| 376 | /// Reason for the flight |
| 377 | @BuiltValueEnumConst(wireName: r'crew') |
| 378 | static const FlightBookingEntityReasonEnum |
| 379 | /// Reason for the flight |
| 380 | @BuiltValueEnumConst(wireName: r'training') |
| 381 | static const FlightBookingEntityReasonEnum |
| 382 | /// Reason for the flight |
| 383 | @BuiltValueEnumConst(wireName: r'repositioning') |
| 384 | static const FlightBookingEntityReasonEnum |
| 385 | /// Reason for the flight |
| 386 | @BuiltValueEnumConst(wireName: r'other') |
| 387 | static const FlightBookingEntityReasonEnum |
| 388 | |
| 389 | static Serializer<FlightBookingEntityReasonEnum |
| 390 | |
| 391 | const FlightBookingEntityReasonEnum._(String |
| 392 | |
| 393 | static BuiltSet<FlightBookingEntityReasonEnum |
| 394 | static FlightBookingEntityReasonEnum valueOf |
| 395 | } |
| 396 | |