FeatureMonitorJob.fromJson constructor

FeatureMonitorJob.fromJson(
  1. Object? j
)

Implementation

factory FeatureMonitorJob.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return FeatureMonitorJob(
    name: switch (json['name']) {
      null => '',
      Object $1 => decodeString($1),
    },
    createTime: switch (json['createTime']) {
      null => null,
      Object $1 => protobuf.Timestamp.fromJson($1),
    },
    finalStatus: switch (json['finalStatus']) {
      null => null,
      Object $1 => Status.fromJson($1),
    },
    jobSummary: switch (json['jobSummary']) {
      null => null,
      Object $1 => FeatureMonitorJob_JobSummary.fromJson($1),
    },
    labels: switch (json['labels']) {
      null => {},
      Map<String, Object?> $1 => {
        for (final e in $1.entries)
          decodeString(e.key): decodeString(e.value),
      },
      _ => throw const FormatException('"labels" is not an object'),
    },
    description: switch (json['description']) {
      null => '',
      Object $1 => decodeString($1),
    },
    driftBaseFeatureMonitorJobId:
        switch (json['driftBaseFeatureMonitorJobId']) {
          null => 0,
          Object $1 => decodeInt64($1),
        },
    driftBaseSnapshotTime: switch (json['driftBaseSnapshotTime']) {
      null => null,
      Object $1 => protobuf.Timestamp.fromJson($1),
    },
    featureSelectionConfig: switch (json['featureSelectionConfig']) {
      null => null,
      Object $1 => FeatureSelectionConfig.fromJson($1),
    },
    triggerType: switch (json['triggerType']) {
      null => FeatureMonitorJob_FeatureMonitorJobTrigger.$default,
      Object $1 => FeatureMonitorJob_FeatureMonitorJobTrigger.fromJson($1),
    },
  );
}