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

/// Antwort-Hülle für `POST /sync/tour`.
///
/// Properties:
/// * [tourId] 
@BuiltValue()
abstract class SyncTourResponse implements Built<SyncTourResponse, SyncTourResponseBuilder> {
  @BuiltValueField(wireName: r'tourId')
  String get tourId;

  SyncTourResponse._();

  factory SyncTourResponse([void updates(SyncTourResponseBuilder b)]) = _$SyncTourResponse;

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

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

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

  @override
  final String wireName = r'SyncTourResponse';

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

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

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

