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

/// MarkMailSentResponse
///
/// Properties:
/// * [marked] - Anzahl frisch markierter (vorher offener) Belege. Bereits markierte zählen nicht mit (idempotent).
@BuiltValue()
abstract class MarkMailSentResponse implements Built<MarkMailSentResponse, MarkMailSentResponseBuilder> {
  /// Anzahl frisch markierter (vorher offener) Belege. Bereits markierte zählen nicht mit (idempotent).
  @BuiltValueField(wireName: r'marked')
  int get marked;

  MarkMailSentResponse._();

  factory MarkMailSentResponse([void updates(MarkMailSentResponseBuilder b)]) = _$MarkMailSentResponse;

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

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

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

  @override
  final String wireName = r'MarkMailSentResponse';

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

  @override
  Object serialize(
    Serializers serializers,
    MarkMailSentResponse 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 MarkMailSentResponseBuilder 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'marked':
          final valueDes = serializers.deserialize(
            value,
            specifiedType: const FullType(int),
          ) as int;
          result.marked = valueDes;
          break;
        default:
          unhandled.add(key);
          unhandled.add(value);
          break;
      }
    }
  }

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

