//
// 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 'mark_mail_sent_request.g.dart';

/// MarkMailSentRequest
///
/// Properties:
/// * [belegnummern] - Belegnummern, deren Liefermail erfolgreich versendet wurde und die als versendet markiert werden sollen.
@BuiltValue()
abstract class MarkMailSentRequest implements Built<MarkMailSentRequest, MarkMailSentRequestBuilder> {
  /// Belegnummern, deren Liefermail erfolgreich versendet wurde und die als versendet markiert werden sollen.
  @BuiltValueField(wireName: r'belegnummern')
  BuiltList<String> get belegnummern;

  MarkMailSentRequest._();

  factory MarkMailSentRequest([void updates(MarkMailSentRequestBuilder b)]) = _$MarkMailSentRequest;

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

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

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

  @override
  final String wireName = r'MarkMailSentRequest';

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

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

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

