evernote 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2009 Chris Sepic
1
+ Copyright (c) 2011 Chris Sepic
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.mkd CHANGED
@@ -5,6 +5,7 @@ This gem is a high level wrapper around Evernote's Thrift-generated ruby code. I
5
5
  Get yourself a "Client application" API key from Evernote (http://www.evernote.com/about/developer/api/#key), which gives you a "consumer_key" and "consumer_secret" (note that a "web application" API key uses OAuth to authenticate and will not work). Put the key in a YML file or any other place you put configuration information. Also, get yourself a username and password on both their sandbox system (http://sandbox.evernote.com) and live system. You will be using sandbox for testing.
6
6
 
7
7
  # usage #
8
+ This script is also located in /example.rb
8
9
 
9
10
  require 'evernote'
10
11
 
@@ -17,8 +18,6 @@ Get yourself a "Client application" API key from Evernote (http://www.evernote.c
17
18
  :consumer_secret => 'YOUR_CONSUMER_SECRECT_FROM_EVERNOTE'
18
19
  }
19
20
 
20
- # note, you could also read in your consumer key information from a YML file
21
-
22
21
  user_store = Evernote::UserStore.new(user_store_url, config)
23
22
 
24
23
  auth_result = user_store.authenticate
@@ -41,5 +40,13 @@ The evernote API can be viewed at http://www.evernote.com/about/developer/api/re
41
40
 
42
41
  If the vendored code is out of date and you get an error indicating so, feel free to create an issue at http://github.com/cgs/evernote/issues
43
42
 
43
+ # contributors #
44
+ Thanks to the following peeps for helping out:
45
+
46
+ * Peter Mangiafico (peetucket)
47
+ * d1
48
+ * Mikhail Zelenin (MioGreen)
49
+
50
+
44
51
  ## Copyright ##
45
- Copyright (c) 2010 Chris Sepic. See LICENSE for details.
52
+ Copyright (c) 2011 Chris Sepic. See LICENSE for details.
@@ -0,0 +1,27 @@
1
+ require 'rubygems'
2
+ require 'evernote'
3
+
4
+ user_store_url = "https://sandbox.evernote.com/edam/user"
5
+
6
+ config = {
7
+ :username => 'username',
8
+ :password => 'password',
9
+ :consumer_key => 'consumer_key',
10
+ :consumer_secret => 'consumer_secret'
11
+ }
12
+
13
+ user_store = Evernote::UserStore.new(user_store_url, config)
14
+
15
+ auth_result = user_store.authenticate
16
+ user = auth_result.user
17
+ auth_token = auth_result.authenticationToken
18
+ puts "Authentication was successful for #{user.username}"
19
+ puts "Authentication token = #{auth_token}"
20
+
21
+ note_store_url = "http://sandbox.evernote.com/edam/note/#{user.shardId}"
22
+ note_store = Evernote::NoteStore.new(note_store_url)
23
+
24
+ notebooks = note_store.listNotebooks(auth_token)
25
+ puts "Found #{notebooks.size} notebooks:"
26
+ default_notebook = notebooks[0]
27
+ notebooks.each { |notebook| puts " * #{notebook.name}"}
@@ -1,3 +1,3 @@
1
1
  module Evernote
2
- VERSION = "1.0.0"
2
+ VERSION = "1.1.0"
3
3
  end
@@ -0,0 +1,14 @@
1
+ #
2
+ # Autogenerated by Thrift
3
+ #
4
+ # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
+ #
6
+
7
+ require 'errors_types'
8
+
9
+ module Evernote
10
+ module EDAM
11
+ module Error
12
+ end
13
+ end
14
+ end
@@ -86,6 +86,10 @@ require 'limits_types'
86
86
 
87
87
  EDAM_COMMERCE_SERVICE_GROUP = %q"Group"
88
88
 
89
+ EDAM_COMMERCE_SERVICE_CYBERSOURCE = %q"CYBERSRC"
90
+
91
+ EDAM_COMMERCE_DEFAULT_CURRENCY_COUNTRY_CODE = %q"USD"
92
+
89
93
  EDAM_SEARCH_QUERY_LEN_MIN = 0
90
94
 
91
95
  EDAM_SEARCH_QUERY_LEN_MAX = 1024
@@ -180,6 +184,10 @@ require 'limits_types'
180
184
 
181
185
  EDAM_USER_MAIL_LIMIT_DAILY_PREMIUM = 200
182
186
 
187
+ EDAM_USER_UPLOAD_LIMIT_FREE = 62914560
188
+
189
+ EDAM_USER_UPLOAD_LIMIT_PREMIUM = 1073741824
190
+
183
191
  EDAM_NOTE_SIZE_MAX_FREE = 26214400
184
192
 
185
193
  EDAM_NOTE_SIZE_MAX_PREMIUM = 52428800
@@ -419,6 +419,42 @@ require 'note_store_types'
419
419
  raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'findNotes failed: unknown result')
420
420
  end
421
421
 
422
+ def findNoteOffset(authenticationToken, filter, guid)
423
+ send_findNoteOffset(authenticationToken, filter, guid)
424
+ return recv_findNoteOffset()
425
+ end
426
+
427
+ def send_findNoteOffset(authenticationToken, filter, guid)
428
+ send_message('findNoteOffset', FindNoteOffset_args, :authenticationToken => authenticationToken, :filter => filter, :guid => guid)
429
+ end
430
+
431
+ def recv_findNoteOffset()
432
+ result = receive_message(FindNoteOffset_result)
433
+ return result.success unless result.success.nil?
434
+ raise result.userException unless result.userException.nil?
435
+ raise result.systemException unless result.systemException.nil?
436
+ raise result.notFoundException unless result.notFoundException.nil?
437
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'findNoteOffset failed: unknown result')
438
+ end
439
+
440
+ def findNotesMetadata(authenticationToken, filter, offset, maxNotes, resultSpec)
441
+ send_findNotesMetadata(authenticationToken, filter, offset, maxNotes, resultSpec)
442
+ return recv_findNotesMetadata()
443
+ end
444
+
445
+ def send_findNotesMetadata(authenticationToken, filter, offset, maxNotes, resultSpec)
446
+ send_message('findNotesMetadata', FindNotesMetadata_args, :authenticationToken => authenticationToken, :filter => filter, :offset => offset, :maxNotes => maxNotes, :resultSpec => resultSpec)
447
+ end
448
+
449
+ def recv_findNotesMetadata()
450
+ result = receive_message(FindNotesMetadata_result)
451
+ return result.success unless result.success.nil?
452
+ raise result.userException unless result.userException.nil?
453
+ raise result.systemException unless result.systemException.nil?
454
+ raise result.notFoundException unless result.notFoundException.nil?
455
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'findNotesMetadata failed: unknown result')
456
+ end
457
+
422
458
  def findNoteCounts(authenticationToken, filter, withTrash)
