encode<V> static method

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

Implementation

static V encode<V>(
  SubscriptionItemDeleteOptions instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.clearUsage != null) {
    container.encodeBool(
      'clear_usage',
      instance.clearUsage!,
    );
  }
  if (instance.prorationBehavior != null) {
    PortalSubscriptionCancelProrationBehavior.encode(
      instance.prorationBehavior!,
      container.nestedSingleValueContainer('proration_behavior').encoder,
    );
  }
  if (instance.prorationDate != null) {
    container.encodeDateTime(
      'proration_date',
      instance.prorationDate!,
    );
  }
  return container.value;
}