FeatureView_IndexConfig.fromJson constructor

FeatureView_IndexConfig.fromJson(
  1. Object? j
)

Implementation

factory FeatureView_IndexConfig.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return FeatureView_IndexConfig(
    treeAhConfig: switch (json['treeAhConfig']) {
      null => null,
      Object $1 => FeatureView_IndexConfig_TreeAhconfig.fromJson($1),
    },
    bruteForceConfig: switch (json['bruteForceConfig']) {
      null => null,
      Object $1 => FeatureView_IndexConfig_BruteForceConfig.fromJson($1),
    },
    embeddingColumn: switch (json['embeddingColumn']) {
      null => '',
      Object $1 => decodeString($1),
    },
    filterColumns: switch (json['filterColumns']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) decodeString(i)],
      _ => throw const FormatException('"filterColumns" is not a list'),
    },
    crowdingColumn: switch (json['crowdingColumn']) {
      null => '',
      Object $1 => decodeString($1),
    },
    embeddingDimension: switch (json['embeddingDimension']) {
      null => null,
      Object $1 => decodeInt($1),
    },
    distanceMeasureType: switch (json['distanceMeasureType']) {
      null => FeatureView_IndexConfig_DistanceMeasureType.$default,
      Object $1 => FeatureView_IndexConfig_DistanceMeasureType.fromJson($1),
    },
  );
}