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

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

  HoldDeliveryRequest._();

  factory HoldDeliveryRequest([void updates(HoldDeliveryRequestBuilder b)]) = _$HoldDeliveryRequest;

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

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

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

  @override
  final String wireName = r'HoldDeliveryRequest';

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

  @override
  Object serialize(
    Serializers serializers,
    HoldDeliveryRequest 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 HoldDeliveryRequestBuilder 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
  HoldDeliveryRequest deserialize(
    Serializers serializers,
    Object serialized, {
    FullType specifiedType = FullType.unspecified,
  }) {
    final result = HoldDeliveryRequestBuilder();
    final serializedList = (serialized as Iterable<Object?>).toList();
    final unhandled = <Object?>[];
    _deserializeProperties(
      serializers,
      serialized,
      specifiedType: specifiedType,
      serializedList: serializedList,
      unhandled: unhandled,
      result: result,
    );
    return result.build();
  }
}