423
459
  send_findNoteCounts(authenticationToken, filter, withTrash)
424
460
  return recv_findNoteCounts()
@@ -1061,6 +1097,59 @@ require 'note_store_types'
1061
1097
  return
1062
1098
  end
1063
1099
 
1100
+ def shareNote(authenticationToken, guid)
1101
+ send_shareNote(authenticationToken, guid)
1102
+ return recv_shareNote()
1103
+ end
1104
+
1105
+ def send_shareNote(authenticationToken, guid)
1106
+ send_message('shareNote', ShareNote_args, :authenticationToken => authenticationToken, :guid => guid)
1107
+ end
1108
+
1109
+ def recv_shareNote()
1110
+ result = receive_message(ShareNote_result)
1111
+ return result.success unless result.success.nil?
1112
+ raise result.userException unless result.userException.nil?
1113
+ raise result.notFoundException unless result.notFoundException.nil?
1114
+ raise result.systemException unless result.systemException.nil?
1115
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'shareNote failed: unknown result')
1116
+ end
1117
+
1118
+ def stopSharingNote(authenticationToken, guid)
1119
+ send_stopSharingNote(authenticationToken, guid)
1120
+ recv_stopSharingNote()
1121
+ end
1122
+
1123
+ def send_stopSharingNote(authenticationToken, guid)
1124
+ send_message('stopSharingNote', StopSharingNote_args, :authenticationToken => authenticationToken, :guid => guid)
1125
+ end
1126
+
1127
+ def recv_stopSharingNote()
1128
+ result = receive_message(StopSharingNote_result)
1129
+ raise result.userException unless result.userException.nil?
1130
+ raise result.notFoundException unless result.notFoundException.nil?
1131
+ raise result.systemException unless result.systemException.nil?
1132
+ return
1133
+ end
1134
+
1135
+ def authenticateToSharedNote(guid, noteKey)
1136
+ send_authenticateToSharedNote(guid, noteKey)
1137
+ return recv_authenticateToSharedNote()
1138
+ end
1139
+
1140
+ def send_authenticateToSharedNote(guid, noteKey)
1141
+ send_message('authenticateToSharedNote', AuthenticateToSharedNote_args, :guid => guid, :noteKey => noteKey)
1142
+ end
1143
+
1144
+ def recv_authenticateToSharedNote()
1145
+ result = receive_message(AuthenticateToSharedNote_result)
1146
+ return result.success unless result.success.nil?
1147
+ raise result.userException unless result.userException.nil?
1148
+ raise result.notFoundException unless result.notFoundException.nil?
1149
+ raise result.systemException unless result.systemException.nil?
1150
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'authenticateToSharedNote failed: unknown result')
1151
+ end
1152
+
1064
1153
  end
1065
1154
 
1066
1155
  class Processor
@@ -1395,6 +1484,36 @@ require 'note_store_types'
1395
1484
  write_result(result, oprot, 'findNotes', seqid)
1396
1485
  end
1397
1486
 
1487
+ def process_findNoteOffset(seqid, iprot, oprot)
1488
+ args = read_args(iprot, FindNoteOffset_args)
1489
+ result = FindNoteOffset_result.new()
1490
+ begin
1491
+ result.success = @handler.findNoteOffset(args.authenticationToken, args.filter, args.guid)
1492
+ rescue Evernote::EDAM::Error::EDAMUserException => userException
1493
+ result.userException = userException
1494
+ rescue Evernote::EDAM::Error::EDAMSystemException => systemException
1495
+ result.systemException = systemException
1496
+ rescue Evernote::EDAM::Error::EDAMNotFoundException => notFoundException
1497
+ result.notFoundException = notFoundException
1498
+ end
1499
+ write_result(result, oprot, 'findNoteOffset', seqid)
1500
+ end
1501
+
1502
+ def process_findNotesMetadata(seqid, iprot, oprot)
1503
+ args = read_args(iprot, FindNotesMetadata_args)
1504
+ result = FindNotesMetadata_result.new()
1505
+ begin
1506
+ result.success = @handler.findNotesMetadata(args.authenticationToken, args.filter, args.offset, args.maxNotes, args.resultSpec)
1507
+ rescue Evernote::EDAM::Error::EDAMUserException => userException
1508
+ result.userException = userException
1509
+ rescue Evernote::EDAM::Error::EDAMSystemException => systemException
1510
+ result.systemException = systemException
1511
+ rescue Evernote::EDAM::Error::EDAMNotFoundException => notFoundException
1512
+ result.notFoundException = notFoundException
1513
+ end
1514
+ write_result(result, oprot, 'findNotesMetadata', seqid)
1515
+ end
1516
+
1398
1517
  def process_findNoteCounts(seqid, iprot, oprot)
1399
1518
  args = read_args(iprot, FindNoteCounts_args)
1400
1519
  result = FindNoteCounts_result.new()
@@ -1925,6 +2044,51 @@ require 'note_store_types'
1925
2044
  write_result(result, oprot, 'emailNote', seqid)
1926
2045
  end
1927
2046
 
