Skip to content

Commit c4fd3f5

Browse files
committed
Enhance LogEventArgs with full automation object
Updated AutomationClient.cs to set the entire automation object in LogEventArgs instead of just its ID. Removed the AutomationGroup property assignment. Modified LogEventArgs.cs to change the Automation property type to G4AutomationModel and removed the AutomationGroup property. These changes provide more detailed information about the automation object and streamline the event data structure.
1 parent ff431c2 commit c4fd3f5

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

src/G4.Api/Clients/AutomationClient.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -295,8 +295,7 @@ static EventHandler<T> NewDelegate<T>(AutomationClient client, EventHandler<T> e
295295
// Safely invoke the event handler if it's not null
296296
client.LogCreated?.Invoke(sender, e: new LogEventArgs
297297
{
298-
Automation = automation.Reference?.Id,
299-
AutomationGroup = automation.Reference?.GroupId,
298+
Automation = automation,
300299
Invoker = invoker.Reference,
301300
LogMessage = args
302301
});
@@ -318,8 +317,7 @@ static EventHandler<T> NewDelegate<T>(AutomationClient client, EventHandler<T> e
318317
// Safely invoke the event handler if it's not null
319318
client.LogCreating?.Invoke(sender, e: new LogEventArgs
320319
{
321-
Automation = automation.Reference?.Id,
322-
AutomationGroup = automation.GroupId,
320+
Automation = automation,
323321
Invoker = invoker.Reference,
324322
LogMessage = args
325323
});

src/G4.Api/Models.Events/LogEventArgs.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,7 @@ public class LogEventArgs
1010
/// <summary>
1111
/// Gets or sets the automation identifier associated with the log event.
1212
/// </summary>
13-
public string Automation { get; set; }
14-
15-
/// <summary>
16-
/// Gets or sets the automation group associated with the log event.
17-
/// </summary>
18-
public string AutomationGroup { get; set; }
13+
public G4AutomationModel Automation { get; set; }
1914

2015
/// <summary>
2116
/// Gets or sets the invoker of the log event.

0 commit comments

Comments
 (0)