encode<V> static method

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

Implementation

static V encode<V>(
  EphemeralKey instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  container.encodeDateTime(
    'created',
    instance.created,
  );
  container.encodeDateTime(
    'expires',
    instance.expires,
  );
  container.encodeString(
    'id',
    instance.id,
  );
  container.encodeBool(
    'livemode',
    instance.livemode,
  );
  container.encodeString(
    'object',
    'ephemeral_key',
  );
  if (instance.secret != null) {
    container.encodeString(
      'secret',
      instance.secret!,
    );
  }
  return container.value;
}