Search in sources :

Example 6 with SharedNotebook

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());
}
Also used : SharedNotebook(com.evernote.edam.type.SharedNotebook)

Example 7 with SharedNotebook

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());
}
Also used : SharedNotebook(com.evernote.edam.type.SharedNotebook)

Example 8 with SharedNotebook

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());
}
Also used : ArrayList(java.util.ArrayList) SharedNotebook(com.evernote.edam.type.SharedNotebook)

Example 9 with SharedNotebook

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);
}
Also used : SharedNotebook(com.evernote.edam.type.SharedNotebook)

Aggregations

SharedNotebook (com.evernote.edam.type.SharedNotebook)9 LinkedNotebook (com.evernote.edam.type.LinkedNotebook)2 Notebook (com.evernote.edam.type.Notebook)2 ArrayList (java.util.ArrayList)1