//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//

// ignore_for_file: unused_element
import 'package:built_value/built_value.dart';
import 'package:built_value/serializer.dart';

part 'delivery_order_entry.g.dart';

/// DeliveryOrderEntry
///
/// Properties:
/// * [deliveryId] 
/// * [sortOrder] 
@BuiltValue()
abstract class DeliveryOrderEntry implements Built<DeliveryOrderEntry, DeliveryOrderEntryBuilder> {
  @BuiltValueField(wireName: r'deliveryId')
  String get deliveryId;

  @BuiltValueField(wireName: r'sortOrder')
  int get sortOrder;

  DeliveryOrderEntry._();

  factory DeliveryOrderEntry([void updates(DeliveryOrderEntryBuilder b)]) = _$DeliveryOrderEntry;

  @BuiltValueHook(initializeBuilder: true)
  static void _defaults(DeliveryOrderEntryBuilder b) => b;

  @BuiltValueSerializer(custom: true)
  static Serializer<DeliveryOrderEntry> get serializer => _$DeliveryOrderEntrySerializer();
}

class _$DeliveryOrderEntrySerializer implements PrimitiveSerializer<DeliveryOrderEntry> {
  @override
  final Iterable<Type> types = const [DeliveryOrderEntry, _$DeliveryOrderEntry];

  @override
  final String wireName = r'DeliveryOrderEntry';

  Iterable<Object?> _serializeProperties(
    Serializers serializers,
    DeliveryOrderEntry object, {
    FullType specifiedType = FullType.unspecified,
  }) sync* {
    yield r'deliveryId';
    yield serializers.serialize(
      object.deliveryId,
      specifiedType: const FullType(String),
    );
    yield r'sortOrder';
    yield serializers.serialize(
      object.sortOrder,
      specifiedType: const FullType(int),
    );
  }

  @override
  Object serialize(
    Serializers serializers,
    DeliveryOrderEntry object, {
    FullType specifiedType = FullType.unspecified,
  }) {
    return _serializeProperties(serializers, object, specifiedType: specifiedType).toList();
  }

  void _deserializeProperties(
    Serializers serializers,
    Object serialized, {
    FullType specifiedType = FullType.unspecified,
    required List<Object?> serializedList,
    required DeliveryOrderEntryBuilder result,
    required List<Object?> unhandled,
  }) {
    for (var i = 0; i < serializedList.length; i += 2) {
      final key = serializedList[i] as String;
      final value = serializedList[i + 1];
      switch (key) {
        case r'deliveryId':
          final valueDes = serializers.deserialize(
            value,
            specifiedType: const FullType(String),
          ) as String;
          result.deliveryId = valueDes;
          break;
        case r'sortOrder':
          final valueDes = serializers.deserialize(
            value,
            specifiedType: const FullType(int),
          ) as int;
          result.sortOrder = valueDes;
          break;
        default:
          unhandled.add(key);
          unhandled.add(value);
          break;
      }
    }
  }

  @override
  DeliveryOrderEntry deserialize(
    Serializers serializers,
    Object serialized, {
    FullType specifiedType = FullType.unspecified,
  }) {
    final result = DeliveryOrderEntryBuilder();
    final serializedList = (serialized as Iterable<Object?>).toList();
    final unhandled = <Object?>[];
    _deserializeProperties(
      serializers,
      serialized,
      specifiedType: specifiedType,
      serializedList: serializedList,
      unhandled: unhandled,
      result: result,
    );
    return result.build();
  }
}

