While this specific statute does not state what kind of knowledge or intent was required to be charged, the Texas Penal Code defaults to a requirement that you were at least reckless to the risk of causing someone to be restrained. This means that you must have been aware of the risk and disregarded it by your actions. For example, if you were to know there was a substantial risk of locking someone in a building when you were leaving, but you didn’t bother to check and locked when you left, you would be considered to have acted recklessly.