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

/// CreateCarRequest
///
/// Properties:
/// * [plate] 
@BuiltValue()
abstract class CreateCarRequest implements Built<CreateCarRequest, CreateCarRequestBuilder> {
  @BuiltValueField(wireName: r'plate')
  String get plate;

  CreateCarRequest._();

  factory CreateCarRequest([void updates(CreateCarRequestBuilder b)]) = _$CreateCarRequest;

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

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

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

  @override
  final String wireName = r'CreateCarRequest';

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

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

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

