encode<V> static method

V encode<V>(
  1. PriceCustomUnitAmount instance,
  2. Encoder<V> encoder
)

Implementation

static V encode<V>(
  PriceCustomUnitAmount instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  container.encodeBool(
    'enabled',
    instance.enabled,
  );
  if (instance.maximum != null) {
    container.encodeInt(
      'maximum',
      instance.maximum!,
    );
  }
  if (instance.minimum != null) {
    container.encodeInt(
      'minimum',
      instance.minimum!,
    );
  }
  if (instance.preset != null) {
    container.encodeInt(
      'preset',
      instance.preset!,
    );
  }
  return container.value;
}