encode<V> static method

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

Implementation

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