if you're somebody that wants to keep a large dog in an apartment building, you should be ashamed of yourself - that dog won't have a worthwhile existence. and, you don't own it, either - it's not there for your amusement. it's not yours.
there are a few counterexamples, like fish in proper aquariums, that are probably too stupid to be unhappy, although i couldn't justify the energy use to myself.
but, broadly speaking, keeping pets in small spaces is both unsanitary to everybody and cruel to the animal and should be largely forbidden on moral and ethical grounds.
we're just dumb primates - we need to stop thinking we're more important than other animals are. we're not. and, our laws need to be erected with that in mind.
so, say no to vain pet owners that want to torture cats and dogs by keeping them in enclosed spaces; it's cruel, and it shouldn't happen at all.