BulkSetLabelsRequest.fromJson constructor

BulkSetLabelsRequest.fromJson(
  1. Object? j
)

Implementation

factory BulkSetLabelsRequest.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return BulkSetLabelsRequest(
    labelFingerprint: switch (json['labelFingerprint']) {
      null => null,
      Object $1 => decodeString($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'),
    },
  );
}