EventActions.fromJson constructor

EventActions.fromJson(
  1. Object? j
)

Implementation

factory EventActions.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return EventActions(
    skipSummarization: switch (json['skipSummarization']) {
      null => false,
      Object $1 => decodeBool($1),
    },
    stateDelta: switch (json['stateDelta']) {
      null => null,
      Object $1 => protobuf.Struct.fromJson($1),
    },
    artifactDelta: switch (json['artifactDelta']) {
      null => {},
      Map<String, Object?> $1 => {
        for (final e in $1.entries) decodeString(e.key): decodeInt(e.value),
      },
      _ => throw const FormatException('"artifactDelta" is not an object'),
    },
    transferToAgent: switch (json['transferToAgent']) {
      null => false,
      Object $1 => decodeBool($1),
    },
    escalate: switch (json['escalate']) {
      null => false,
      Object $1 => decodeBool($1),
    },
    requestedAuthConfigs: switch (json['requestedAuthConfigs']) {
      null => null,
      Object $1 => protobuf.Struct.fromJson($1),
    },
    transferAgent: switch (json['transferAgent']) {
      null => '',
      Object $1 => decodeString($1),
    },
  );
}