encode<V> static method

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

Implementation

static V encode<V>(
  SubscriptionResumeOptions instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.billingCycleAnchor != null) {
    SubscriptionBillingCycleAnchor.encode(
      instance.billingCycleAnchor!,
      container.nestedSingleValueContainer('billing_cycle_anchor').encoder,
    );
  }
  if (instance.expand != null) {
    container.encodeList(
      'expand',
      (container) =>
          instance.expand!.forEach((el) => container.encodeString(el)),
    );
  }
  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;
}