2047
+ def process_shareNote(seqid, iprot, oprot)
2048
+ args = read_args(iprot, ShareNote_args)
2049
+ result = ShareNote_result.new()
2050
+ begin
2051
+ result.success = @handler.shareNote(args.authenticationToken, args.guid)
2052
+ rescue Evernote::EDAM::Error::EDAMUserException => userException
2053
+ result.userException = userException
2054
+ rescue Evernote::EDAM::Error::EDAMNotFoundException => notFoundException
2055
+ result.notFoundException = notFoundException
2056
+ rescue Evernote::EDAM::Error::EDAMSystemException => systemException
2057
+ result.systemException = systemException
2058
+ end
2059
+ write_result(result, oprot, 'shareNote', seqid)
2060
+ end
2061
+
2062
+ def process_stopSharingNote(seqid, iprot, oprot)
2063
+ args = read_args(iprot, StopSharingNote_args)
2064
+ result = StopSharingNote_result.new()
2065
+ begin
2066
+ @handler.stopSharingNote(args.authenticationToken, args.guid)
2067
+ rescue Evernote::EDAM::Error::EDAMUserException => userException
2068
+ result.userException = userException
2069
+ rescue Evernote::EDAM::Error::EDAMNotFoundException => notFoundException
2070
+ result.notFoundException = notFoundException
2071
+ rescue Evernote::EDAM::Error::EDAMSystemException => systemException
2072
+ result.systemException = systemException
2073
+ end
2074
+ write_result(result, oprot, 'stopSharingNote', seqid)
2075
+ end
2076
+
2077
+ def process_authenticateToSharedNote(seqid, iprot, oprot)
2078
+ args = read_args(iprot, AuthenticateToSharedNote_args)
2079
+ result = AuthenticateToSharedNote_result.new()
2080
+ begin
2081
+ result.success = @handler.authenticateToSharedNote(args.guid, args.noteKey)
2082
+ rescue Evernote::EDAM::Error::EDAMUserException => userException
2083
+ result.userException = userException
2084
+ rescue Evernote::EDAM::Error::EDAMNotFoundException => notFoundException
2085
+ result.notFoundException = notFoundException
2086
+ rescue Evernote::EDAM::Error::EDAMSystemException => systemException
2087
+ result.systemException = systemException
2088
+ end
2089
+ write_result(result, oprot, 'authenticateToSharedNote', seqid)
2090
+ end
2091
+
1928
2092
  end
1929
2093
 
1930
2094
  # HELPER FUNCTIONS AND STRUCTURES
@@ -2835,6 +2999,94 @@ require 'note_store_types'
2835
2999
  ::Thrift::Struct.generate_accessors self
2836
3000
  end
2837
3001
 
3002
+ class FindNoteOffset_args
3003
+ include ::Thrift::Struct, ::Thrift::Struct_Union
3004
+ AUTHENTICATIONTOKEN = 1
3005
+ FILTER = 2
3006
+ GUID = 3
3007
+
3008
+ FIELDS = {
3009
+ AUTHENTICATIONTOKEN => {:type => ::Thrift::Types::STRING, :name => 'authenticationToken'},
3010
+ FILTER => {:type => ::Thrift::Types::STRUCT, :name => 'filter', :class => Evernote::EDAM::NoteStore::NoteFilter},
3011
+ GUID => {:type => ::Thrift::Types::STRING, :name => 'guid'}
3012
+ }
3013
+
3014
+ def struct_fields; FIELDS; end
3015
+
3016
+ def validate
3017
+ end
3018
+
3019
+ ::Thrift::Struct.generate_accessors self
3020
+ end
3021
+
3022
+ class FindNoteOffset_result
3023
+ include ::Thrift::Struct, ::Thrift::Struct_Union
3024
+ SUCCESS = 0
3025
+ USEREXCEPTION = 1
3026
+ SYSTEMEXCEPTION = 2
3027
+ NOTFOUNDEXCEPTION = 3
3028
+
3029
+ FIELDS = {
3030
+ SUCCESS => {:type => ::Thrift::Types::I32, :name => 'success'},
3031
+ USEREXCEPTION => {:type => ::Thrift::Types::STRUCT, :name => 'userException', :class => Evernote::EDAM::Error::EDAMUserException},
3032
+ SYSTEMEXCEPTION => {:type => ::Thrift::Types::STRUCT, :name => 'systemException', :class => Evernote::EDAM::Error::EDAMSystemException},
3033
+ NOTFOUNDEXCEPTION => {:type => ::Thrift::Types::STRUCT, :name => 'notFoundException', :class => Evernote::EDAM::Error::EDAMNotFoundException}
3034
+ }
3035
+
3036
+ def struct_fields; FIELDS; end
3037
+
3038
+ def validate
3039
+ end
3040
+
3041
+ ::Thrift::Struct.generate_accessors self
3042
+ end
3043
+
3044
+ class FindNotesMetadata_args
3045
+ include ::Thrift::Struct, ::Thrift::Struct_Union
3046
+ AUTHENTICATIONTOKEN = 1
3047
+ FILTER = 2
3048
+ OFFSET = 3
3049
+ MAXNOTES = 4
3050
+ RESULTSPEC = 5
3051
+
3052
+ FIELDS = {
3053
+ AUTHENTICATIONTOKEN => {:type => ::Thrift::Types::STRING, :name => 'authenticationToken'},
3054
+ FILTER => {:type => ::Thrift::Types::STRUCT, :name => 'filter', :class => Evernote::EDAM::NoteStore::NoteFilter},
3055
+ OFFSET => {:type => ::Thrift::Types::I32, :name => 'offset'},
3056
+ MAXNOTES => {:type => ::Thrift::Types::I32, :name => 'maxNotes'},
3057
+ RESULTSPEC => {:type => ::Thrift::Types::STRUCT, :name => 'resultSpec', :class => Evernote::EDAM::NoteStore::NotesMetadataResultSpec}
3058
+ }
3059
+
3060
+ def struct_fields; FIELDS; end
3061
+
3062
+ def validate
3063
+ end
3064
+
3065
+ ::Thrift::Struct.generate_accessors self
3066
+ end
3067
+
3068
+ class FindNotesMetadata_result
3069
+ include ::Thrift::Struct, ::Thrift::Struct_Union
3070
+ SUCCESS = 0
3071
+ USEREXCEPTION = 1
3072
+ SYSTEMEXCEPTION = 2
3073
+ NOTFOUNDEXCEPTION = 3
3074
+
3075
+ FIELDS = {
3076
+ SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => Evernote::EDAM::NoteStore::NotesMetadataList},
3077
+ USEREXCEPTION => {:type => ::Thrift::Types::STRUCT, :name => 'userException', :class => Evernote::EDAM::Error::EDAMUserException},
3078
+ SYSTEMEXCEPTION => {:type => ::Thrift::Types::STRUCT, :name => 'systemException', :class => Evernote::EDAM::Error::EDAMSystemException},
3079
+ NOTFOUNDEXCEPTION => {:type => ::Thrift::Types::STRUCT, :name => 'notFoundException', :class => Evernote::EDAM::Error::EDAMNotFoundException}
3080
+ }
3081
+
3082
+ def struct_fields; FIELDS; end
3083
+
3084
+ def validate
3085
+ end
3086
+
3087
+ ::Thrift::Struct.generate_accessors self
3088
+ end
3089
+
2838
3090
  class FindNoteCounts_args
