encode<V> static method

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

Implementation

static V encode<V>(
  SessionShippingOptionsItem instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.shippingRate != null) {
    container.encodeString(
      'shipping_rate',
      instance.shippingRate!,
    );
  }
  if (instance.shippingRateData != null) {
    SessionShippingRateData.encode(
      instance.shippingRateData!,
      container.nestedSingleValueContainer('shipping_rate_data').encoder,
    );
  }
  return container.value;
}