encode<V> static method

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

Implementation

static V encode<V>(
  RadarEarlyFraudWarning instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  container.encodeBool(
    'actionable',
    instance.actionable,
  );
  ChargeOrId.encode(
    instance.charge,
    container.nestedSingleValueContainer('charge').encoder,
  );
  container.encodeDateTime(
    'created',
    instance.created,
  );
  container.encodeString(
    'fraud_type',
    instance.fraudType,
  );
  container.encodeString(
    'id',
    instance.id,
  );
  container.encodeBool(
    'livemode',
    instance.livemode,
  );
  container.encodeString(
    'object',
    'radar.early_fraud_warning',
  );
  if (instance.paymentIntent != null) {
    PaymentIntentOrId.encode(
      instance.paymentIntent!,
      container.nestedSingleValueContainer('payment_intent').encoder,
    );
  }
  return container.value;
}