2839
3091
  include ::Thrift::Struct, ::Thrift::Struct_Union
2840
3092
  AUTHENTICATIONTOKEN = 1
@@ -4293,6 +4545,124 @@ require 'note_store_types'
4293
4545
  ::Thrift::Struct.generate_accessors self
4294
4546
  end
4295
4547
 
4548
+ class ShareNote_args
4549
+ include ::Thrift::Struct, ::Thrift::Struct_Union
4550
+ AUTHENTICATIONTOKEN = 1
4551
+ GUID = 2
4552
+
4553
+ FIELDS = {
4554
+ AUTHENTICATIONTOKEN => {:type => ::Thrift::Types::STRING, :name => 'authenticationToken'},
4555
+ GUID => {:type => ::Thrift::Types::STRING, :name => 'guid'}
4556
+ }
4557
+
4558
+ def struct_fields; FIELDS; end
4559
+
4560
+ def validate
4561
+ end
4562
+
4563
+ ::Thrift::Struct.generate_accessors self
4564
+ end
4565
+
4566
+ class ShareNote_result
4567
+ include ::Thrift::Struct, ::Thrift::Struct_Union
4568
+ SUCCESS = 0
4569
+ USEREXCEPTION = 1
4570
+ NOTFOUNDEXCEPTION = 2
4571
+ SYSTEMEXCEPTION = 3
4572
+
4573
+ FIELDS = {
4574
+ SUCCESS => {:type => ::Thrift::Types::STRING, :name => 'success'},
4575
+ USEREXCEPTION => {:type => ::Thrift::Types::STRUCT, :name => 'userException', :class => Evernote::EDAM::Error::EDAMUserException},
4576
+ NOTFOUNDEXCEPTION => {:type => ::Thrift::Types::STRUCT, :name => 'notFoundException', :class => Evernote::EDAM::Error::EDAMNotFoundException},
4577
+ SYSTEMEXCEPTION => {:type => ::Thrift::Types::STRUCT, :name => 'systemException', :class => Evernote::EDAM::Error::EDAMSystemException}
4578
+ }
4579
+
4580
+ def struct_fields; FIELDS; end
4581
+
4582
+ def validate
4583
+ end
4584
+
4585
+ ::Thrift::Struct.generate_accessors self
4586
+ end
4587
+
4588
+ class StopSharingNote_args
4589
+ include ::Thrift::Struct, ::Thrift::Struct_Union
4590
+ AUTHENTICATIONTOKEN = 1
4591
+ GUID = 2
4592
+
4593
+ FIELDS = {
4594
+ AUTHENTICATIONTOKEN => {:type => ::Thrift::Types::STRING, :name => 'authenticationToken'},
4595
+ GUID => {:type => ::Thrift::Types::STRING, :name => 'guid'}
4596
+ }
4597
+
4598
+ def struct_fields; FIELDS; end
4599
+
4600
+ def validate
4601
+ end
4602
+
4603
+ ::Thrift::Struct.generate_accessors self
4604
+ end
4605
+
4606
+ class StopSharingNote_result
4607
+ include ::Thrift::Struct, ::Thrift::Struct_Union
4608
+ USEREXCEPTION = 1
4609
+ NOTFOUNDEXCEPTION = 2
4610
+ SYSTEMEXCEPTION = 3
4611
+
4612
+ FIELDS = {
4613
+ USEREXCEPTION => {:type => ::Thrift::Types::STRUCT, :name => 'userException', :class => Evernote::EDAM::Error::EDAMUserException},
4614
+ NOTFOUNDEXCEPTION => {:type => ::Thrift::Types::STRUCT, :name => 'notFoundException', :class => Evernote::EDAM::Error::EDAMNotFoundException},
4615
+ SYSTEMEXCEPTION => {:type => ::Thrift::Types::STRUCT, :name => 'systemException', :class => Evernote::EDAM::Error::EDAMSystemException}
4616
+ }
4617
+
4618
+ def struct_fields; FIELDS; end
4619
+
4620
+ def validate
4621
+ end
4622
+
4623
+ ::Thrift::Struct.generate_accessors self
4624
+ end
4625
+
4626
+ class AuthenticateToSharedNote_args
4627
+ include ::Thrift::Struct, ::Thrift::Struct_Union
4628
+ GUID = 1
4629
+ NOTEKEY = 2
4630
+
4631
+ FIELDS = {
4632
+ GUID => {:type => ::Thrift::Types::STRING, :name => 'guid'},
4633
+ NOTEKEY => {:type => ::Thrift::Types::STRING, :name => 'noteKey'}
4634
+ }
4635
+
4636
+ def struct_fields; FIELDS; end
4637
+
4638
+ def validate
4639
+ end
4640
+
4641
+ ::Thrift::Struct.generate_accessors self
4642
+ end
4643
+
4644
+ class AuthenticateToSharedNote_result
4645
+ include ::Thrift::Struct, ::Thrift::Struct_Union
4646
+ SUCCESS = 0
4647
+ USEREXCEPTION = 1
4648
+ NOTFOUNDEXCEPTION = 2
4649
+ SYSTEMEXCEPTION = 3
4650
+
4651
+ FIELDS = {
4652
+ SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => Evernote::EDAM::UserStore::AuthenticationResult},
4653
+ USEREXCEPTION => {:type => ::Thrift::Types::STRUCT, :name => 'userException', :class => Evernote::EDAM::Error::EDAMUserException},
4654
+ NOTFOUNDEXCEPTION => {:type => ::Thrift::Types::STRUCT, :name => 'notFoundException', :class => Evernote::EDAM::Error::EDAMNotFoundException},
4655
+ SYSTEMEXCEPTION => {:type => ::Thrift::Types::STRUCT, :name => 'systemException', :class => Evernote::EDAM::Error::EDAMSystemException}
4656
+ }
4657
+
4658
+ def struct_fields; FIELDS; end
4659
+
4660
+ def validate
4661
+ end
4662
+
4663
+ ::Thrift::Struct.generate_accessors self
4664
+ end
4665
+
4296
4666
  end
