/
Types.thrift
executable file
·1965 lines (1905 loc) · 70.3 KB
/
Types.thrift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
* Copyright 2007-2012 Evernote Corporation.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* This file contains the definitions of the Evernote data model as it
* is represented through the EDAM protocol. This is the "client-independent"
* view of the contents of a user's account. Each client will translate the
* neutral data model into an appropriate form for storage on that client.
*/
include "Limits.thrift"
namespace as3 com.evernote.edam.type
namespace java com.evernote.edam.type
namespace csharp Evernote.EDAM.Type
namespace py evernote.edam.type
namespace cpp evernote.edam
namespace rb Evernote.EDAM.Type
namespace php EDAM.Types
namespace cocoa EDAM
namespace perl EDAMTypes
// =============================== typedefs ====================================
/**
* Every Evernote account is assigned a unique numeric identifier which
* will not change for the life of the account. This is independent of
* the (string-based) "username" which is known by the user for login
* purposes. The user should have no reason to know their UserID.
*/
typedef i32 UserID
/**
* Most data elements within a user's account (e.g. notebooks, notes, tags,
* resources, etc.) are internally referred to using a globally unique
* identifier that is written in a standard string format. For example:
*
* "8743428c-ef91-4d05-9e7c-4a2e856e813a"
*
* The internal components of the GUID are not given any particular meaning:
* only the entire string is relevant as a unique identifier.
*/
typedef string Guid
/**
* An Evernote Timestamp is the date and time of an event in UTC time.
* This is expressed as a specific number of milliseconds since the
* standard base "epoch" of:
*
* January 1, 1970, 00:00:00 GMT
*
* NOTE: the time is expressed at the resolution of milliseconds, but
* the value is only precise to the level of seconds. This means that
* the last three (decimal) digits of the timestamp will be '000'.
*
* The Thrift IDL specification does not include a native date/time type,
* so this value is used instead.
*
* The service will accept timestamp values (e.g. for Note created and update
* times) between 1000-01-01 and 9999-12-31
*/
typedef i64 Timestamp
// ============================= Enumerations ==================================
/**
* This enumeration defines the possible permission levels for a user.
* Free accounts will have a level of NORMAL and paid Premium accounts
* will have a level of PREMIUM.
*/
enum PrivilegeLevel {
NORMAL = 1,
PREMIUM = 3,
MANAGER = 7,
SUPPORT = 8,
ADMIN = 9
}
/**
* Every search query is specified as a sequence of characters.
* Currently, only the USER query format is supported.
*/
enum QueryFormat {
USER = 1,
SEXP = 2
}
/**
* This enumeration defines the possible sort ordering for notes when
* they are returned from a search result.
*/
enum NoteSortOrder {
CREATED = 1,
UPDATED = 2,
RELEVANCE = 3,
UPDATE_SEQUENCE_NUMBER = 4,
TITLE = 5
}
/**
* This enumeration defines the possible states of a premium account
*
* NONE: the user has never attempted to become a premium subscriber
*
* PENDING: the user has requested a premium account but their charge has not
* been confirmed
*
* ACTIVE: the user has been charged and their premium account is in good
* standing
*
* FAILED: the system attempted to charge the was denied. Their premium
* privileges have been revoked. We will periodically attempt to re-validate
* their order.
*
* CANCELLATION_PENDING: the user has requested that no further charges be made
* but the current account is still active.
*
* CANCELED: the premium account was canceled either because of failure to pay
* or user cancelation. No more attempts will be made to activate the account.
*/
enum PremiumOrderStatus {
NONE = 0,
PENDING = 1,
ACTIVE = 2,
FAILED = 3,
CANCELLATION_PENDING = 4,
CANCELED = 5
}
/**
* Privilege levels for accessing shared notebooks.
*
* READ_NOTEBOOK: Recipient is able to read the contents of the shared notebook
* but does to have access to information about other recipients of the
* notebook or the activity stream information.
*
* MODIFY_NOTEBOOK_PLUS_ACTIVITY: Recipient has rights to read and modify the contents
* of the shared notebook, including the right to move notes to the trash and to create
* notes in the notebook. The recipient can also access information about other
* recipients and the activity stream.
*
* READ_NOTEBOOK_PLUS_ACTIVITY: Recipient has READ_NOTEBOOK rights and can also
* access information about other recipients and the activity stream.
*
* GROUP: If the user belongs to a group, such as a Business, that has a defined
* privilege level, use the privilege level of the group as the privilege for
* the individual.
*
* FULL_ACCESS: Recipient has full rights to the shared notebook and recipient lists,
* including privilege to revoke and create invitations and to change privilege
* levels on invitations for individuals. This privilege level is primarily intended
* for use by individual shares.
*
* BUSINESS_FULL_ACCESS: Intended for use with Business Notebooks, a
* BUSINESS_FULL_ACCESS level is FULL_ACCESS with the additional rights to
* change how the notebook will appear in the business library, including the
* rights to publish and unpublish the notebook from the library.
*/
enum SharedNotebookPrivilegeLevel {
READ_NOTEBOOK = 0,
MODIFY_NOTEBOOK_PLUS_ACTIVITY = 1,
READ_NOTEBOOK_PLUS_ACTIVITY = 2,
GROUP = 3,
FULL_ACCESS = 4,
BUSINESS_FULL_ACCESS = 5
}
/**
* Enumeration of the roles that a User can have within a sponsored group.
*
* GROUP_MEMBER: The user is a member of the group with no special privileges.
*
* GROUP_ADMIN: The user is an administrator within the group.
*
* GROUP_OWNER: The user is the owner of the group.
*/
enum SponsoredGroupRole {
GROUP_MEMBER = 1,
GROUP_ADMIN = 2,
GROUP_OWNER = 3
}
/**
* Enumeration of the roles that a User can have within an Evernote Business account.
*
* ADMIN: The user is an administrator of the Evernote Business account.
*
* NORMAL: The user is a regular user within the Evernote Business account.
*/
enum BusinessUserRole {
ADMIN = 1,
NORMAL = 2,
}
/**
* An enumeration describing restrictions on the domain of shared notebook
* instances that are valid for a given operation, as used, for example, in
* NotebookRestrictions.
*
* ONLY_JOINED_OR_PREVIEW: The domain consists of shared notebooks that
* "belong" to the recipient or still available for preview by any recipient.
* Shared notebooks that the recipient has joined (the username has already been
* assigned to our user) are in the domain. Additionally, shared notebooks
* that allow preview and have not yet been joined are in the domain.
*
* NO_SHARED_NOTEBOOKS: No shared notebooks are applicable to the operation.
*/
enum SharedNotebookInstanceRestrictions {
ONLY_JOINED_OR_PREVIEW = 1,
NO_SHARED_NOTEBOOKS = 2 // most restrictive
}
// ============================== Constants ===================================
/**
* A value for the "recipe" key in the "classifications" map in NoteAttributes
* that indicates the user has classified a note as being a non-recipe.
*/
const string CLASSIFICATION_RECIPE_USER_NON_RECIPE = "000";
/**
* A value for the "recipe" key in the "classifications" map in NoteAttributes
* that indicates the user has classified a note as being a recipe.
*/
const string CLASSIFICATION_RECIPE_USER_RECIPE = "001";
/**
* A value for the "recipe" key in the "classifications" map in NoteAttributes
* that indicates the Evernote service has classified a note as being a recipe.
*/
const string CLASSIFICATION_RECIPE_SERVICE_RECIPE = "002";
/**
* Standardized value for the 'source' NoteAttribute for notes that
* were clipped from the web in some manner.
*/
const string EDAM_NOTE_SOURCE_WEB_CLIP = "web.clip";
/**
* Standardized value for the 'source' NoteAttribute for notes that
* were clipped from an email message.
*/
const string EDAM_NOTE_SOURCE_MAIL_CLIP = "mail.clip";
/**
* Standardized value for the 'source' NoteAttribute for notes that
* were created via email sent to Evernote's email interface.
*/
const string EDAM_NOTE_SOURCE_MAIL_SMTP_GATEWAY = "mail.smtp";
// ============================== Structures ===================================
/**
* In several places, EDAM exchanges blocks of bytes of data for a component
* which may be relatively large. For example: the contents of a clipped
* HTML note, the bytes of an embedded image, or the recognition XML for
* a large image. This structure is used in the protocol to represent
* any of those large blocks of data when they are transmitted or when
* they are only referenced their metadata.
*
*<dl>
* <dt>bodyHash</dt>
* <dd>This field carries a one-way hash of the contents of the
* data body, in binary form. The hash function is MD5<br/>
* Length: EDAM_HASH_LEN (exactly)
* </dd>
*
* <dt>size</dt>
* <dd>The length, in bytes, of the data body.
* </dd>
*
* <dt>body</dt>
* <dd>This field is set to contain the binary contents of the data
* whenever the resource is being transferred. If only metadata is
* being exchanged, this field will be empty. For example, a client could
* notify the service about the change to an attribute for a resource
* without transmitting the binary resource contents.
* </dd>
* </dl>
*/
struct Data {
1: optional binary bodyHash,
2: optional i32 size,
3: optional binary body
}
/**
* A structure holding the optional attributes that can be stored
* on a User. These are generally less critical than the core User fields.
*
*<dl>
* <dt>defaultLocationName</dt>
* <dd>the location string that should be associated
* with the user in order to determine where notes are taken if not otherwise
* specified.<br/>
* Length: EDAM_ATTRIBUTE_LEN_MIN - EDAM_ATTRIBUTE_LEN_MAX
* </dd>
*
* <dt>defaultLatitude</dt>
* <dd>if set, this is the latitude that should be
* assigned to any notes that have no other latitude information.
* </dd>
*
* <dt>defaultLongitude</dt>
* <dd>if set, this is the longitude that should be
* assigned to any notes that have no other longitude information.
* </dd>
*
* <dt>preactivation</dt>
* <dd>if set, the user account is not yet confirmed for
* login. I.e. the account has been created, but we are still waiting for
* the user to complete the activation step.
* </dd>
*
* <dt>viewedPromotions</dt>
* <dd>a list of promotions the user has seen.
* This list may occasionally be modified by the system when promotions are
* no longer available.<br/>
* Length: EDAM_ATTRIBUTE_LEN_MIN - EDAM_ATTRIBUTE_LEN_MAX
* </dd>
*
* <dt>incomingEmailAddress</dt>
* <dd>if set, this is the email address that the
* user may send email to in order to add an email note directly into the
* account via the SMTP email gateway. This is the part of the email
* address before the '@' symbol ... our domain is not included.
* If this is not set, the user may not add notes via the gateway.<br/>
* Length: EDAM_ATTRIBUTE_LEN_MIN - EDAM_ATTRIBUTE_LEN_MAX
* </dd>
*
* <dt>recentMailedAddresses</dt>
* <dd>if set, this will contain a list of email
* addresses that have recently been used as recipients
* of outbound emails by the user. This can be used to pre-populate a
* list of possible destinations when a user wishes to send a note via
* email.<br/>
* Length: EDAM_ATTRIBUTE_LEN_MIN - EDAM_ATTRIBUTE_LEN_MAX each<br/>
* Max: EDAM_USER_RECENT_MAILED_ADDRESSES_MAX entries
* </dd>
*
* <dt>comments</dt>
* <dd>Free-form text field that may hold general support
* information, etc.<br/>
* Length: EDAM_ATTRIBUTE_LEN_MIN - EDAM_ATTRIBUTE_LEN_MAX
* </dd>
*
* <dt>dateAgreedToTermsOfService</dt>
* <dd>The date/time when the user agreed to
* the terms of service. This can be used as the effective "start date"
* for the account.
* </dd>
*
* <dt>maxReferrals</dt>
* <dd>The number of referrals that the user is permitted
* to make.
* </dd>
*
* <dt>referralCount</dt>
* <dd>The number of referrals sent from this account.
* </dd>
*
* <dt>refererCode</dt>
* <dd>A code indicating where the user was sent from. AKA
* promotion code
* </dd>
*
* <dt>sentEmailDate</dt>
* <dd>The most recent date when the user sent outbound
* emails from the service. Used with sentEmailCount to limit the number
* of emails that can be sent per day.
* </dd>
*
* <dt>sentEmailCount</dt>
* <dd>The number of emails that were sent from the user
* via the service on sentEmailDate. Used to enforce a limit on the number
* of emails per user per day to prevent spamming.
* </dd>
*
* <dt>dailyEmailLimit</dt>
* <dd>If set, this is the maximum number of emails that
* may be sent in a given day from this account. If unset, the server will
* use the configured default limit.
* </dd>
*
* <dt>emailOptOutDate</dt>
* <dd>If set, this is the date when the user asked
* to be excluded from offers and promotions sent by Evernote. If not set,
* then the user currently agrees to receive these messages.
* </dd>
*
* <dt>partnerEmailOptInDate</dt>
* <dd>If set, this is the date when the user asked
* to be included in offers and promotions sent by Evernote's partners.
* If not sent, then the user currently does not agree to receive these
* emails.
* </dd>
*
* <dt>preferredLanguage</dt>
* <dd>a 2 character language codes based on:
* http://ftp.ics.uci.edu/pub/ietf/http/related/iso639.txt used for
* localization purposes to determine what language to use for the web
* interface and for other direct communication (e.g. emails).
* </dd>
*
* <dt>preferredCountry</dt>
* <dd>Preferred country code based on ISO 3166-1-alpha-2 indicating the
* users preferred country</dd>
*
* <dt>clipFullPage</dt>
* <dd>Boolean flag set to true if the user wants to clip full pages by
* default when they use the web clipper without a selection.</dd>
*
* <dt>twitterUserName</dt>
* <dd>The username of the account of someone who has chosen to enable
* Twittering into Evernote. This value is subject to change, since users
* may change their Twitter user name.</dd>
*
* <dt>twitterId</dt>
* <dd>The unique identifier of the user's Twitter account if that user
* has chosen to enable Twittering into Evernote.</dd>
*
* <dt>groupName</dt>
* <dd>A name identifier used to identify a particular set of branding and
* light customization.</dd>
*
* <dt>recognitionLanguage</dt>
* <dd>a 2 character language codes based on:
* http://ftp.ics.uci.edu/pub/ietf/http/related/iso639.txt
* If set, this is used to determine the language that should be used
* when processing images and PDF files to find text.
* If not set, then the 'preferredLanguage' will be used.
* </dd>
*
* <dt>customerProfileId</dt>
* <dd>a numeric identified which provides a linkage between the user record
* and the direct credit card payment creditcard profile.
* </dd>
*
* <dt>educationalInstitution</dt>
* <dd>a flag indicating that the user is part of an educational institution which
* makes them eligible for discounts on bulk purchases
* </dd>
*
* <dt>businessAddress</dt>
* <dd>A string recording the business address of a Sponsored Account user who has requested invoicing.
* </dd>
* </dl>
*
* <dt>hideSponsorBilling</dt>
* <dd>A flag indicating whether to hide the billing information on a sponsored
* account owner's settings page
* </dd>
* </dl>
*
* <dt>taxExempt</dt>
* <dd>A flag indicating the user's sponsored group is exempt from sale tax
* </dd>
* </dl>
*/
struct UserAttributes {
1: optional string defaultLocationName,
2: optional double defaultLatitude,
3: optional double defaultLongitude,
4: optional bool preactivation,
5: optional list<string> viewedPromotions,
6: optional string incomingEmailAddress,
7: optional list<string> recentMailedAddresses,
9: optional string comments,
11: optional Timestamp dateAgreedToTermsOfService,
12: optional i32 maxReferrals,
13: optional i32 referralCount,
14: optional string refererCode,
15: optional Timestamp sentEmailDate,
16: optional i32 sentEmailCount,
17: optional i32 dailyEmailLimit,
18: optional Timestamp emailOptOutDate,
19: optional Timestamp partnerEmailOptInDate,
20: optional string preferredLanguage,
21: optional string preferredCountry,
22: optional bool clipFullPage,
23: optional string twitterUserName,
24: optional string twitterId,
25: optional string groupName,
26: optional string recognitionLanguage,
27: optional i64 customerProfileId,
28: optional string referralProof,
29: optional bool educationalDiscount,
30: optional string businessAddress,
31: optional bool hideSponsorBilling,
32: optional bool taxExempt
}
/**
* This represents the bookkeeping information for the user's subscription.
*
*<dl>
* <dt>uploadLimit</dt>
* <dd>The number of bytes that can be uploaded to the account
* in the current month. For new notes that are created, this is the length
* of the note content (in Unicode characters) plus the size of each resource
* (in bytes). For edited notes, this is the the difference between the old
* length and the new length (if this is greater than 0) plus the size of
* each new resource.
* </dd>
* <dt>uploadLimitEnd</dt>
* <dd>The date and time when the current upload limit
* expires. At this time, the monthly upload count reverts to 0 and a new
* limit is imposed. This date and time is exclusive, so this is effectively
* the start of the new month.
* </dd>
* <dt>uploadLimitNextMonth</dt>
* <dd> When uploadLimitEnd is reached, the service
* will change uploadLimit to uploadLimitNextMonth. If a premium account is
* canceled, this mechanism will reset the quota appropriately.
* </dd>
* <dt>premiumServiceStatus</dt>
* <dd>Indicates the phases of a premium account
* during the billing process.
* </dd>
* <dt>premiumOrderNumber</dt>
* <dd>The order number used by the commerce system to
* process recurring payments
* </dd>
* <dt>premiumServiceStart</dt>
* <dd>The start date when this premium promotion
* began (this number will get overwritten if a premium service is canceled
* and then re-activated).
* </dd>
* <dt>premiumCommerceService</dt>
* <dd>The commerce system used (paypal, Google
* checkout, etc)
* </dd>
* <dt>premiumServiceSKU</dt>
* <dd>The code associated with the purchase eg. monthly
* or annual purchase. Clients should interpret this value and localize it.
* </dd>
* <dt>lastSuccessfulCharge</dt>
* <dd>Date the last time the user was charged.
* Null if never charged.
* </dd>
* <dt>lastFailedCharge</dt>
* <dd>Date the last time a charge was attempted and
* failed.
* </dd>
* <dt>lastFailedChargeReason</dt>
* <dd>Reason provided for the charge failure
* </dd>
* <dt>nextPaymentDue</dt>
* <dd>The end of the billing cycle. This could be in the
* past if there are failed charges.
* </dd>
* <dt>premiumLockUntil</dt>
* <dd>An internal variable to manage locking operations
* on the commerce variables.
* </dd>
* <dt>updated</dt>
* <dd>The date any modification where made to this record.
* </dd>
* <dt>premiumSubscriptionNumber</dt>
* <dd>The number number identifying the
* recurring subscription used to make the recurring charges.
* </dd>
* <dt>lastRequestedCharge</dt>
* <dd>Date charge last attempted</dd>
* <dt>currency</dt>
* <dd>ISO 4217 currency code</dd>
* <dt>unitPrice</dt>
* <dd>charge in the smallest unit of the currency (e.g. cents for USD)</dd>
* <dt>businessId</dt>
* <dd>If set, the ID of the Evernote Business account that the user is a
* member of. If not set, the user is not a member of a business.</dd>
* <dt>businessName</dt>
* <dd>The human-readable name of the Evernote Business account that
* the user is a member of.</dd>
* <dt>businessRole</dt>
* <dd>If set, the role of the user within the Evernote Business account
* that they are a member of.</dd>
* </dl>
*/
struct Accounting {
1: optional i64 uploadLimit,
2: optional Timestamp uploadLimitEnd,
3: optional i64 uploadLimitNextMonth,
4: optional PremiumOrderStatus premiumServiceStatus,
5: optional string premiumOrderNumber,
6: optional string premiumCommerceService,
7: optional Timestamp premiumServiceStart,
8: optional string premiumServiceSKU,
9: optional Timestamp lastSuccessfulCharge,
10: optional Timestamp lastFailedCharge,
11: optional string lastFailedChargeReason,
12: optional Timestamp nextPaymentDue,
13: optional Timestamp premiumLockUntil,
14: optional Timestamp updated,
16: optional string premiumSubscriptionNumber,
17: optional Timestamp lastRequestedCharge,
18: optional string currency,
19: optional i32 unitPrice,
20: optional i32 businessId,
21: optional string businessName,
22: optional BusinessUserRole businessRole
}
/**
* This structure is used to provide information about a user's Premium account.
*<dl>
* <dt>currentTime</dt>
* <dd>
* The server-side date and time when this data was generated.
* </dd>
* <dt>premium</dt>
* <dd>
* True if the user's account is Premium.
* </dd>
* <dt>premiumRecurring</dt>
* <dd>
* True if the user's account is Premium and has a recurring payment method.
* </dd>
* <dt>premiumExpirationDate</dt>
* <dd>
* The date when the user's Premium account expires, or the date when the
* user's account will be charged if it has a recurring payment method.
* </dd>
* <dt>premiumExtendable</dt>
* <dd>
* True if the user is eligible for purchasing Premium account extensions.
* </dd>
* <dt>premiumPending</dt>
* <dd>
* True if the user's Premium account is pending payment confirmation
* </dd>
* <dt>premiumCancellationPending</dt>
* <dd>
* True if the user has requested that no further charges to be made; the
* Premium account will remain active until it expires.
* </dd>
* <dt>canPurchaseUploadAllowance</dt>
* <dd>
* True if the user is eligible for purchasing additional upload allowance.
* </dd>
* <dt>sponsoredGroupName</dt>
* <dd>
* The name of the sponsored group that the user is part of.
* </dd>
* <dt>sponsoredGroupRole</dt>
* <dd>
* DEPRECATED - will be removed in a future update.
* </dd>
* </dl>
*/
struct PremiumInfo {
1: required Timestamp currentTime,
2: required bool premium,
3: required bool premiumRecurring,
4: optional Timestamp premiumExpirationDate,
5: required bool premiumExtendable,
6: required bool premiumPending,
7: required bool premiumCancellationPending,
8: required bool canPurchaseUploadAllowance,
9: optional string sponsoredGroupName,
10: optional SponsoredGroupRole sponsoredGroupRole
}
/**
* This represents the information about a single user account.
*<dl>
* <dt>id</dt>
* <dd>The unique numeric identifier for the account, which will not
* change for the lifetime of the account.
* </dd>
*
* <dt>username</dt>
* <dd>The name that uniquely identifies a single user account. This name
* may be presented by the user, along with their password, to log into
* their account.
* May only contain a-z, 0-9, or '-', and may not start or end with the '-'
* <br/>
* Length: EDAM_USER_USERNAME_LEN_MIN - EDAM_USER_USERNAME_LEN_MAX
* <br/>
* Regex: EDAM_USER_USERNAME_REGEX
* </dd>
*
* <dt>email</dt>
* <dd>The email address registered for the user. Must comply with
* RFC 2821 and RFC 2822.<br/>
* For privacy reasons, this field may not be populated when a User
* is retrieved via a call to UserStore.getUser().
* Length: EDAM_EMAIL_LEN_MIN - EDAM_EMAIL_LEN_MAX
* <br/>
* Regex: EDAM_EMAIL_REGEX
* </dd>
*
* <dt>name</dt>
* <dd>The printable name of the user, which may be a combination
* of given and family names. This is used instead of separate "first"
* and "last" names due to variations in international name format/order.
* May not start or end with a whitespace character. May contain any
* character but carriage return or newline (Unicode classes Zl and Zp).
* <br/>
* Length: EDAM_USER_NAME_LEN_MIN - EDAM_USER_NAME_LEN_MAX
* <br/>
* Regex: EDAM_USER_NAME_REGEX
* </dd>
*
* <dt>timezone</dt>
* <dd>The zone ID for the user's default location. If present,
* this may be used to localize the display of any timestamp for which no
* other timezone is available.
* The format must be encoded as a standard zone ID such as
* "America/Los_Angeles" or "GMT+08:00"
* <br/>
* Length: EDAM_TIMEZONE_LEN_MIN - EDAM_TIMEZONE_LEN_MAX
* <br/>
* Regex: EDAM_TIMEZONE_REGEX
* </dd>
*
* <dt>privilege</dt>
* <dd>The level of access permitted for the user.
* </dd>
*
* <dt>created</dt>
* <dd>The date and time when this user account was created in the
* service.
* </dd>
*
* <dt>updated</dt>
* <dd>The date and time when this user account was last modified
* in the service.
* </dd>
*
* <dt>deleted</dt>
* <dd>If the account has been deleted from the system (e.g. as
* the result of a legal request by the user), the date and time of the
* deletion will be represented here. If not, this value will not be set.
* </dd>
*
* <dt>active</dt>
* <dd>If the user account is available for login and
* synchronization, this flag will be set to true.
* </dd>
*
* <dt>shardId</dt>
* <dd>DEPRECATED - Client applications should have no need to use this field.
* </dd>
*
* <dt>attributes</dt>
* <dd>If present, this will contain a list of the attributes
* for this user account.
* </dd>
*
* <dt>accounting</dt>
* <dd>Bookkeeping information for the user's subscription.
* </dd>
*
* <dt>premiumInfo</dt>
* <dd>If present, this will contain a set of commerce information
* relating to the user's premium service level.
* </dd>
* </dl>
*/
struct User {
1: optional UserID id,
2: optional string username,
3: optional string email,
4: optional string name,
6: optional string timezone,
7: optional PrivilegeLevel privilege,
9: optional Timestamp created,
10: optional Timestamp updated,
11: optional Timestamp deleted,
13: optional bool active,
14: optional string shardId,
15: optional UserAttributes attributes,
16: optional Accounting accounting,
17: optional PremiumInfo premiumInfo
}
/**
* A tag within a user's account is a unique name which may be organized
* a simple hierarchy.
*<dl>
* <dt>guid</dt>
* <dd>The unique identifier of this tag. Will be set by the service,
* so may be omitted by the client when creating the Tag.
* <br/>
* Length: EDAM_GUID_LEN_MIN - EDAM_GUID_LEN_MAX
* <br/>
* Regex: EDAM_GUID_REGEX
* </dd>
*
* <dt>name</dt>
* <dd>A sequence of characters representing the tag's identifier.
* Case is preserved, but is ignored for comparisons.
* This means that an account may only have one tag with a given name, via
* case-insensitive comparison, so an account may not have both "food" and
* "Food" tags.
* May not contain a comma (','), and may not begin or end with a space.
* <br/>
* Length: EDAM_TAG_NAME_LEN_MIN - EDAM_TAG_NAME_LEN_MAX
* <br/>
* Regex: EDAM_TAG_NAME_REGEX
* </dd>
*
* <dt>parentGuid</dt>
* <dd>If this is set, then this is the GUID of the tag that
* holds this tag within the tag organizational hierarchy. If this is
* not set, then the tag has no parent and it is a "top level" tag.
* Cycles are not allowed (e.g. a->parent->parent == a) and will be
* rejected by the service.
* <br/>
* Length: EDAM_GUID_LEN_MIN - EDAM_GUID_LEN_MAX
* <br/>
* Regex: EDAM_GUID_REGEX
* </dd>
*
* <dt>updateSequenceNum</dt>
* <dd>A number identifying the last transaction to
* modify the state of this object. The USN values are sequential within an
* account, and can be used to compare the order of modifications within the
* service.
* </dd>
* </dl>
*/
struct Tag {
1: optional Guid guid,
2: optional string name,
3: optional Guid parentGuid,
4: optional i32 updateSequenceNum
}
/**
* A structure that wraps a map of name/value pairs whose values are not
* always present in the structure in order to reduce space when obtaining
* batches of entities that contain the map.
*
* When the server provides the client with a LazyMap, it will fill in either
* the keysOnly field or the fullMap field, but never both, based on the API
* and parameters.
*
* When a client provides a LazyMap to the server as part of an update to
* an object, the server will only update the LazyMap if the fullMap field is
* set. If the fullMap field is not set, the server will not make any changes
* to the map.
*
* Check the API documentation of the individual calls involving the LazyMap
* for full details including the constraints of the names and values of the
* map.
*
* <dl>
* <dt>keysOnly</dt>
* <dd>The set of keys for the map. This field is ignored by the
* server when set.
* </dd>
*
* <dt>fullMap</dt>
* <dd>The complete map, including all keys and values.
* </dd>
* </dl>
*/
struct LazyMap {
1: optional set<string> keysOnly,
2: optional map<string, string> fullMap
}
/**
* Structure holding the optional attributes of a Resource
* <dl>
* <dt>sourceURL</dt>
* <dd>the original location where the resource was hosted
* <br/>
* Length: EDAM_ATTRIBUTE_LEN_MIN - EDAM_ATTRIBUTE_LEN_MAX
* </dd>
*
* <dt>timestamp</dt>
* <dd>the date and time that is associated with this resource
* (e.g. the time embedded in an image from a digital camera with a clock)
* </dd>
*
* <dt>latitude</dt>
* <dd>the latitude where the resource was captured
* </dd>
*
* <dt>longitude</dt>
* <dd>the longitude where the resource was captured
* </dd>
*
* <dt>altitude</dt>
* <dd>the altitude where the resource was captured
* </dd>
*
* <dt>cameraMake</dt>
* <dd>information about an image's camera, e.g. as embedded in
* the image's EXIF data
* <br/>
* Length: EDAM_ATTRIBUTE_LEN_MIN - EDAM_ATTRIBUTE_LEN_MAX
* </dd>
*
* <dt>cameraModel</dt>
* <dd>information about an image's camera, e.g. as embedded
* in the image's EXIF data
* <br/>
* Length: EDAM_ATTRIBUTE_LEN_MIN - EDAM_ATTRIBUTE_LEN_MAX
* </dd>
*
* <dt>clientWillIndex</dt>
* <dd>if true, then the original client that submitted
* the resource plans to submit the recognition index for this resource at a
* later time.
* </dd>
*
* <dt>recoType</dt>
* <dd>DEPRECATED - this field is no longer set by the service, so should
* be ignored.
* </dd>
*
* <dt>fileName</dt>
* <dd>if the resource came from a source that provided an
* explicit file name, the original name will be stored here. Many resources
* come from unnamed sources, so this will not always be set.
* </dd>
*
* <dt>attachment</dt>
* <dd>this will be true if the resource should be displayed as an attachment,
* or false if the resource should be displayed inline (if possible).
* </dd>
*
* <dt>applicationData</dt>
* <dd>Provides a location for applications to store a relatively small
* (4kb) blob of data associated with a Resource that is not visible to the user
* and that is opaque to the Evernote service. A single application may use at most
* one entry in this map, using its API consumer key as the map key. See the
* documentation for LazyMap for a description of when the actual map values
* are returned by the service.
* <p>To safely add or modify your application's entry in the map, use
* NoteStore.setResourceApplicationDataEntry. To safely remove your application's
* entry from the map, use NoteStore.unsetResourceApplicationDataEntry.</p>
* Minimum length of a name (key): EDAM_APPLICATIONDATA_NAME_LEN_MIN
* <br/>
* Sum max size of key and value: EDAM_APPLICATIONDATA_ENTRY_LEN_MAX
* <br/>
* Syntax regex for name (key): EDAM_APPLICATIONDATA_NAME_REGEX
* </dd>
*
* </dl>
*/
struct ResourceAttributes {
1: optional string sourceURL,
2: optional Timestamp timestamp,
3: optional double latitude,
4: optional double longitude,
5: optional double altitude,
6: optional string cameraMake,
7: optional string cameraModel,
8: optional bool clientWillIndex,
9: optional string recoType,
10: optional string fileName,
11: optional bool attachment,
12: optional LazyMap applicationData
}
/**
* Every media file that is embedded or attached to a note is represented
* through a Resource entry.
* <dl>
* <dt>guid</dt>