def METHOD_NAME(tax_class: Optional["TaxClass"]):
    if not tax_class:
        return {}
    return {
        "shipping_tax_class": tax_class,
        "shipping_tax_class_name": tax_class.name,
        "shipping_tax_class_private_metadata": tax_class.private_metadata,
        "shipping_tax_class_metadata": tax_class.metadata,
    }