Task.fromJson constructor

Task.fromJson(
  1. Object? j
)

Implementation

factory Task.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return Task(
    name: switch (json['name']) {
      null => '',
      Object $1 => decodeString($1),
    },
    appEngineHttpRequest: switch (json['appEngineHttpRequest']) {
      null => null,
      Object $1 => AppEngineHttpRequest.fromJson($1),
    },
    httpRequest: switch (json['httpRequest']) {
      null => null,
      Object $1 => HttpRequest.fromJson($1),
    },
    scheduleTime: switch (json['scheduleTime']) {
      null => null,
      Object $1 => Timestamp.fromJson($1),
    },
    createTime: switch (json['createTime']) {
      null => null,
      Object $1 => Timestamp.fromJson($1),
    },
    dispatchDeadline: switch (json['dispatchDeadline']) {
      null => null,
      Object $1 => Duration.fromJson($1),
    },
    dispatchCount: switch (json['dispatchCount']) {
      null => 0,
      Object $1 => decodeInt($1),
    },
    responseCount: switch (json['responseCount']) {
      null => 0,
      Object $1 => decodeInt($1),
    },
    firstAttempt: switch (json['firstAttempt']) {
      null => null,
      Object $1 => Attempt.fromJson($1),
    },
    lastAttempt: switch (json['lastAttempt']) {
      null => null,
      Object $1 => Attempt.fromJson($1),
    },
    view: switch (json['view']) {
      null => Task_View.$default,
      Object $1 => Task_View.fromJson($1),
    },
  );
}