Skip to content

Commit

Permalink
spec update 2023-04-26
Browse files Browse the repository at this point in the history
  • Loading branch information
wfraser committed Aug 13, 2023
1 parent ec0e0af commit 7073314
Show file tree
Hide file tree
Showing 11 changed files with 12,723 additions and 9,256 deletions.
5 changes: 4 additions & 1 deletion RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# v0.16.0
xxxx-yy-zz
* API spec update 2022-06-15, 2022-07-13, 2022-10-11, 2022-11-09
* API spec update 2022-06-15, 2022-07-13, 2022-10-11, 2022-11-09, 2023-04-26
* semver incompatible changes to structs:
* files: TeamGetInfoResult, TeamMemberPolicies, TeamSharingPolicies
* users: FullTeam, FullAccount
* Established 1.56.1 as the MSRV (minimum supported Rust version)
* Fix test generator under Python 3.11

Expand Down
6 changes: 2 additions & 4 deletions generator/test.stoneg.py
Original file line number Diff line number Diff line change
Expand Up @@ -562,10 +562,8 @@ def _generate(self, tokens):
sub_result = self._generate(sub_tokens) if n != 0 else ''
result += str(sub_result) * n
elif opcode == 'category':
if argument == 'category_digit':
result += '0'
elif argument == 'category_not_space':
result += '!'
if argument == sre_parse.CATEGORY_WORD:
result += 'A'
else:
raise NotImplementedError(f'category {argument}')
elif opcode == 'assert_not':
Expand Down
1 change: 1 addition & 0 deletions src/generated/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
)]

/// Creates an OAuth 2.0 access token from the supplied OAuth 1.0 access token.
#[deprecated]
pub fn token_from_oauth1(
client: &impl crate::client_trait::AppAuthClient,
arg: &TokenFromOAuth1Arg,
Expand Down
2 changes: 1 addition & 1 deletion src/generated/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ pub fn user(
None)
}

