DetectModerationLabelsResponse.fromJson constructor

DetectModerationLabelsResponse.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory DetectModerationLabelsResponse.fromJson(Map<String, dynamic> json) {
  return DetectModerationLabelsResponse(
    humanLoopActivationOutput: json['HumanLoopActivationOutput'] != null
        ? HumanLoopActivationOutput.fromJson(
            json['HumanLoopActivationOutput'] as Map<String, dynamic>)
        : null,
    moderationLabels: (json['ModerationLabels'] as List?)
        ?.whereNotNull()
        .map((e) => ModerationLabel.fromJson(e as Map<String, dynamic>))
        .toList(),
    moderationModelVersion: json['ModerationModelVersion'] as String?,
  );
}