encode<V> static method
Implementation
static V encode<V>(
TaxRateCreateOptions instance,
Encoder<V> encoder,
) {
final container = encoder.container<String>();
if (instance.active != null) {
container.encodeBool(
'active',
instance.active!,
);
}
if (instance.country != null) {
container.encodeString(
'country',
instance.country!,
);
}
if (instance.description != null) {
container.encodeString(
'description',
instance.description!,
);
}
container.encodeString(
'display_name',
instance.displayName,
);
if (instance.expand != null) {
container.encodeList(
'expand',
(container) =>
instance.expand!.forEach((el) => container.encodeString(el)),
);
}
container.encodeBool(
'inclusive',
instance.inclusive,
);
if (instance.jurisdiction != null) {
container.encodeString(
'jurisdiction',
instance.jurisdiction!,
);
}
if (instance.metadata != null) {
container.encodeMap(
'metadata',
(container) => instance.metadata!.forEach((
key,
value,
) =>
container.encodeString(
key,
value,
)),
);
}
container.encodeDouble(
'percentage',
instance.percentage,
);
if (instance.state != null) {
container.encodeString(
'state',
instance.state!,
);
}
if (instance.taxType != null) {
TaxProductResourceLineItemTaxBreakdownTaxRateDetailsTaxType.encode(
instance.taxType!,
container.nestedSingleValueContainer('tax_type').encoder,
);
}
return container.value;
}