users.stone 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  1. namespace users
  2. "This namespace contains endpoints and data types for user management."
  3. import common
  4. import team_policies
  5. import users_common
  6. #
  7. # Route: get_account
  8. #
  9. route get_account (GetAccountArg, BasicAccount, GetAccountError)
  10. "Get information about a user's account."
  11. attrs
  12. owner = "dev-plat"
  13. allow_app_folder_app = true
  14. struct GetAccountArg
  15. account_id users_common.AccountId
  16. "A user's account identifier."
  17. example default
  18. account_id = "dbid:AAH4f99T0taONIb-OurWxbNQ6ywGRopQngc"
  19. union GetAccountError
  20. no_account
  21. "The specified :field:`GetAccountArg.account_id` does not exist."
  22. struct Account
  23. "The amount of detail revealed about an account depends on the user
  24. being queried and the user making the query."
  25. account_id users_common.AccountId
  26. "The user's unique Dropbox ID."
  27. name Name
  28. "Details of a user's name."
  29. email String
  30. "The user's e-mail address. Do not rely on this without checking the
  31. :field:`email_verified` field. Even then, it's possible that the user
  32. has since lost access to their e-mail."
  33. email_verified Boolean
  34. "Whether the user has verified their e-mail address."
  35. profile_photo_url String?
  36. "URL for the photo representing the user, if one is set."
  37. disabled Boolean
  38. "Whether the user has been disabled."
  39. example default
  40. account_id = "dbid:AAH4f99T0taONIb-OurWxbNQ6ywGRopQngc"
  41. name = default
  42. email = "franz@dropbox.com"
  43. email_verified = true
  44. profile_photo_url = "https://dl-web.dropbox.com/account_photo/get/dbid%3AAAH4f99T0taONIb-OurWxbNQ6ywGRopQngc?vers=1453416582218&size=128x128"
  45. disabled = false
  46. struct BasicAccount extends Account
  47. "Basic information about any account."
  48. is_teammate Boolean
  49. "Whether this user is a teammate of the current user. If this account
  50. is the current user's account, then this will be :val:`true`."
  51. team_member_id String?
  52. "The user's unique team member id. This field will only be present if
  53. the user is part of a team and :field:`is_teammate` is :val:`true`."
  54. example default
  55. account_id = "dbid:AAH4f99T0taONIb-OurWxbNQ6ywGRopQngc"
  56. name = default
  57. email = "franz@dropbox.com"
  58. email_verified = true
  59. profile_photo_url = "https://dl-web.dropbox.com/account_photo/get/dbid%3AAAH4f99T0taONIb-OurWxbNQ6ywGRopQngc?vers=1453416696524&size=128x128"
  60. is_teammate = false
  61. disabled = false
  62. example team
  63. account_id = "dbid:AAH4f99T0taONIb-OurWxbNQ6ywGRopQngc"
  64. name = default
  65. email = "franz@dropbox.com"
  66. email_verified = true
  67. profile_photo_url = "https://dl-web.dropbox.com/account_photo/get/dbid%3AAAH4f99T0taONIb-OurWxbNQ6ywGRopQngc?vers=1453416696524&size=128x128"
  68. is_teammate = true
  69. team_member_id = "dbmid:AAHhy7WsR0x-u4ZCqiDl5Fz5zvuL3kmspwU"
  70. disabled = false
  71. #
  72. # Route: get_current_account
  73. #
  74. route get_current_account (Void, FullAccount, Void)
  75. "Get information about the current user's account."
  76. attrs
  77. owner = "dev-plat"
  78. allow_app_folder_app = true
  79. struct FullAccount extends Account
  80. "Detailed information about the current user's account."
  81. country String(min_length=2, max_length=2)?
  82. "The user's two-letter country code, if available. Country codes are
  83. based on :link:`ISO 3166-1 http://en.wikipedia.org/wiki/ISO_3166-1`."
  84. locale String(min_length=2)
  85. "The language that the user specified. Locale tags will be
  86. :link:`IETF language tags http://en.wikipedia.org/wiki/IETF_language_tag`."
  87. referral_link String
  88. "The user's :link:`referral link https://www.dropbox.com/referrals`."
  89. team FullTeam?
  90. "If this account is a member of a team, information about that team."
  91. team_member_id String?
  92. "This account's unique team member id. This field will only be present if
  93. :field:`team` is present."
  94. is_paired Boolean
  95. "Whether the user has a personal and work account. If the current
  96. account is personal, then :field:`team` will always be :val:`null`,
  97. but :field:`is_paired` will indicate if a work account is linked."
  98. account_type users_common.AccountType
  99. "What type of account this user has."
  100. example default
  101. "Paired account"
  102. account_id = "dbid:AAH4f99T0taONIb-OurWxbNQ6ywGRopQngc"
  103. name = default
  104. email = "franz@dropbox.com"
  105. email_verified = true
  106. country = "US"
  107. locale = "en"
  108. referral_link = "https://db.tt/ZITNuhtI"
  109. team = default
  110. team_member_id = "dbmid:AAHhy7WsR0x-u4ZCqiDl5Fz5zvuL3kmspwU"
  111. is_paired = true
  112. account_type = business
  113. disabled = false
  114. example unpaired
  115. "A personal account that is not paired with a team."
  116. account_id = "dbid:AAH4f99T0taONIb-OurWxbNQ6ywGRopQngc"
  117. name = default
  118. email = "franz@gmail.com"
  119. email_verified = false
  120. country = "US"
  121. locale = "en"
  122. referral_link = "https://db.tt/ZITNuhtI"
  123. team = null
  124. is_paired = false
  125. account_type = default
  126. profile_photo_url = "https://dl-web.dropbox.com/account_photo/get/dbid%3AAAH4f99T0taONIb-OurWxbNQ6ywGRopQngc?vers=1453416673259&size=128x128"
  127. disabled = false
  128. struct Team
  129. "Information about a team."
  130. id String
  131. "The team's unique ID."
  132. name String
  133. "The name of the team."
  134. example default
  135. id = "dbtid:AAFdgehTzw7WlXhZJsbGCLePe8RvQGYDr-I"
  136. name = "Acme, Inc."
  137. struct FullTeam extends Team
  138. "Detailed information about a team."
  139. sharing_policies team_policies.TeamSharingPolicies
  140. "Team policies governing sharing."
  141. example default
  142. id = "dbtid:AAFdgehTzw7WlXhZJsbGCLePe8RvQGYDr-I"
  143. name = "Acme, Inc."
  144. sharing_policies = default
  145. struct Name
  146. "Representations for a person's name to assist with internationalization."
  147. given_name String
  148. "Also known as a first name."
  149. surname String
  150. "Also known as a last name or family name."
  151. familiar_name String
  152. "Locale-dependent name. In the US, a person's familiar name is their
  153. :field:`given_name`, but elsewhere, it could be any combination of a
  154. person's :field:`given_name` and :field:`surname`."
  155. display_name String
  156. "A name that can be used directly to represent the name of a user's
  157. Dropbox account."
  158. abbreviated_name String
  159. "An abbreviated form of the person's name. Their initials in most locales."
  160. example default
  161. given_name = "Franz"
  162. surname = "Ferdinand"
  163. familiar_name = "Franz"
  164. display_name = "Franz Ferdinand (Personal)"
  165. abbreviated_name = "FF"
  166. #
  167. # Route: get_space_usage
  168. #
  169. route get_space_usage(Void, SpaceUsage, Void)
  170. "Get the space usage information for the current user's account."
  171. attrs
  172. owner = "dev-plat"
  173. allow_app_folder_app = true
  174. struct SpaceUsage
  175. "Information about a user's space usage and quota."
  176. used UInt64
  177. "The user's total space usage (bytes)."
  178. allocation SpaceAllocation
  179. "The user's space allocation."
  180. example default
  181. used = 314159265
  182. allocation = default
  183. union SpaceAllocation
  184. "Space is allocated differently based on the type of account."
  185. individual IndividualSpaceAllocation
  186. "The user's space allocation applies only to their individual account."
  187. team TeamSpaceAllocation
  188. "The user shares space with other members of their team."
  189. example default
  190. individual = default
  191. struct IndividualSpaceAllocation
  192. allocated UInt64
  193. "The total space allocated to the user's account (bytes)."
  194. example default
  195. allocated = 10000000000
  196. struct TeamSpaceAllocation
  197. used UInt64
  198. "The total space currently used by the user's team (bytes)."
  199. allocated UInt64
  200. "The total space allocated to the user's team (bytes)."
  201. example default
  202. used = 27182818284
  203. allocated = 100000000000
  204. #
  205. # Route: get_account_batch
  206. #
  207. route get_account_batch (GetAccountBatchArg, GetAccountBatchResult, GetAccountBatchError)
  208. "Get information about multiple user accounts. At most 300 accounts may be queried
  209. per request."
  210. attrs
  211. owner = "dev-plat"
  212. allow_app_folder_app = true
  213. struct GetAccountBatchArg
  214. account_ids List(users_common.AccountId, min_items=1)
  215. "List of user account identifiers. Should not contain any duplicate account IDs."
  216. example default
  217. account_ids = ["dbid:AAH4f99T0taONIb-OurWxbNQ6ywGRopQngc", "dbid:AAH1Vcz-DVoRDeixtr_OA8oUGgiqhs4XPOQ"]
  218. alias GetAccountBatchResult = List(BasicAccount)
  219. union GetAccountBatchError
  220. no_account users_common.AccountId
  221. "The value is an account ID specified in :field:`GetAccountBatchArg.account_ids`
  222. that does not exist."
  223. example default
  224. no_account = "dbid:AAH4f99T0taONIb-OurWxbNQ6ywGRopQngc"