For PSoC 4 devices, you need to use PSoC4_EraseAll command instead of EraseAll.
Similarly, you need to use PSoC4_ProgramRowFromHex instead of Program.
There are couple of PSoC 4 programming examples (for C#, CPP, Perl, Python, etc.) present in the PSoC Programmer installation directory that show the required programming flow.
(Location: C:\Program Files (x86)\Cypress\Programmer\Examples\Programming\PSoC4\SWD)
Check out those examples and see if that help you. Cheers!