use of com.evernote.edam.type.SharedNotebook in project Notes by lguipeng.
the class AsyncBusinessNoteStoreClient method deleteNotebook.
/**
* Providing a LinkedNotebook referencing a Business notebook, perform a delete.
*
* Synchronous call
*
* @return guid of notebook deleted
*/
@Override
@Deprecated
public int deleteNotebook(LinkedNotebook linkedNotebook) throws TException, EDAMUserException, EDAMSystemException, EDAMNotFoundException {
AsyncLinkedNoteStoreClient sharedNoteStore = getClientFactory().createLinkedNoteStoreClient(linkedNotebook);
SharedNotebook sharedNotebook = sharedNoteStore.getAsyncClient().getClient().getSharedNotebookByAuth(sharedNoteStore.getAuthenticationToken());
Long[] ids = { sharedNotebook.getId() };
getAsyncClient().getClient().expungeSharedNotebooks(getAuthenticationToken(), Arrays.asList(ids));
return getAsyncPersonalClient().getClient().expungeLinkedNotebook(getAsyncPersonalClient().getAuthenticationToken(), linkedNotebook.getGuid());
}
use of com.evernote.edam.type.SharedNotebook in project Notes by lguipeng.
the class AsyncLinkedNoteStoreClient method deleteNotebook.
/**
* Providing a LinkedNotebook referencing a linked account, perform a delete.
*
* Synchronous call
*
* @return guid of notebook deleted
*/
@Deprecated
public int deleteNotebook(LinkedNotebook linkedNotebook) throws TException, EDAMUserException, EDAMSystemException, EDAMNotFoundException {
SharedNotebook sharedNotebook = getAsyncClient().getClient().getSharedNotebookByAuth(getAuthenticationToken());
Long[] ids = { sharedNotebook.getId() };
getAsyncClient().getClient().expungeSharedNotebooks(getAuthenticationToken(), Arrays.asList(ids));
return getAsyncPersonalClient().getClient().expungeLinkedNotebook(getAsyncPersonalClient().getAuthenticationToken(), linkedNotebook.getGuid());
}
use of com.evernote.edam.type.SharedNotebook in project Notes by lguipeng.
the class EvernoteLinkedNotebookHelper method deleteLinkedNotebook.
/**
* @param defaultClient The note store client, which references the user's note store.
* @return A flag indicating if the action was successful.
* @see EvernoteNoteStoreClient#expungeLinkedNotebook(String)
*/
public int deleteLinkedNotebook(@NonNull EvernoteNoteStoreClient defaultClient) throws TException, EDAMUserException, EDAMSystemException, EDAMNotFoundException {
SharedNotebook sharedNotebook = mClient.getSharedNotebookByAuth();
List<Long> sharedNotebookIds = new ArrayList<>();
sharedNotebookIds.add(sharedNotebook.getId());
mClient.expungeSharedNotebooks(sharedNotebookIds);
return defaultClient.expungeLinkedNotebook(mLinkedNotebook.getGuid());
}
use of com.evernote.edam.type.SharedNotebook in project Notes by lguipeng.
the class EvernoteLinkedNotebookHelper method createNoteInLinkedNotebook.
/**
* @param note The new note.
* @return The new created note from the server.
*/
public Note createNoteInLinkedNotebook(@NonNull Note note) throws EDAMUserException, EDAMSystemException, TException, EDAMNotFoundException {
SharedNotebook sharedNotebook = mClient.getSharedNotebookByAuth();
note.setNotebookGuid(sharedNotebook.getNotebookGuid());
return mClient.createNote(note);
}
Aggregations