encode<V> static method

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

Implementation

static V encode<V>(
  UsageRecordSummary instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  container.encodeString(
    'id',
    instance.id,
  );
  if (instance.invoice != null) {
    container.encodeString(
      'invoice',
      instance.invoice!,
    );
  }
  container.encodeBool(
    'livemode',
    instance.livemode,
  );
  container.encodeString(
    'object',
    'usage_record_summary',
  );
  Period.encode(
    instance.period,
    container.nestedSingleValueContainer('period').encoder,
  );
  container.encodeString(
    'subscription_item',
    instance.subscriptionItem,
  );
  container.encodeInt(
    'total_usage',
    instance.totalUsage,
  );
  return container.value;
}