ChannelSpecification.fromJson constructor

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

Implementation

factory ChannelSpecification.fromJson(Map<String, dynamic> json) {
  return ChannelSpecification(
    name: json['Name'] as String,
    supportedContentTypes: (json['SupportedContentTypes'] as List)
        .whereNotNull()
        .map((e) => e as String)
        .toList(),
    supportedInputModes: (json['SupportedInputModes'] as List)
        .whereNotNull()
        .map((e) => (e as String).toTrainingInputMode())
        .toList(),
    description: json['Description'] as String?,
    isRequired: json['IsRequired'] as bool?,
    supportedCompressionTypes: (json['SupportedCompressionTypes'] as List?)
        ?.whereNotNull()
        .map((e) => (e as String).toCompressionType())
        .toList(),
  );
}