4297
4667
 
4298
4668
  end
@@ -243,7 +243,8 @@ module Evernote
243
243
  #
244
244
  # <dt>words</dt>
245
245
  # <dd>
246
- # The string query containing keywords to match, if present.
246
+ # If present, a search query string that will filter the set of notes to be returned.
247
+ # Accepts the full search grammar documented in the Evernote API Overview.
247
248
  # </dd>
248
249
  #
249
250
  # <dt>notebookGuid</dt>
@@ -381,6 +382,190 @@ module Evernote
381
382
  ::Thrift::Struct.generate_accessors self
382
383
  end
383
384
 
385
+ # * This structure is used in the set of results returned by the
386
+ # * findNotesMetadata function. It represents the high-level information about
387
+ # * a single Note, without some of the larger deep structure. This allows
388
+ # * for the information about a list of Notes to be returned relatively quickly
389
+ # * with less marshalling and data transfer to remote clients.
390
+ # * Most fields in this structure are identical to the corresponding field in
391
+ # * the Note structure, with the exception of:
392
+ # *
393
+ # * <dl>
394
+ # * <dt>largestResourceMime</dt>
395
+ # * <dd>If set, then this will contain the MIME type of the largest Resource
396
+ # * (in bytes) within the Note. This may be useful, for example, to choose
397
+ # * an appropriate icon or thumbnail to represent the Note.
398
+ # * </dd>
399
+ # *
400
+ # * <dt>largestResourceSize</dt>
401
+ # * <dd>If set, this will contain the size of the largest Resource file, in
402
+ # * bytes, within the Note. This may be useful, for example, to decide whether
403
+ # * to ask the server for a thumbnail to represent the Note.
404
+ # * </dd>
405
+ # * </dl>
406
+ class NoteMetadata
407
+ include ::Thrift::Struct, ::Thrift::Struct_Union
408
+ GUID = 1
409
+ TITLE = 2
410
+ CONTENTLENGTH = 5
411
+ CREATED = 6
412
+ UPDATED = 7
413
+ UPDATESEQUENCENUM = 10
414
+ NOTEBOOKGUID = 11
415
+ TAGGUIDS = 12
416
+ ATTRIBUTES = 14
417
+ LARGESTRESOURCEMIME = 20
418
+ LARGESTRESOURCESIZE = 21
419
+
420
+ FIELDS = {
421
+ GUID => {:type => ::Thrift::Types::STRING, :name => 'guid'},
422
+ TITLE => {:type => ::Thrift::Types::STRING, :name => 'title', :optional => true},
423
+ CONTENTLENGTH => {:type => ::Thrift::Types::I32, :name => 'contentLength', :optional => true},
424
+ CREATED => {:type => ::Thrift::Types::I64, :name => 'created', :optional => true},
425
+ UPDATED => {:type => ::Thrift::Types::I64, :name => 'updated', :optional => true},
426
+ UPDATESEQUENCENUM => {:type => ::Thrift::Types::I32, :name => 'updateSequenceNum', :optional => true},
427
+ NOTEBOOKGUID => {:type => ::Thrift::Types::STRING, :name => 'notebookGuid', :optional => true},
428
+ TAGGUIDS => {:type => ::Thrift::Types::LIST, :name => 'tagGuids', :element => {:type => ::Thrift::Types::STRING}, :optional => true},
429
+ ATTRIBUTES => {:type => ::Thrift::Types::STRUCT, :name => 'attributes', :class => Evernote::EDAM::Type::NoteAttributes, :optional => true},
430
+ LARGESTRESOURCEMIME => {:type => ::Thrift::Types::STRING, :name => 'largestResourceMime', :optional => true},
431
+ LARGESTRESOURCESIZE => {:type => ::Thrift::Types::I32, :name => 'largestResourceSize', :optional => true}
432
+ }
433
+
434
+ def struct_fields; FIELDS; end
435
+
436
+ def validate
437
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field guid is unset!') unless @guid
438
+ end
439
+
440
+ ::Thrift::Struct.generate_accessors self
441
+ end
442
+
443
+ # This structure is returned from calls to the findNotesMetadata function to
444
+ # give the high-level metadata about a subset of Notes that are found to
445
+ # match a specified NoteFilter in a search.
446
+ #
447
+ # <dl>
448
+ # <dt>startIndex</dt>
449
+ # <dd>
450
+ # The starting index within the overall set of notes. This
451
+ # is also the number of notes that are "before" this list in the set.
452
+ # </dd>
453
+ #
454
+ # <dt>totalNotes</dt>
455
+ # <dd>
456
+ # The number of notes in the larger set. This can be used
457
+ # to calculate how many notes are "after" this note in the set.
458
+ # (I.e. remaining = totalNotes - (startIndex + notes.length) )
459
+ # </dd>
460
+ #
461
+ # <dt>notes</dt>
462
+ # <dd>
463
+ # The list of metadata for Notes in this range. The set of optional fields
464
+ # that are set in each metadata structure will depend on the
465
+ # NotesMetadataResultSpec provided by the caller when the search was
466
+ # performed. Only the 'guid' field will be guaranteed to be set in each
467
+ # Note.
468
+ # </dd>
469
+ #
470
+ # <dt>stoppedWords</dt>
471
+ # <dd>
472
+ # If the NoteList was produced using a text based search
473
+ # query that included words that are not indexed or searched by the service,
474
+ # this will include a list of those ignored words.
475
+ # </dd>
476
+ #
477
+ # <dt>searchedWords</dt>
478
+ # <dd>
479
+ # If the NoteList was produced using a text based search
480
+ # query that included viable search words or quoted expressions, this will
481
+ # include a list of those words. Any stopped words will not be included
482
+ # in this list.
483
+ # </dd>
484
+ #
485
+ # <dt>updateCount</dt>
486
+ # <dd>
487
+ # Indicates the total number of transactions that have
488
+ # been committed within the account. This reflects (for example) the
489
+ # number of discrete additions or modifications that have been made to
490
+ # the data in this account (tags, notes, resources, etc.).
491
+ # This number is the "high water mark" for Update Sequence Numbers (USN)
492
+ # within the account.
493
+ # </dd>
494
+ # </dl>
495
+ class NotesMetadataList
496
+ include ::Thrift::Struct, ::Thrift::Struct_Union
497
+ STARTINDEX = 1
498
+ TOTALNOTES = 2
499
+ NOTES = 3
500
+ STOPPEDWORDS = 4
501
+ SEARCHEDWORDS = 5
502
+ UPDATECOUNT = 6
503
+
504
+ FIELDS = {
505
+ STARTINDEX => {:type => ::Thrift::Types::I32, :name => 'startIndex'},
506
+ TOTALNOTES => {:type => ::Thrift::Types::I32, :name => 'totalNotes'},
507
+ NOTES => {:type => ::Thrift::Types::LIST, :name => 'notes', :element => {:type => ::Thrift::Types::STRUCT, :class => Evernote::EDAM::NoteStore::NoteMetadata}},
508
+ STOPPEDWORDS => {:type => ::Thrift::Types::LIST, :name => 'stoppedWords', :element => {:type => ::Thrift::Types::STRING}, :optional => true},
509
+ SEARCHEDWORDS => {:type => ::Thrift::Types::LIST, :name => 'searchedWords', :element => {:type => ::Thrift::Types::STRING}, :optional => true},
510
+ UPDATECOUNT => {:type => ::Thrift::Types::I32, :name => 'updateCount', :optional => true}
511
+ }
512
+
513
+ def struct_fields; FIELDS; end
514
+
515
+ def validate
516
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field startIndex is unset!') unless @startIndex
517
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field totalNotes is unset!') unless @totalNotes
518
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field notes is unset!') unless @notes
519
+ end
520
+
521
+ ::Thrift::Struct.generate_accessors self
522
+ end
523
+
524
+ # This structure is provided to the findNotesMetadata function to specify
525
+ # the subset of fields that should be included in each NoteMetadata element
526
+ # that is returned in the NotesMetadataList.
527
+ # Each field on this structure is a boolean flag that indicates whether the
528
+ # corresponding field should be included in the NoteMetadata structure when
529
+ # it is returned. For example, if the 'includeTitle' field is set on this
530
+ # structure when calling findNotesMetadata, then each NoteMetadata in the
531
+ # list should have its 'title' field set.
532
+ # If one of the fields in this spec is not set, then it will be treated as
533
+ # 'false' by the server, so the default behavior is to include nothing in
534
+ # replies (but the mandatory GUID)
535
+ class NotesMetadataResultSpec
536
+ include ::Thrift::Struct, ::Thrift::Struct_Union
537
+ INCLUDETITLE = 2
538
+ INCLUDECONTENTLENGTH = 5
539
+ INCLUDECREATED = 6
540
+ INCLUDEUPDATED = 7
541
+ INCLUDEUPDATESEQUENCENUM = 10
542
+ INCLUDENOTEBOOKGUID = 11
543
+ INCLUDETAGGUIDS = 12
544
+ INCLUDEATTRIBUTES = 14
545
+ INCLUDELARGESTRESOURCEMIME = 20
546
+ INCLUDELARGESTRESOURCESIZE = 21
547
+
548
+ FIELDS = {
549
+ INCLUDETITLE => {:type => ::Thrift::Types::BOOL, :name => 'includeTitle', :optional => true},
550
+ INCLUDECONTENTLENGTH => {:type => ::Thrift::Types::BOOL, :name => 'includeContentLength', :optional => true},
551
+ INCLUDECREATED => {:type => ::Thrift::Types::BOOL, :name => 'includeCreated', :optional => true},
552
+ INCLUDEUPDATED => {:type => ::Thrift::Types::BOOL, :name => 'includeUpdated', :optional => true},
553
+ INCLUDEUPDATESEQUENCENUM => {:type => ::Thrift::Types::BOOL, :name => 'includeUpdateSequenceNum', :optional => true},
554
+ INCLUDENOTEBOOKGUID => {:type => ::Thrift::Types::BOOL, :name => 'includeNotebookGuid', :optional => true},
555
+ INCLUDETAGGUIDS => {:type => ::Thrift::Types::BOOL, :name => 'includeTagGuids', :optional => true},
556
+ INCLUDEATTRIBUTES => {:type => ::Thrift::Types::BOOL, :name => 'includeAttributes', :optional => true},
557
+ INCLUDELARGESTRESOURCEMIME => {:type => ::Thrift::Types::BOOL, :name => 'includeLargestResourceMime', :optional => true},
558
+ INCLUDELARGESTRESOURCESIZE => {:type => ::Thrift::Types::BOOL, :name => 'includeLargestResourceSize', :optional => true}
559
+ }
560
+
561
+ def struct_fields; FIELDS; end
562
+
563
+ def validate
564
+ end
565
+
566
+ ::Thrift::Struct.generate_accessors self
567
+ end
568
+
384
569
  # A data structure representing the number of notes for each notebook
