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

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

part 'set_delivery_order_request.g.dart';

/// SetDeliveryOrderRequest
///
/// Properties:
/// * [deliveryIds] - Reihenfolge: Position im Array (0-basiert) wird zu `sort_order` (1-basiert) gemappt.
@BuiltValue()
abstract class SetDeliveryOrderRequest implements Built<SetDeliveryOrderRequest, SetDeliveryOrderRequestBuilder> {
  /// Reihenfolge: Position im Array (0-basiert) wird zu `sort_order` (1-basiert) gemappt.
  @BuiltValueField(wireName: r'deliveryIds')
  BuiltList<String> get deliveryIds;

  SetDeliveryOrderRequest._();

  factory SetDeliveryOrderRequest([void updates(SetDeliveryOrderRequestBuilder b)]) = _$SetDeliveryOrderRequest;

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

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

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

  @override
  final String wireName = r'SetDeliveryOrderRequest';

  Iterable<Object?> _serializeProperties(
    Serializers serializers,
    SetDeliveryOrderRequest object, {
    FullType specifiedType = FullType.unspecified,
  }) sync* {
    yield r'deliveryIds';
    yield serializers.serialize(
      object.deliveryIds,
      specifiedType: const FullType(BuiltList, [FullType(String)]),
    );
  }

  @override
  Object serialize(
    Serializers serializers,
    SetDeliveryOrderRequest 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 SetDeliveryOrderRequestBuilder 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'deliveryIds':
          final valueDes = serializers.deserialize(
            value,
            specifiedType: const FullType(BuiltList, [FullType(String)]),
          ) as BuiltList<String>;
          result.deliveryIds.replace(valueDes);
          break;
        default:
          unhandled.add(key);
          unhandled.add(value);
          break;
      }
    }
  }

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

