encode<V> static method

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

Implementation

static V encode<V>(
  EphemeralKeyCreateOptions instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.customer != null) {
    container.encodeString(
      'customer',
      instance.customer!,
    );
  }
  if (instance.expand != null) {
    container.encodeList(
      'expand',
      (container) =>
          instance.expand!.forEach((el) => container.encodeString(el)),
    );
  }
  if (instance.issuingCard != null) {
    container.encodeString(
      'issuing_card',
      instance.issuingCard!,
    );
  }
  if (instance.nonce != null) {
    container.encodeString(
      'nonce',
      instance.nonce!,
    );
  }
  if (instance.verificationSession != null) {
    container.encodeString(
      'verification_session',
      instance.verificationSession!,
    );
  }
  return container.value;
}