385
570
  # and tag with a non-zero set of applicable notes.
386
571
  #
@@ -239,20 +239,21 @@ module Evernote
239
239
  # when processing images and PDF files to find text.
240
240
  # If not set, then the 'preferredLanguage' will be used.
241
241
  # </dd>
242
- # </dl>
243
242
  #
244
243
  # <dt>customerProfileId</dt>
245
244
  # <dd>a numeric identified which provides a linkage between the user record
246
245
  # and the direct credit card payment creditcard profile.
247
246
  # </dd>
248
- # </dl>
249
247
  #
250
248
  # <dt>educationalInstitution</dt>
251
249
  # <dd>a flag indicating that the user is part of an educational institution which
252
250
  # makes them eligible for discounts on bulk purchases
253
251
  # </dd>
254
- # </dl>
255
252
  #
253
+ # <dt>businessAddress</dt>
254
+ # <dd>A string recording the business address of a Sponsored Account user who has requested invoicing.
255
+ # </dd>
256
+ # </dl>
256
257
  class UserAttributes
257
258
  include ::Thrift::Struct, ::Thrift::Struct_Union
258
259
  DEFAULTLOCATIONNAME = 1
@@ -282,6 +283,7 @@ module Evernote
282
283
  CUSTOMERPROFILEID = 27
