public override async void OnButtonClick(ConsoleButton consoleButton) { switch (consoleButton.Name) { case "GetImage": var imageUrl = ImageEndpoint.GetPictureUrl(); var computerVisionResponse = await ComputerVision.ProcessImageAsync(imageUrl); using (IRSAPIClient proxy = Helper.GetServicesManager().CreateProxy <IRSAPIClient>(ExecutionIdentity.System)) { //Set the proxy to use the current workspace proxy.APIOptions.WorkspaceID = Helper.GetActiveCaseID(); var imageArtifactId = ActiveArtifact.ArtifactID; var rdoToUpdate = proxy.Repositories.RDO.ReadSingle(imageArtifactId); rdoToUpdate.ArtifactTypeGuids.Add(Helpers.Constants.IMAGE_OBJECT_GUID); rdoToUpdate.Fields.Add(new DTOs.FieldValue(Helpers.Constants.IMAGE_URL_FIELD_GUID, imageUrl)); rdoToUpdate.Fields.Add(new DTOs.FieldValue(Helpers.Constants.IMAGE_DESCRIPTION_FIELD_GUID, computerVisionResponse.Description)); rdoToUpdate.Fields.Add(new DTOs.FieldValue(Helpers.Constants.IMAGE_STATUS_FIELD_GUID, computerVisionResponse.ShibaStatus)); proxy.Repositories.RDO.Update(rdoToUpdate); } break; case "Correct": using (IRSAPIClient proxy = Helper.GetServicesManager().CreateProxy <IRSAPIClient>(ExecutionIdentity.System)) { //Set the proxy to use the current workspace proxy.APIOptions.WorkspaceID = Helper.GetActiveCaseID(); var imageArtifactId = ActiveArtifact.ArtifactID; var rdoToUpdate = proxy.Repositories.RDO.ReadSingle(imageArtifactId); rdoToUpdate.ArtifactTypeGuids.Add(Helpers.Constants.IMAGE_OBJECT_GUID); rdoToUpdate.Fields.Add(new DTOs.FieldValue(Helpers.Constants.IMAGE_RESULT_FIELD_GUID, "Correct")); proxy.Repositories.RDO.Update(rdoToUpdate); } break; case "FalseNegative": using (IRSAPIClient proxy = Helper.GetServicesManager().CreateProxy <IRSAPIClient>(ExecutionIdentity.System)) { //Set the proxy to use the current workspace proxy.APIOptions.WorkspaceID = Helper.GetActiveCaseID(); var imageArtifactId = ActiveArtifact.ArtifactID; var rdoToUpdate = proxy.Repositories.RDO.ReadSingle(imageArtifactId); rdoToUpdate.ArtifactTypeGuids.Add(Helpers.Constants.IMAGE_OBJECT_GUID); rdoToUpdate.Fields.Add(new DTOs.FieldValue(Helpers.Constants.IMAGE_RESULT_FIELD_GUID, "False Negative")); proxy.Repositories.RDO.Update(rdoToUpdate); } break; case "FalsePositive": using (IRSAPIClient proxy = Helper.GetServicesManager().CreateProxy <IRSAPIClient>(ExecutionIdentity.System)) { //Set the proxy to use the current workspace proxy.APIOptions.WorkspaceID = Helper.GetActiveCaseID(); var imageArtifactId = ActiveArtifact.ArtifactID; var rdoToUpdate = proxy.Repositories.RDO.ReadSingle(imageArtifactId); rdoToUpdate.ArtifactTypeGuids.Add(Helpers.Constants.IMAGE_OBJECT_GUID); rdoToUpdate.Fields.Add(new DTOs.FieldValue(Helpers.Constants.IMAGE_RESULT_FIELD_GUID, "False Positive")); proxy.Repositories.RDO.Update(rdoToUpdate); } break; } }