diff --git a/rust/src/generated/api_types.rs b/rust/src/generated/api_types.rs index c0cd2b9212..be202440b9 100644 --- a/rust/src/generated/api_types.rs +++ b/rust/src/generated/api_types.rs @@ -52,6 +52,8 @@ pub mod rpc_methods { pub const TOOLS_LIST: &str = "tools.list"; /// `account.getQuota` pub const ACCOUNT_GETQUOTA: &str = "account.getQuota"; + /// `account.getManagedSettings` + pub const ACCOUNT_GETMANAGEDSETTINGS: &str = "account.getManagedSettings"; /// `account.getCurrentAuth` pub const ACCOUNT_GETCURRENTAUTH: &str = "account.getCurrentAuth"; /// `account.getAllUsers` @@ -27246,6 +27248,40 @@ pub struct WorkspacesWriteAutopilotObjectiveResult { pub operation: String, } +/// Optional GitHub token used to resolve managed settings for a specific user instead of the global auth context. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct AccountGetManagedSettingsRequest { + /// GitHub token for per-user managed-settings lookup. When provided, resolves this token to determine the account whose enterprise-managed policy is fetched instead of using the global auth. + #[serde(skip_serializing_if = "Option::is_none")] + pub git_hub_token: Option, +} + +/// Enterprise managed-settings snapshot resolved for the authenticated user or supplied GitHub token, without an active session. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct AccountGetManagedSettingsResult { + /// The account identity (host + login) this snapshot was resolved for, or absent when unauthenticated (device-MDM-only resolution). + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option, + /// The resolved managed settings and their source/precedence — the identical payload carried by the `session.managed_settings_resolved` event. + pub resolved: ManagedSettingsResolvedData, +} + /// The resident session the application has materialized on its own connection. /// ///
diff --git a/rust/src/generated/rpc.rs b/rust/src/generated/rpc.rs index 11acb1fb1e..82f4b5bea3 100644 --- a/rust/src/generated/rpc.rs +++ b/rust/src/generated/rpc.rs @@ -325,6 +325,61 @@ impl<'a> ClientRpcAccount<'a> { Ok(serde_json::from_value(_value)?) } + /// Gets enterprise managed settings for the authenticated user or supplied GitHub token, resolved without an active session. + /// + /// Wire method: `account.getManagedSettings`. + /// + /// # Returns + /// + /// Enterprise managed-settings snapshot resolved for the authenticated user or supplied GitHub token, without an active session. + /// + ///
+ /// + /// **Experimental.** This API is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. Pin both the + /// SDK and CLI versions if your code depends on it. + /// + ///
+ pub async fn get_managed_settings(&self) -> Result { + let wire_params = serde_json::json!({}); + let _value = self + .client + .call(rpc_methods::ACCOUNT_GETMANAGEDSETTINGS, Some(wire_params)) + .await?; + Ok(serde_json::from_value(_value)?) + } + + /// Gets enterprise managed settings for the authenticated user or supplied GitHub token, resolved without an active session. + /// + /// Wire method: `account.getManagedSettings`. + /// + /// # Parameters + /// + /// * `params` - Optional GitHub token used to resolve managed settings for a specific user instead of the global auth context. + /// + /// # Returns + /// + /// Enterprise managed-settings snapshot resolved for the authenticated user or supplied GitHub token, without an active session. + /// + ///
+ /// + /// **Experimental.** This API is part of an experimental wire-protocol surface + /// and may change or be removed in future SDK or CLI releases. Pin both the + /// SDK and CLI versions if your code depends on it. + /// + ///
+ pub async fn get_managed_settings_with_params( + &self, + params: AccountGetManagedSettingsRequest, + ) -> Result { + let wire_params = serde_json::to_value(params)?; + let _value = self + .client + .call(rpc_methods::ACCOUNT_GETMANAGEDSETTINGS, Some(wire_params)) + .await?; + Ok(serde_json::from_value(_value)?) + } + /// Gets the currently active authentication credentials from the global auth manager. /// /// Wire method: `account.getCurrentAuth`.