Schedule.ChangeScheduleToggleStatus
Description
The API changes the schedule toggle status for the specified schedule (Time Trigger) Id from the connected AI Command Center.
Signature [C#]
Task ChangeScheduleToggleStatus(int scheduleId, bool isDisable);
Properties
Input
| Parameter | Type | Required / default | Description |
|---|---|---|---|
scheduleId | int | Required | Specify the Schedule (Time Trigger) Id to change the toggle status. |
isDisable | bool | Required | Specify the value that indicates whether the Schedule (Time Trigger) is enabled. |
Remarks
Use ChangeScheduleToggleStatus API to change the toggle status of (Schedule) Time Trigger of specified schedule Id from the connected AI Command Center.
Example
C#
public async Task ChangeTimeTriggerToggleStatus()
{
IControlRoomContext context = LoginControlRoom();
try
{
int scheduleId = 1;
bool isDisable = true;
await context.Schedules.ChangeScheduleToggleStatus(scheduleId, isDisable);
}
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.