Esempio n. 1
0
 protected override void ProcessRecord()
 {
     ProcessImpl(
         filter => Api.Robots.GetRobots(filter: filter).Value.Select(r => RobotExecutionSettings.FromExecutionSettingsDictionary(r.Id.Value, r.ExecutionSettings)).ToList(),
         id => RobotExecutionSettings.FromExecutionSettingsDictionary(id, Api.Robots.GetById(id)?.ExecutionSettings),
         dto => dto);
 }
Esempio n. 2
0
        protected override void ProcessRecord()
        {
            RobotDto robot = null;

            ProcessImpl(() =>
            {
                robot = HandleHttpOperationException(() => Api.Robots.GetById(RobotSettings?.Id ?? Id));
                if (robot.ExecutionSettings == null)
                {
                    robot.ExecutionSettings = new Dictionary <string, object>();
                }

                return(RobotExecutionSettings.FromExecutionSettingsDictionary(RobotSettings?.Id ?? Id, robot.ExecutionSettings));
            }, robotSettings =>
            {
                robot.ExecutionSettings = RobotExecutionSettings.ToDictionary(robotSettings);
                HandleHttpOperationException(() => Api.Robots.PutById(robotSettings.Id, robot));
            });
        }