/// EchoArg contains the arguments to be sent to the Dropbox servers.
/// Contains the arguments to be sent to the Dropbox servers.
#[derive(Debug, Clone, PartialEq, Eq, Default)]
#[non_exhaustive] // structs may have more fields added in the future.
pub struct EchoArg {
Expand Down
10 changes: 0 additions & 10 deletions src/generated/file_requests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,6 @@ pub fn get(

/// Returns a list of file requests owned by this user. For apps with the app folder permission,
/// this will only return file requests with destinations in the app folder.
///
/// # Stability
/// *PREVIEW*: This function may change or disappear without notice.
#[cfg(feature = "unstable")]
#[cfg_attr(docsrs, doc(cfg(feature = "unstable")))]
pub fn list_v2(
client: &impl crate::client_trait::UserAuthClient,
arg: &ListFileRequestsArg,
Expand Down Expand Up @@ -118,11 +113,6 @@ pub fn list(
/// Once a cursor has been retrieved from [`list_v2()`](list_v2), use this to paginate through all
/// file requests. The cursor must come from a previous call to [`list_v2()`](list_v2) or
/// [`list_continue()`](list_continue).
///
/// # Stability
/// *PREVIEW*: This function may change or disappear without notice.
#[cfg(feature = "unstable")]
#[cfg_attr(docsrs, doc(cfg(feature = "unstable")))]
pub fn list_continue(
client: &impl crate::client_trait::UserAuthClient,
arg: &ListFileRequestsContinueArg,
Expand Down
4 changes: 2 additions & 2 deletions src/generated/files.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1008,8 +1008,8 @@ pub fn restore(
}

/// Save the data from a specified URL into a file in user's Dropbox. Note that the transfer from
/// the URL must complete within 5 minutes, or the operation will time out and the job will fail. If
/// the given path already exists, the file will be renamed to avoid the conflict (e.g. myfile
/// the URL must complete within 15 minutes, or the operation will time out and the job will fail.
/// If the given path already exists, the file will be renamed to avoid the conflict (e.g. myfile
/// (1).txt).
pub fn save_url(
client: &impl crate::client_trait::UserAuthClient,
Expand Down
87 changes: 76 additions & 11 deletions src/generated/sharing.rs

Large diffs are not rendered by default.

45 changes: 27 additions & 18 deletions src/generated/team.rs
Original file line number Diff line number Diff line change
Expand Up @@ -541,8 +541,9 @@ pub fn member_space_limits_excluded_users_remove(
None)
}

/// Get users custom quota. Returns none as the custom quota if none was set. A maximum of 1000
/// members can be specified in a single call.
/// Get users custom quota. A maximum of 1000 members can be specified in a single call. Note: to
/// apply a custom space limit, a team admin needs to set a member space limit for the team first.
/// (the team admin can check the settings here: https://www.dropbox.com/team/admin/settings/space).
pub fn member_space_limits_get_custom_quota(
client: &impl crate::client_trait::TeamAuthClient,
arg: &CustomQuotaUsersArg,
Expand All @@ -556,7 +557,9 @@ pub fn member_space_limits_get_custom_quota(
None)
}

/// Remove users custom quota. A maximum of 1000 members can be specified in a single call.
/// Remove users custom quota. A maximum of 1000 members can be specified in a single call. Note: to
/// apply a custom space limit, a team admin needs to set a member space limit for the team first.
/// (the team admin can check the settings here: https://www.dropbox.com/team/admin/settings/space).
pub fn member_space_limits_remove_custom_quota(
client: &impl crate::client_trait::TeamAuthClient,
arg: &CustomQuotaUsersArg,
Expand All @@ -571,7 +574,9 @@ pub fn member_space_limits_remove_custom_quota(
}

/// Set users custom quota. Custom quota has to be at least 15GB. A maximum of 1000 members can be
/// specified in a single call.
/// specified in a single call. Note: to apply a custom space limit, a team admin needs to set a
/// member space limit for the team first. (the team admin can check the settings here:
/// https://www.dropbox.com/team/admin/settings/space).
pub fn member_space_limits_set_custom_quota(
client: &impl crate::client_trait::TeamAuthClient,
arg: &SetCustomQuotaArg,
Expand Down Expand Up @@ -27511,9 +27516,9 @@ pub struct TeamGetInfoResult {
pub num_licensed_users: u32,
/// The number of accounts that have been invited or are already active members of the team.
pub num_provisioned_users: u32,
pub policies: crate::team_policies::TeamMemberPolicies,
/// The number of licenses used on the team.
pub num_used_licenses: u32,
pub policies: crate::team_policies::TeamMemberPolicies,
}

impl TeamGetInfoResult {
Expand All @@ -27522,26 +27527,30 @@ impl TeamGetInfoResult {
team_id: String,
num_licensed_users: u32,
num_provisioned_users: u32,
num_used_licenses: u32,
policies: crate::team_policies::TeamMemberPolicies,
) -> Self {
TeamGetInfoResult {
name,
team_id,
num_licensed_users,
num_provisioned_users,
num_used_licenses,
policies,
num_used_licenses: 0,
}
}

pub fn with_num_used_licenses(mut self, value: u32) -> Self {
self.num_used_licenses = value;
self
}
}

const TEAM_GET_INFO_RESULT_FIELDS: &[&str] = &["name",
"team_id",
"num_licensed_users",
"num_provisioned_users",
"num_used_licenses",
"policies"];
"policies",
"num_used_licenses"];
impl TeamGetInfoResult {
pub(crate) fn internal_deserialize<'de, V: ::serde::de::MapAccess<'de>>(
map: V,
Expand All @@ -27557,8 +27566,8 @@ impl TeamGetInfoResult {
let mut field_team_id = None;
let mut field_num_licensed_users = None;
let mut field_num_provisioned_users = None;
let mut field_num_used_licenses = None;
let mut field_policies = None;
let mut field_num_used_licenses = None;
let mut nothing = true;
while let Some(key) = map.next_key::<&str>()? {
nothing = false;
Expand Down Expand Up @@ -27587,18 +27596,18 @@ impl TeamGetInfoResult {
}
field_num_provisioned_users = Some(map.next_value()?);
}
"num_used_licenses" => {
if field_num_used_licenses.is_some() {
return Err(::serde::de::Error::duplicate_field("num_used_licenses"));
}
field_num_used_licenses = Some(map.next_value()?);
}
"policies" => {
if field_policies.is_some() {
return Err(::serde::de::Error::duplicate_field("policies"));
}
field_policies = Some(map.next_value()?);
}
"num_used_licenses" => {
if field_num_used_licenses.is_some() {
return Err(::serde::de::Error::duplicate_field("num_used_licenses"));
}
field_num_used_licenses = Some(map.next_value()?);
}
_ => {
// unknown field allowed and ignored
map.next_value::<::serde_json::Value>()?;
Expand All @@ -27613,8 +27622,8 @@ impl TeamGetInfoResult {
team_id: field_team_id.ok_or_else(|| ::serde::de::Error::missing_field("team_id"))?,
num_licensed_users: field_num_licensed_users.ok_or_else(|| ::serde::de::Error::missing_field("num_licensed_users"))?,
num_provisioned_users: field_num_provisioned_users.ok_or_else(|| ::serde::de::Error::missing_field("num_provisioned_users"))?,
num_used_licenses: field_num_used_licenses.ok_or_else(|| ::serde::de::Error::missing_field("num_used_licenses"))?,
policies: field_policies.ok_or_else(|| ::serde::de::Error::missing_field("policies"))?,
num_used_licenses: field_num_used_licenses.unwrap_or(0),
};
Ok(Some(result))
}
Expand All @@ -27628,8 +27637,8 @@ impl TeamGetInfoResult {
s.serialize_field("team_id", &self.team_id)?;
s.serialize_field("num_licensed_users", &self.num_licensed_users)?;
s.serialize_field("num_provisioned_users", &self.num_provisioned_users)?;
s.serialize_field("num_used_licenses", &self.num_used_licenses)?;
s.serialize_field("policies", &self.policies)?;
s.serialize_field("num_used_licenses", &self.num_used_licenses)?;
Ok(())
}
}
Expand Down
Loading

0 comments on commit 7073314

Please sign in to comment.