283
284
  REFERRALPROOF = 28
284
285
  EDUCATIONALDISCOUNT = 29
286
+ BUSINESSADDRESS = 30
285
287
 
286
288
  FIELDS = {
287
289
  DEFAULTLOCATIONNAME => {:type => ::Thrift::Types::STRING, :name => 'defaultLocationName', :optional => true},
@@ -310,7 +312,8 @@ module Evernote
310
312
  RECOGNITIONLANGUAGE => {:type => ::Thrift::Types::STRING, :name => 'recognitionLanguage', :optional => true},
311
313
  CUSTOMERPROFILEID => {:type => ::Thrift::Types::I64, :name => 'customerProfileId', :optional => true},
312
314
  REFERRALPROOF => {:type => ::Thrift::Types::STRING, :name => 'referralProof', :optional => true},
313
- EDUCATIONALDISCOUNT => {:type => ::Thrift::Types::BOOL, :name => 'educationalDiscount', :optional => true}
315
+ EDUCATIONALDISCOUNT => {:type => ::Thrift::Types::BOOL, :name => 'educationalDiscount', :optional => true},
316
+ BUSINESSADDRESS => {:type => ::Thrift::Types::STRING, :name => 'businessAddress', :optional => true}
314
317
  }
315
318
 
316
319
  def struct_fields; FIELDS; end
@@ -390,6 +393,12 @@ module Evernote
390
393
  # <dd>The number number identifying the
391
394
  # recurring subscription used to make the recurring charges.
392
395
  # </dd>
396
+ # <dt>lastRequestedCharge</dt>
397
+ # <dd>Date charge last attempted</dd>
398
+ # <dt>currency</dt>
399
+ # <dd>ISO 4217 currency code</dd>
400
+ # <dt>unitPrice</dt>
401
+ # <dd>charge in the smallest unit of the currency (e.g. cents for USD)</dd>
393
402
  # </dl>
394
403
  class Accounting
395
404
  include ::Thrift::Struct, ::Thrift::Struct_Union
@@ -409,6 +418,8 @@ module Evernote
409
418
  UPDATED = 14
410
419
  PREMIUMSUBSCRIPTIONNUMBER = 16
411
420
  LASTREQUESTEDCHARGE = 17
421
+ CURRENCY = 18
422
+ UNITPRICE = 19
412
423
 
413
424
  FIELDS = {
414
425
  UPLOADLIMIT => {:type => ::Thrift::Types::I64, :name => 'uploadLimit', :optional => true},
@@ -426,7 +437,9 @@ module Evernote
426
437
  PREMIUMLOCKUNTIL => {:type => ::Thrift::Types::I64, :name => 'premiumLockUntil', :optional => true},
427
438
  UPDATED => {:type => ::Thrift::Types::I64, :name => 'updated', :optional => true},
428
439
  PREMIUMSUBSCRIPTIONNUMBER => {:type => ::Thrift::Types::STRING, :name => 'premiumSubscriptionNumber', :optional => true},
429
- LASTREQUESTEDCHARGE => {:type => ::Thrift::Types::I64, :name => 'lastRequestedCharge', :optional => true}
440
+ LASTREQUESTEDCHARGE => {:type => ::Thrift::Types::I64, :name => 'lastRequestedCharge', :optional => true},
441
+ CURRENCY => {:type => ::Thrift::Types::STRING, :name => 'currency', :optional => true},
442
+ UNITPRICE => {:type => ::Thrift::Types::I32, :name => 'unitPrice', :optional => true}
430
443
  }
431
444
 
432
445
  def struct_fields; FIELDS; end
@@ -899,6 +912,15 @@ module Evernote
899
912
  # <br/>
900
913
  # Length: EDAM_ATTRIBUTE_LEN_MIN - EDAM_ATTRIBUTE_LEN_MAX
901
914
  # </dd>
915
+ #
916
+ # <dt>shareDate</dt>
917
+ # <dd>The date and time when this note was directly shared via its own URL.
918
+ # This is only set on notes that were individually shared, it's independent
919
+ # of any notebook-level sharing of the containing notepbook. This field
920
+ # is treated as "read-only" for clients ... the server will ignore changes
921
+ # to this field from an external client.
922
+ # </dd>
923
+ #
902
924
  # </dl>
903
925
  class NoteAttributes
904
926
  include ::Thrift::Struct, ::Thrift::Struct_Union
@@ -910,6 +932,7 @@ module Evernote
910
932
  SOURCE = 14
911
933
  SOURCEURL = 15
912
934
  SOURCEAPPLICATION = 16
935
+ SHAREDATE = 17
913
936
 
