MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / remove

Function remove

src/mz/src/command/user.rs:88–106  ·  view source on GitHub ↗

Removes a user from the profile context using the admin client.

(
    cx: &ProfileContext,
    RemoveArgs { email }: RemoveArgs<'_>,
)

Source from the content-addressed store, hash-verified

86
87/// Removes a user from the profile context using the admin client.
88pub async fn remove(
89 cx: &ProfileContext,
90 RemoveArgs { email }: RemoveArgs<'_>,
91) -> Result<(), Error> {
92 let loading_spinner = cx.output_formatter().loading_spinner("Removing user...");
93
94 let users = cx.admin_client().list_users().await?;
95 let user = users
96 .into_iter()
97 .find(|x| x.email == email)
98 .expect("email not found.");
99
100 cx.admin_client()
101 .remove_user(RemoveUserRequest { user_id: user.id })
102 .await?;
103
104 loading_spinner.finish_with_message(format!("User {} removed.", email));
105 Ok(())
106}

Callers 7

BrokerSectionFunction · 0.50
TableNameArrayInputFunction · 0.50
HeaderColumnArrayInputFunction · 0.50
runFunction · 0.50
runFunction · 0.50
runFunction · 0.50
removeMethod · 0.50

Calls 8

loading_spinnerMethod · 0.80
output_formatterMethod · 0.80
list_usersMethod · 0.80
admin_clientMethod · 0.80
expectMethod · 0.80
remove_userMethod · 0.80
findMethod · 0.45
into_iterMethod · 0.45

Tested by

no test coverage detected