"""Schema for Reference Tax Withholding serialization.""" from abacus_common_logic.marshalling.custom_fields import ma from marshmallow import validate class ReferenceTaxWithholdingDetailSchema(ma.Schema): """Reference Tax Withholding list response.""" reference_tax_withholding_id = ma.IntegerId() country_of_withholding = ma.String() country_of_tax_residence = ma.String() tax_rate = ma.Decimal(as_string=True) is_resource_provisioned = ma.Boolean(allow_none=True) class ReferenceTaxWithholdingListSchema(ma.Schema): """Reference Tax Withholding list response.""" items = ma.Nested(ReferenceTaxWithholdingDetailSchema, many=True) total_count = ma.NonNegativeInteger() class ReferenceTaxWithholdingListFilterParamsSchema(ma.Schema): """Reference Tax Withholding list filter params.""" country_of_withholding = ma.String( required=False, validate=validate.Length(equal=3) ) country_of_tax_residence = ma.String( required=False, validate=validate.Length(equal=3) )