team.stone 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. namespace team
  2. import common
  3. import team_common
  4. import team_policies
  5. import users_common
  6. # Note that in the database, we also have members that are in state "deleted"
  7. # meaning that the User has been permanently removed from the team.
  8. # But the API is not going to expose such users externally. We will omit such users
  9. # in API responses.
  10. #
  11. union_closed TeamMemberStatus
  12. "The user's status as a member of a specific team."
  13. active
  14. "User has successfully joined the team."
  15. invited
  16. "User has been invited to a team, but has not joined the team yet."
  17. suspended
  18. "User is no longer a member of the team, but the account can be un-suspended,
  19. re-establishing the user as a team member."
  20. removed RemovedStatus
  21. "User is no longer a member of the team.
  22. Removed users are only listed when include_removed is true in members/list."
  23. struct RemovedStatus
  24. is_recoverable Boolean
  25. "True if the removed team member is recoverable."
  26. example default
  27. is_recoverable = false
  28. union_closed TeamMembershipType
  29. full
  30. "User uses a license and has full access to team resources like the shared quota."
  31. limited
  32. "User does not have access to the shared quota and team admins have restricted administrative control."
  33. struct MemberProfile
  34. "Basic member profile."
  35. team_member_id team_common.TeamMemberId
  36. "ID of user as a member of a team."
  37. external_id String?
  38. "External ID that a team can attach to the user.
  39. An application using the API may find it easier to use their
  40. own IDs instead of Dropbox IDs like account_id or team_member_id."
  41. account_id users_common.AccountId?
  42. "A user's account identifier."
  43. email String
  44. "Email address of user."
  45. email_verified Boolean
  46. "Is true if the user's email is verified to be owned by the user."
  47. status TeamMemberStatus
  48. "The user's status as a member of a specific team."
  49. name users.Name
  50. "Representations for a person's name."
  51. membership_type TeamMembershipType
  52. "The user's membership type: full (normal team member) vs limited (does not use a license; no access to the team's shared quota)."
  53. joined_on common.DropboxTimestamp?
  54. "The date and time the user joined as a member of a specific team."
  55. persistent_id String?
  56. "Persistent ID that a team can attach to the user.
  57. The persistent ID is unique ID to be used for SAML authentication."
  58. example default
  59. team_member_id = "dbmid:1234567"
  60. account_id = "dbid:AAH4f99T0taONIb-OurWxbNQ6ywGRopQngc"
  61. email = "mary@lamb.com"
  62. email_verified = true
  63. status = active
  64. name = default
  65. membership_type = full
  66. joined_on = "2015-05-12T15:50:38Z"
  67. union_closed UserSelectorArg
  68. "Argument for selecting a single user, either by team_member_id, external_id or email."
  69. team_member_id team_common.TeamMemberId
  70. external_id team_common.MemberExternalId
  71. email common.EmailAddress
  72. example default
  73. team_member_id = "dbmid:efgh5678"
  74. example email
  75. email = "dan@hotmail.com"
  76. union_closed UserSelectorError
  77. "Error that can be returned whenever a struct derived from :type:`UserSelectorArg` is used."
  78. user_not_found
  79. "No matching user found. The provided team_member_id, email, or external_id does not exist on this team."
  80. union_closed UsersSelectorArg
  81. "Argument for selecting a list of users, either by team_member_ids, external_ids or emails."
  82. team_member_ids List(team_common.TeamMemberId)
  83. "List of member IDs."
  84. external_ids List(team_common.MemberExternalId)
  85. "List of external user IDs."
  86. emails List(common.EmailAddress)
  87. "List of email addresses."
  88. #
  89. # Handle DfB routes that do not have a better place to be.
  90. #
  91. #
  92. # Route get_info
  93. #
  94. struct TeamGetInfoResult
  95. name String
  96. "The name of the team."
  97. team_id String
  98. "The ID of the team."
  99. num_licensed_users UInt32
  100. "The number of licenses available to the team."
  101. num_provisioned_users UInt32
  102. "The number of accounts that have been invited or are already active members of the team."
  103. policies team_policies.TeamMemberPolicies
  104. example default
  105. name="Dropbox Inc."
  106. team_id="dbtid:1234abcd"
  107. num_licensed_users=5
  108. num_provisioned_users=2
  109. policies=default
  110. route get_info(Void, TeamGetInfoResult, Void)
  111. "Retrieves information about a team."
  112. attrs
  113. auth = "team"
  114. owner = "adminx"
  115. #
  116. # Structs for token/get_authenticated_admin
  117. #
  118. struct TokenGetAuthenticatedAdminResult
  119. "Results for :route:`token/get_authenticated_admin`."
  120. admin_profile TeamMemberProfile
  121. "The admin who authorized the token."
  122. example default
  123. admin_profile = default
  124. union TokenGetAuthenticatedAdminError
  125. "Error returned by :route:`token/get_authenticated_admin`."
  126. mapping_not_found
  127. "The current token is not associated with a team admin, because mappings were not
  128. recorded when the token was created. Consider re-authorizing a new access token
  129. to record its authenticating admin."
  130. admin_not_active
  131. "Either the team admin that authorized this token is no longer an active member of the
  132. team or no longer a team admin."
  133. #
  134. # Route: token/get_authenticated_admin
  135. #
  136. route token/get_authenticated_admin(Void, TokenGetAuthenticatedAdminResult, TokenGetAuthenticatedAdminError)
  137. "Returns the member profile of the admin who generated the team access token used to make the call."
  138. attrs
  139. auth = "team"
  140. owner = "dev-plat"
  141. #
  142. # Common types
  143. #
  144. union Feature
  145. "A set of features that Dropbox for Business account support."
  146. upload_api_rate_limit
  147. "The number of upload API calls allowed per month."
  148. union FeatureValue
  149. "The values correspond to entries in :type:`Feature`. You may get different value according
  150. to your Dropbox for Business plan."
  151. upload_api_rate_limit UploadApiRateLimitValue
  152. example uploadRateLimited
  153. upload_api_rate_limit = limited
  154. union UploadApiRateLimitValue
  155. "The value for :field:`Feature.upload_api_rate_limit`."
  156. unlimited
  157. "This team has unlimited upload API quota. So far both server version account and legacy
  158. account type have unlimited monthly upload api quota."
  159. limit UInt32
  160. "The number of upload API calls allowed per month."
  161. example limited
  162. limit = 25000
  163. #
  164. # Route: feature/get_value_batch
  165. #
  166. struct FeaturesGetValuesBatchArg
  167. features List(Feature)
  168. "A list of features in :type:`Feature`. If the list is empty,
  169. this route will return :type:`FeaturesGetValuesBatchError`."
  170. example uploadRateLimit
  171. features = [upload_api_rate_limit]
  172. struct FeaturesGetValuesBatchResult
  173. values List(FeatureValue)
  174. example uploadRateLimit
  175. values = [uploadRateLimited]
  176. union FeaturesGetValuesBatchError
  177. empty_features_list
  178. "At least one :type:`Feature` must be included in the
  179. :type:`FeaturesGetValuesBatchArg`.features list."
  180. route features/get_values(FeaturesGetValuesBatchArg, FeaturesGetValuesBatchResult, FeaturesGetValuesBatchError)
  181. "Get the values for one or more featues. This route allows you to check your account's
  182. capability for what feature you can access or what value you have for certain features.
  183. Permission : Team information."
  184. attrs
  185. auth = "team"
  186. owner = "dev-plat"