AddContextArtifactsAndExecutionsRequest.fromJson constructor

AddContextArtifactsAndExecutionsRequest.fromJson(
  1. Object? j
)

Implementation

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