encode<V> static method

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

Implementation

static V encode<V>(
  PortalFlowsFlowSubscriptionUpdateConfirm instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.discounts != null) {
    container.encodeList(
      'discounts',
      (container) => instance.discounts!.forEach(
          (el) => PortalFlowsSubscriptionUpdateConfirmDiscount.encode(
                el,
                container.nestedSingleValueContainer().encoder,
              )),
    );
  }
  container.encodeList(
    'items',
    (container) => instance.items
        .forEach((el) => PortalFlowsSubscriptionUpdateConfirmItem.encode(
              el,
              container.nestedSingleValueContainer().encoder,
            )),
  );
  container.encodeString(
    'subscription',
    instance.subscription,
  );
  return container.value;
}