encode<V> static method

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

Implementation

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