QEverCloud  6.1.0
Unofficial Evernote Cloud API for Qt
Public Member Functions | Public Attributes | List of all members
qevercloud::SyncState Struct Reference

#include <Types.h>

Inheritance diagram for qevercloud::SyncState:
qevercloud::Printable

Public Member Functions

virtual void print (QTextStream &strm) const override
 
bool operator== (const SyncState &other) const
 
bool operator!= (const SyncState &other) const
 
- Public Member Functions inherited from qevercloud::Printable
 Printable ()=default
 
virtual ~Printable ()=default
 
virtual QString toString () const
 

Public Attributes

EverCloudLocalData localData
 
Timestamp currentTime
 
Timestamp fullSyncBefore
 
qint32 updateCount
 
Optional< qint64 > uploaded
 
Optional< TimestampuserLastUpdated
 
Optional< MessageEventIDuserMaxMessageEventId
 

Detailed Description

This structure encapsulates the information about the state of the user's account for the purpose of "state based" synchronization.

Member Function Documentation

◆ operator!=()

bool qevercloud::SyncState::operator!= ( const SyncState other) const
inline

◆ operator==()

bool qevercloud::SyncState::operator== ( const SyncState other) const
inline

◆ print()

virtual void qevercloud::SyncState::print ( QTextStream &  strm) const
overridevirtual

Implements qevercloud::Printable.

Member Data Documentation

◆ currentTime

Timestamp qevercloud::SyncState::currentTime

The server's current date and time.

◆ fullSyncBefore

Timestamp qevercloud::SyncState::fullSyncBefore

The cutoff date and time for client caches to be updated via incremental synchronization. Any clients that were last synched with the server before this date/time must do a full resync of all objects. This cutoff point will change over time as archival data is deleted or special circumstances on the service require resynchronization.

◆ localData

EverCloudLocalData qevercloud::SyncState::localData

See the declaration of EverCloudLocalData for details

◆ updateCount

qint32 qevercloud::SyncState::updateCount

Indicates the total number of transactions that have been committed within the account. This reflects (for example) the number of discrete additions or modifications that have been made to the data in this account (tags, notes, resources, etc.). This number is the "high water mark" for Update Sequence Numbers (USN) within the account.

◆ uploaded

Optional< qint64 > qevercloud::SyncState::uploaded

The total number of bytes that have been uploaded to this account in the current monthly period. This can be compared against Accounting.uploadLimit (from the UserStore) to determine how close the user is to their monthly upload limit. This value may not be present if the SyncState has been retrieved by a caller that only has read access to the account.

◆ userLastUpdated

Optional< Timestamp > qevercloud::SyncState::userLastUpdated

The last time when a user's account level information was changed. This value is the latest time when a modification was made to any of the following: accounting information (billing, quota, premium status, etc.), user attributes and business user information (business name, business user attributes, etc.) if the user is in a business. Clients who need to maintain account information about a User should watch this field for updates rather than polling UserStore.getUser for updates. Here is the basic flow that clients should follow:

  1. Call NoteStore.getSyncState to retrieve the SyncState object
  2. Compare SyncState.userLastUpdated to previously stored value: if (SyncState.userLastUpdated > previousValue) call UserStore.getUser to get the latest User object; else do nothing;
  3. Update previousValue = SyncState.userLastUpdated

◆ userMaxMessageEventId

Optional< MessageEventID > qevercloud::SyncState::userMaxMessageEventId

The greatest MessageEventID for this user's account. Clients that do a full sync should store this value locally and compare their local copy to the value returned by getSyncState to determine if they need to sync with MessageStore. This value will be omitted if the user has never sent or received a message.