[ I ] (subject) - [eat] (verb) - [all of my cake] (object)
First translate the parts in brackets, then add the necessary changements according to the info given in parentheses, because that depends on where in the sentence the word appears.
all of my cake → bütün pastam
now, it's the object, so add the accusative at this point: bütün pastamı
Bütüm pastamı yerim.
Oops yes. That was a typo. It's bütün pastamı.
Pastanın bütünü benim is possible, where you treat bütün as a noun (la totalité du gâteau est à moi or something like that). Not a very common thing to say, but it's possible. Bütün/tüm pasta benim = all the cake is mine, where bütün and tüm are interchangeable.
I think you mean "Tüm pasta benim." Anyway, I think that answer was accepted. I assume that "Pastanın tümü benim" is the more common way to express "The whole cake is mine" in Turkish (since it's the suggested translation). The literal/word-for-word translation into English "The cake's entirety is mine" (or some such) would sound rather odd to a native English speaker.