AddExecutionEventsRequest.fromJson constructor

AddExecutionEventsRequest.fromJson(
  1. Object? j
)

Implementation

factory AddExecutionEventsRequest.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return AddExecutionEventsRequest(
    execution: switch (json['execution']) {
      null => '',
      Object $1 => decodeString($1),
    },
    events: switch (json['events']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) Event.fromJson(i)],
      _ => throw const FormatException('"events" is not a list'),
    },
  );
}