encode<V> static method

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

Implementation

static V encode<V>(
  PaymentLinkAfterCompletion instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.hostedConfirmation != null) {
    SessionHostedConfirmation.encode(
      instance.hostedConfirmation!,
      container.nestedSingleValueContainer('hosted_confirmation').encoder,
    );
  }
  if (instance.redirect != null) {
    PaymentLinksResourceCompletionBehaviorRedirect.encode(
      instance.redirect!,
      container.nestedSingleValueContainer('redirect').encoder,
    );
  }
  PaymentLinksResourceAfterCompletionType.encode(
    instance.type,
    container.nestedSingleValueContainer('type').encoder,
  );
  return container.value;
}