encode<V> static method
Implementation
static V encode<V>(
SessionProductData instance,
Encoder<V> encoder,
) {
final container = encoder.container<String>();
if (instance.description != null) {
container.encodeString(
'description',
instance.description!,
);
}
if (instance.images != null) {
container.encodeList(
'images',
(container) =>
instance.images!.forEach((el) => container.encodeString(el)),
);
}
if (instance.metadata != null) {
container.encodeMap(
'metadata',
(container) => instance.metadata!.forEach((
key,
value,
) =>
container.encodeString(
key,
value,
)),
);
}
container.encodeString(
'name',
instance.name,
);
if (instance.taxCode != null) {
container.encodeString(
'tax_code',
instance.taxCode!,
);
}
return container.value;
}