common.stone 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. namespace common
  2. alias DropboxTimestamp = Timestamp("%Y-%m-%dT%H:%M:%SZ")
  3. alias Date = Timestamp("%Y-%m-%d")
  4. # Note - "\\." is needed in order to translate to "\."
  5. alias EmailAddress = String(pattern="^['&A-Za-z0-9._%+-]+@[A-Za-z0-9-][A-Za-z0-9.-]*.[A-Za-z]{2,15}$", max_length=255)
  6. # First name or Last name. NOTE: max_length should be synced with USER_NAME_MAX_LEN
  7. alias NamePart = String(pattern="[^\/:?*<>\"|]*", min_length=1, max_length=100)
  8. # Display name. We don't limit the length because it's always generated from the first & last names.
  9. alias DisplayName = String(pattern="[^\/:?*<>\"|]*", min_length=1)
  10. alias NamespaceId = String(pattern="[-_0-9a-zA-Z:]+")
  11. alias SharedFolderId = NamespaceId
  12. alias SessionId = String
  13. alias PathRootId = NamespaceId
  14. union PathRoot
  15. home
  16. "Paths are relative to the authenticating user's home directory,
  17. whether or not that user belongs to a team."
  18. member_home
  19. "Paths are relative to the authenticating team member's home
  20. directory. (This results in :field:`PathRootError.invalid' if the
  21. user does not belong to a team.)"
  22. team PathRootId
  23. "Paths are relative to the given team directory. (This results in
  24. :field:`PathRootError.invalid` if the user is not a member of
  25. the team associated with that path root id.)"
  26. user_home
  27. "Paths are relative to the user's home directory. (This results in
  28. :field:`PathRootError.invalid` if the belongs to a team.)"
  29. shared_folder PathRootId
  30. "Paths are relative to given shared folder id (This results in
  31. :field:`PathRootError.no_permission` if you don't have access
  32. to this shared folder.)"
  33. struct InvalidPathRootError
  34. path_root PathRootId?
  35. "The latest path root id for user's team if the user is still in
  36. a team."
  37. union PathRootError
  38. invalid InvalidPathRootError
  39. "The path root id value in Dropbox-API-Path-Root header is no longer
  40. valid."
  41. no_permission
  42. "You don't have permission to access the path root id in Dropbox-API-Path-Root
  43. header."