914
937
  FIELDS = {
915
938
  SUBJECTDATE => {:type => ::Thrift::Types::I64, :name => 'subjectDate', :optional => true},
@@ -919,7 +942,8 @@ module Evernote
919
942
  AUTHOR => {:type => ::Thrift::Types::STRING, :name => 'author', :optional => true},
920
943
  SOURCE => {:type => ::Thrift::Types::STRING, :name => 'source', :optional => true},
921
944
  SOURCEURL => {:type => ::Thrift::Types::STRING, :name => 'sourceURL', :optional => true},
922
- SOURCEAPPLICATION => {:type => ::Thrift::Types::STRING, :name => 'sourceApplication', :optional => true}
945
+ SOURCEAPPLICATION => {:type => ::Thrift::Types::STRING, :name => 'sourceApplication', :optional => true},
946
+ SHAREDATE => {:type => ::Thrift::Types::I64, :name => 'shareDate', :optional => true}
923
947
  }
924
948
 
925
949
  def struct_fields; FIELDS; end
@@ -1410,6 +1434,10 @@ module Evernote
1410
1434
  # ad should be displayed in the daily set of ads, relative to a base
1411
1435
  # frequency of 1.0. I.e. an ad with a frequency of 3.0 should be displayed
1412
1436
  # three times more frequently than an ad with a frequency of 1.0.</dd>
1437
+ #
1438
+ # <dt>openInTrunk</dt>
1439
+ # <dd>If true, the ad should be opened in the embedded Trunk window by
1440
+ # clients with Trunk support.</dd>
1413
1441
  # </dl>
1414
1442
  class Ad
1415
1443
  include ::Thrift::Struct, ::Thrift::Struct_Union
@@ -1425,6 +1453,7 @@ module Evernote
1425
1453
  IMAGEMIME = 10
1426
1454
  HTML = 11
1427
1455
  DISPLAYFREQUENCY = 12
1456
+ OPENINTRUNK = 13
1428
1457
 
1429
1458
  FIELDS = {
1430
1459
  ID => {:type => ::Thrift::Types::I32, :name => 'id', :optional => true},
@@ -1438,7 +1467,8 @@ module Evernote
1438
1467
  IMAGE => {:type => ::Thrift::Types::STRING, :name => 'image', :binary => true, :optional => true},
1439
1468
  IMAGEMIME => {:type => ::Thrift::Types::STRING, :name => 'imageMime', :optional => true},
1440
1469
  HTML => {:type => ::Thrift::Types::STRING, :name => 'html', :optional => true},
1441
- DISPLAYFREQUENCY => {:type => ::Thrift::Types::DOUBLE, :name => 'displayFrequency', :optional => true}
1470
+ DISPLAYFREQUENCY => {:type => ::Thrift::Types::DOUBLE, :name => 'displayFrequency', :optional => true},
1471
+ OPENINTRUNK => {:type => ::Thrift::Types::BOOL, :name => 'openInTrunk', :optional => true}
1442
1472
  }
1443
1473
 
1444
1474
  def struct_fields; FIELDS; end
@@ -177,7 +177,7 @@ require 'user_store_types'
177
177
  FIELDS = {
178
178
  CLIENTNAME => {:type => ::Thrift::Types::STRING, :name => 'clientName'},
179
179
  EDAMVERSIONMAJOR => {:type => ::Thrift::Types::I16, :name => 'edamVersionMajor', :default => 1},
180
- EDAMVERSIONMINOR => {:type => ::Thrift::Types::I16, :name => 'edamVersionMinor', :default => 17}
180
+ EDAMVERSIONMINOR => {:type => ::Thrift::Types::I16, :name => 'edamVersionMinor', :default => 19}
181
181
  }
182
182
 
183
183
  def struct_fields; FIELDS; end
@@ -11,7 +11,7 @@ require 'user_store_types'
11
11
  module UserStore
12
12
  EDAM_VERSION_MAJOR = 1
13
13
 
14
- EDAM_VERSION_MINOR = 17
14
+ EDAM_VERSION_MINOR = 19
15
15
 
16
16
  end
17
17
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: evernote
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,12 +9,12 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-06-28 00:00:00.000000000 -05:00
12
+ date: 2011-07-23 00:00:00.000000000 -05:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: thrift_client
17
- requirement: &2165422040 !ruby/object:Gem::Requirement
17
+ requirement: &2153483380 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: '0'
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *2165422040
25
+ version_requirements: *2153483380
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: rspec
28
- requirement: &2165421580 !ruby/object:Gem::Requirement
28
+ requirement: &2153482920 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ! '>='
@@ -33,10 +33,10 @@ dependencies:
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
- version_requirements: *2165421580
36
+ version_requirements: *2153482920
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: yard
39
- requirement: &2165421160 !ruby/object:Gem::Requirement
39
+ requirement: &2153509100 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
42
  - - ! '>='
@@ -44,7 +44,7 @@ dependencies:
44
44
  version: '0'
45
45
  type: :development
46
46
  prerelease: false
47
- version_requirements: *2165421160
47
+ version_requirements: *2153509100
48
48
  description: A high level wrapper around Evernote's Thrift-generated ruby code. It
49
49
  bundles up Evernote's thrift-generated code and creates some simple wrapper classes.
50
50
  email:
@@ -63,6 +63,7 @@ files:
63
63
  - spec/evernote/note_store_spec.rb
64
64
  - spec/evernote/user_store_spec.rb
65
65
  - spec/spec_helper.rb
66
+ - vendor/gen-rb/evernote/edam/errors_constants.rb
66
67
  - vendor/gen-rb/evernote/edam/errors_types.rb
67
68
  - vendor/gen-rb/evernote/edam/limits_constants.rb
68
69
  - vendor/gen-rb/evernote/edam/limits_types.rb
@@ -79,6 +80,7 @@ files:
79
80
  - README.mkd
80
81
  - Rakefile
81
82
  - .gitignore
83
+ - example.rb
82
84
  has_rdoc: true
83
85
  homepage: http://github.com/cgs/evernote
84
86
  licenses: []