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

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

  CancelDeliveryRequest._();

  factory CancelDeliveryRequest([void updates(CancelDeliveryRequestBuilder b)]) = _$CancelDeliveryRequest;

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

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

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

  @override
  final String wireName = r'CancelDeliveryRequest';

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

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

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

