use of ch.aaap.harvestclient.domain.ClientContact in project harvest-client by 3AP-AG.
the class ClientContactsApiImpl method get.
@Override
public ClientContact get(Reference<ClientContact> clientContactReference) {
Call<ClientContact> call = service.get(clientContactReference.getId());
ClientContact clientContact = ExceptionHandler.callOrThrow(call);
log.debug("Got ClientContact {}", clientContact);
return clientContact;
}
use of ch.aaap.harvestclient.domain.ClientContact in project harvest-client by 3AP-AG.
the class DeleteAllData method main.
/**
* Delete all available data in an Harvest account apart from the currently
* authenticated User
*/
public static void main(String[] args) {
Harvest harvest = TestSetupUtil.getAnotherAdminAccess();
log.debug("Deleting all data in account {}", harvest.getAccountId());
harvest.projects().list(new ProjectFilter()).forEach(harvest.projects()::delete);
List<ClientContact> clientContacts = harvest.clientContacts().list(new ClientContactFilter());
deleteAll(clientContacts, harvest.clientContacts());
harvest.estimates().list(new EstimateFilter()).forEach(harvest.estimates()::delete);
harvest.estimateItemCategories().list(null).forEach(harvest.estimateItemCategories()::delete);
List<Client> clients = harvest.clients().list(new ClientFilter());
deleteAll(clients, harvest.clients());
harvest.timesheets().list(new TimeEntryFilter()).forEach(harvest.timesheets()::delete);
harvest.tasks().list(new TaskFilter()).forEach(harvest.tasks()::delete);
harvest.roles().list().forEach(harvest.roles()::delete);
User self = harvest.users().getSelf();
harvest.users().list().stream().filter(user -> !user.getId().equals(self.getId())).forEach(harvest.users()::delete);
}
Aggregations