NIC for multipile VMs

I could write code to create a multiple VMS, however when I tried to create multiple NICS and to associate NICS to vms, I am getting below error, Please suggest what needs to be added to fix this?

how to use each. Key value to achieve my requirement