@@ -21,10 +21,10 @@ class Execution implements Model {
2121 final String deploymentId;
2222
2323 /// The trigger that caused the function to execute. Possible values can be: `http` , `schedule` , or `event` .
24- final String trigger;
24+ final enums. ExecutionTrigger trigger;
2525
2626 /// The status of the function execution. Possible values can be: `waiting` , `processing` , `completed` , or `failed` .
27- final String status;
27+ final enums. ExecutionStatus status;
2828
2929 /// HTTP request method type.
3030 final String requestMethod;
@@ -85,8 +85,12 @@ class Execution implements Model {
8585 $permissions: List .from (map['\$ permissions' ] ?? []),
8686 functionId: map['functionId' ].toString (),
8787 deploymentId: map['deploymentId' ].toString (),
88- trigger: map['trigger' ].toString (),
89- status: map['status' ].toString (),
88+ trigger: enums.ExecutionTrigger .values.firstWhere (
89+ (e) => e.value == map['trigger' ],
90+ ),
91+ status: enums.ExecutionStatus .values.firstWhere (
92+ (e) => e.value == map['status' ],
93+ ),
9094 requestMethod: map['requestMethod' ].toString (),
9195 requestPath: map['requestPath' ].toString (),
9296 requestHeaders: List <Headers >.from (
@@ -112,8 +116,8 @@ class Execution implements Model {
112116 "\$ permissions" : $permissions,
113117 "functionId" : functionId,
114118 "deploymentId" : deploymentId,
115- "trigger" : trigger,
116- "status" : status,
119+ "trigger" : trigger.value ,
120+ "status" : status.value ,
117121 "requestMethod" : requestMethod,
118122 "requestPath" : requestPath,
119123 "requestHeaders" : requestHeaders.map ((p) => p.toMap ()).toList (),
0 commit comments