Like much internet advice I find short answers incomplete - and mine was.   I really want to ad that making a crate/xpen/gated puppy area should never be seen as "punishment".   These partitioned puppy areas should be conditioned to be safe places for a puppy/dog.  Mine, thankfully, tolerates and even likes her xpens probably because it's where she eats, receives treats, sleeps, chews and even plays.  This took about a week or so.  Now she voluntarily goes into her xpens (in my case) on her own and when she's put there involuntarily she might whine for a minute before settling down with a chew and/or going to sleep.