Class: Evernote::EDAM::NoteStore::SyncChunk

Inherits:
Object
  • Object
show all
Includes:
Thrift::Struct, Thrift::Struct_Union
Defined in:
lib/Evernote/EDAM/note_store_types.rb

Overview

receive the current state of an account. The client asks for the server's state one chunk at a time in order to allow clients to retrieve the state of a large account without needing to transfer the entire account in a single message.

The server always gives SyncChunks using an ascending series of Update Sequence Numbers (USNs).

currentTime
The server's current date and time.
chunkHighUSN
The highest USN for any of the data objects represented in this sync chunk. If there are no objects in the chunk, this will not be set.
updateCount
The total number of updates that have been performed in the service for this account. This is equal to the highest USN within the account at the point that this SyncChunk was generated. If updateCount and chunkHighUSN are identical, that means that this is the last chunk in the account ... there is no more recent information.
notes
If present, this is a list of non-expunged notes that have a USN in this chunk. This will include notes that are "deleted" but not expunged (i.e. in the trash). The notes will include their list of tags and resources, but the note content, resource content, resource recognition data and resource alternate data will not be supplied.
notebooks
If present, this is a list of non-expunged notebooks that have a USN in this chunk. This will include notebooks that are "deleted" but not expunged (i.e. in the trash).
tags
If present, this is a list of the non-expunged tags that have a USN in this chunk.
searches
If present, this is a list of non-expunged searches that have a USN in this chunk.
resources
If present, this is a list of the non-expunged resources that have a USN in this chunk. This will include the metadata for each resource, but not its binary contents or recognition data, which must be retrieved separately.
expungedNotes
If present, the GUIDs of all of the notes that were permanently expunged in this chunk.
expungedNotebooks
If present, the GUIDs of all of the notebooks that were permanently expunged in this chunk. When a notebook is expunged, this implies that all of its child notes (and their resources) were also expunged.
expungedTags
If present, the GUIDs of all of the tags that were permanently expunged in this chunk.
expungedSearches
If present, the GUIDs of all of the saved searches that were permanently expunged in this chunk.
linkedNotebooks
If present, this is a list of non-expunged LinkedNotebooks that have a USN in this chunk.
expungedLinkedNotebooks
If present, the GUIDs of all of the LinkedNotebooks that were permanently expunged in this chunk.

Constant Summary collapse

CURRENTTIME =
1
CHUNKHIGHUSN =
2
UPDATECOUNT =
3
NOTES =
4
NOTEBOOKS =
5
TAGS =
6
SEARCHES =
7
RESOURCES =
8
EXPUNGEDNOTES =
9
EXPUNGEDNOTEBOOKS =
10
EXPUNGEDTAGS =
11
EXPUNGEDSEARCHES =
12
LINKEDNOTEBOOKS =
13
EXPUNGEDLINKEDNOTEBOOKS =
14
FIELDS =
{
  CURRENTTIME => {:type => ::Thrift::Types::I64, :name => 'currentTime'},
  CHUNKHIGHUSN => {:type => ::Thrift::Types::I32, :name => 'chunkHighUSN', :optional => true},
  UPDATECOUNT => {:type => ::Thrift::Types::I32, :name => 'updateCount'},
  NOTES => {:type => ::Thrift::Types::LIST, :name => 'notes', :element => {:type => ::Thrift::Types::STRUCT, :class => ::Evernote::EDAM::Type::Note}, :optional => true},
  NOTEBOOKS => {:type => ::Thrift::Types::LIST, :name => 'notebooks', :element => {:type => ::Thrift::Types::STRUCT, :class => ::Evernote::EDAM::Type::Notebook}, :optional => true},
  TAGS => {:type => ::Thrift::Types::LIST, :name => 'tags', :element => {:type => ::Thrift::Types::STRUCT, :class => ::Evernote::EDAM::Type::Tag}, :optional => true},
  SEARCHES => {:type => ::Thrift::Types::LIST, :name => 'searches', :element => {:type => ::Thrift::Types::STRUCT, :class => ::Evernote::EDAM::Type::SavedSearch}, :optional => true},
  RESOURCES => {:type => ::Thrift::Types::LIST, :name => 'resources', :element => {:type => ::Thrift::Types::STRUCT, :class => ::Evernote::EDAM::Type::Resource}, :optional => true},
  EXPUNGEDNOTES => {:type => ::Thrift::Types::LIST, :name => 'expungedNotes', :element => {:type => ::Thrift::Types::STRING}, :optional => true},
  EXPUNGEDNOTEBOOKS => {:type => ::Thrift::Types::LIST, :name => 'expungedNotebooks', :element => {:type => ::Thrift::Types::STRING}, :optional => true},
  EXPUNGEDTAGS => {:type => ::Thrift::Types::LIST, :name => 'expungedTags', :element => {:type => ::Thrift::Types::STRING}, :optional => true},
  EXPUNGEDSEARCHES => {:type => ::Thrift::Types::LIST, :name => 'expungedSearches', :element => {:type => ::Thrift::Types::STRING}, :optional => true},
  LINKEDNOTEBOOKS => {:type => ::Thrift::Types::LIST, :name => 'linkedNotebooks', :element => {:type => ::Thrift::Types::STRUCT, :class => ::Evernote::EDAM::Type::LinkedNotebook}, :optional => true},
  EXPUNGEDLINKEDNOTEBOOKS => {:type => ::Thrift::Types::LIST, :name => 'expungedLinkedNotebooks', :element => {:type => ::Thrift::Types::STRING}, :optional => true}
}

Constants included from Thrift::Struct_Union

Thrift::Struct_Union::CONTAINER_TYPES

Instance Method Summary collapse

Methods included from Thrift::Struct

#<=>, #==, #differences, #eql?, field_accessor, #fields_with_default_values, generate_accessors, #hash, #initialize, #inspect, qmark_isset_method, #read, #write

Methods included from Thrift::Struct_Union

#each_field, #field_info, #inspect_collection, #inspect_field, #is_container?, #name_to_id, #read_field, #sorted_field_ids, #write_container, #write_data

Instance Method Details

#struct_fieldsObject



218
# File 'lib/Evernote/EDAM/note_store_types.rb', line 218

def struct_fields; FIELDS; end

#validateObject



220
221
222
223
# File 'lib/Evernote/EDAM/note_store_types.rb', line 220

def validate
  raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field currentTime is unset!') unless @currentTime
  raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field updateCount is unset!') unless @updateCount
end