LogSink.fromJson constructor

LogSink.fromJson(
  1. Object? j
)

Implementation

factory LogSink.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return LogSink(
    name: switch (json['name']) {
      null => '',
      Object $1 => decodeString($1),
    },
    destination: switch (json['destination']) {
      null => '',
      Object $1 => decodeString($1),
    },
    filter: switch (json['filter']) {
      null => '',
      Object $1 => decodeString($1),
    },
    description: switch (json['description']) {
      null => '',
      Object $1 => decodeString($1),
    },
    disabled: switch (json['disabled']) {
      null => false,
      Object $1 => decodeBool($1),
    },
    exclusions: switch (json['exclusions']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) LogExclusion.fromJson(i)],
      _ => throw const FormatException('"exclusions" is not a list'),
    },
    outputVersionFormat: switch (json['outputVersionFormat']) {
      null => LogSink_VersionFormat.$default,
      Object $1 => LogSink_VersionFormat.fromJson($1),
    },
    writerIdentity: switch (json['writerIdentity']) {
      null => '',
      Object $1 => decodeString($1),
    },
    includeChildren: switch (json['includeChildren']) {
      null => false,
      Object $1 => decodeBool($1),
    },
    bigqueryOptions: switch (json['bigqueryOptions']) {
      null => null,
      Object $1 => BigQueryOptions.fromJson($1),
    },
    createTime: switch (json['createTime']) {
      null => null,
      Object $1 => Timestamp.fromJson($1),
    },
    updateTime: switch (json['updateTime']) {
      null => null,
      Object $1 => Timestamp.fromJson($1),
    },
  );
}