def METHOD_NAME(self, machine: Machine, agent_registration_data: AgentRegistrationData):
    if (
        machine.hardware_id is not None
        and machine.hardware_id != agent_registration_data.machine_hardware_id
    ):
        raise Exception(
            f"Hardware ID mismatch:\n\tMachine: {machine}\n\t"
            f"AgentRegistrationData: {agent_registration_data}"
        )
    machine.hardware_id = agent_registration_data.machine_hardware_id