encode<V> static method

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

Implementation

static V encode<V>(
  PaymentPagesCheckoutSessionConsentCollection instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.paymentMethodReuseAgreement != null) {
    PaymentLinksResourcePaymentMethodReuseAgreement.encode(
      instance.paymentMethodReuseAgreement!,
      container
          .nestedSingleValueContainer('payment_method_reuse_agreement')
          .encoder,
    );
  }
  if (instance.promotions != null) {
    CheckoutSessionConsentCollectionPromotions.encode(
      instance.promotions!,
      container.nestedSingleValueContainer('promotions').encoder,
    );
  }
  if (instance.termsOfService != null) {
    CheckoutSessionConsentCollectionTermsOfService.encode(
      instance.termsOfService!,
      container.nestedSingleValueContainer('terms_of_service').encoder,
    );
  }
  return container.value;
}