encode<V> static method

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

Implementation

static V encode<V>(
  AccountSchedule instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.delayDays != null) {
    container.encodePrimitive(
      'delay_days',
      instance.delayDays!,
    );
  }
  if (instance.interval != null) {
    container.encodeString(
      'interval',
      instance.interval!,
    );
  }
  if (instance.monthlyAnchor != null) {
    container.encodeInt(
      'monthly_anchor',
      instance.monthlyAnchor!,
    );
  }
  if (instance.weeklyAnchor != null) {
    container.encodeString(
      'weekly_anchor',
      instance.weeklyAnchor!,
    );
  }
  return container.value;
}