encode<V> static method
Implementation
static V encode<V>(
SessionCustomFieldsItem instance,
Encoder<V> encoder,
) {
final container = encoder.container<String>();
if (instance.dropdown != null) {
SessionDropdown.encode(
instance.dropdown!,
container.nestedSingleValueContainer('dropdown').encoder,
);
}
container.encodeString(
'key',
instance.key,
);
SessionLabel.encode(
instance.label,
container.nestedSingleValueContainer('label').encoder,
);
if (instance.numeric != null) {
SessionNumeric.encode(
instance.numeric!,
container.nestedSingleValueContainer('numeric').encoder,
);
}
if (instance.optional != null) {
container.encodeBool(
'optional',
instance.optional!,
);
}
if (instance.text != null) {
SessionNumeric.encode(
instance.text!,
container.nestedSingleValueContainer('text').encoder,
);
}
PaymentLinksResourceCustomFieldsType.encode(
instance.type,
container.nestedSingleValueContainer('type').encoder,
);
return container.value;
}