encode<V> static method
Implementation
static V encode<V>(
PaymentLinksResourceInvoiceSettings instance,
Encoder<V> encoder,
) {
final container = encoder.container<String>();
if (instance.accountTaxIds != null) {
container.encodeList(
'account_tax_ids',
(container) => instance.accountTaxIds!
.forEach((el) => InvoiceAccountTaxIdsItemOrId.encode(
el,
container.nestedSingleValueContainer().encoder,
)),
);
}
if (instance.customFields != null) {
container.encodeList(
'custom_fields',
(container) => instance.customFields!
.forEach((el) => InvoiceSettingCustomField.encode(
el,
container.nestedSingleValueContainer().encoder,
)),
);
}
if (instance.description != null) {
container.encodeString(
'description',
instance.description!,
);
}
if (instance.footer != null) {
container.encodeString(
'footer',
instance.footer!,
);
}
if (instance.issuer != null) {
ConnectAccountReference.encode(
instance.issuer!,
container.nestedSingleValueContainer('issuer').encoder,
);
}
if (instance.metadata != null) {
container.encodeMap(
'metadata',
(container) => instance.metadata!.forEach((
key,
value,
) =>
container.encodeString(
key,
value,
)),
);
}
if (instance.renderingOptions != null) {
InvoiceSettingRenderingOptions.encode(
instance.renderingOptions!,
container.nestedSingleValueContainer('rendering_options').encoder,
);
}
return container.value;
}