encode<V> static method
Implementation
static V encode<V>(
UsageRecordCreateOptions instance,
Encoder<V> encoder,
) {
final container = encoder.container<String>();
if (instance.action != null) {
container.encodeString(
'action',
instance.action!,
);
}
if (instance.expand != null) {
container.encodeList(
'expand',
(container) =>
instance.expand!.forEach((el) => container.encodeString(el)),
);
}
container.encodeInt(
'quantity',
instance.quantity,
);
if (instance.timestamp != null) {
container.encodePrimitive(
'timestamp',
instance.timestamp!,
);
}
return container.value;
}