I am new at Google People API. I am able to fetch contacts through api, but I couldnt figure out how to create contacts. As api documantation says I need to use this code block;
Person contactToCreate = new Person();
List names = new ArrayList<>();
names.add(new Name().setGivenName("John").setFamilyName("Doe"));
contactToCreate.setNames(names);
Person createdContact = peopleService.people().createContact(contactToCreate).execute();
But createContact is giving "Cannot resolve method 'createContact(com.google.api.services.people.v1.model.Person)' " error. How can I solve this problem ? Or are there another ways to create Google Contact ?