Roles.UpdateRoleAsync
Description
Update the existing role with specified NewRoleInfo from the connected AI Command Center
Signature [C#]
Task UpdateRoleAsync(NewRoleInfo roleInfo);
Properties
Input
| Parameter | Type | Required / default | Description |
|---|---|---|---|
roleInfo | NewRoleInfo | Required | Specify update details of a Role. |
Remarks
Use UpdateRoleAsync API to update role with specified NewRoleInfo from the connected AI Command Center.
Example
C#
public async Task UpdateRole()
{
IControlRoomContext context = LoginControlRoom();
try
{
string updateRoleName = "updateRole";
NewRoleInfo newRoleInfo = new NewRoleInfo()
{
RoleId = 5,
RoleName = updateRoleName
};
await context.Roles.UpdateRoleAsync(newRoleInfo);
}
finally
{
context.Close();
}
}
Connection helper
public IControlRoomContext LoginControlRoom()
{
string RequiredSetting(string name) => Environment.GetEnvironmentVariable(name) ?? throw new InvalidOperationException($"Set {name} before running this example.");
string serverUrl = RequiredSetting("INTELLIBUDDIES_SERVER_URL");
string userName = RequiredSetting("INTELLIBUDDIES_USERNAME");
string password = RequiredSetting("INTELLIBUDDIES_PASSWORD");
string connectionString = $"ServerUrl={serverUrl};UserName={userName};Password={password}";
IControlRoomContext context = new ControlRoomContext(connectionString);
context.Open();
return context;
}
See Get started for namespaces, configuration, and context cleanup, and SDK usage for error handling.