InterconnectApplicationAwareInterconnect.fromJson constructor

InterconnectApplicationAwareInterconnect.fromJson(
  1. Object? j
)

Implementation

factory InterconnectApplicationAwareInterconnect.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return InterconnectApplicationAwareInterconnect(
    bandwidthPercentagePolicy: switch (json['bandwidthPercentagePolicy']) {
      null => null,
      Object $1 =>
        InterconnectApplicationAwareInterconnectBandwidthPercentagePolicy.fromJson(
          $1,
        ),
    },
    profileDescription: switch (json['profileDescription']) {
      null => null,
      Object $1 => decodeString($1),
    },
    shapeAveragePercentages: switch (json['shapeAveragePercentages']) {
      null => [],
      List<Object?> $1 => [
        for (final i in $1)
          InterconnectApplicationAwareInterconnectBandwidthPercentage.fromJson(
            i,
          ),
      ],
      _ => throw const FormatException(
        '"shapeAveragePercentages" is not a list',
      ),
    },
    strictPriorityPolicy: switch (json['strictPriorityPolicy']) {
      null => null,
      Object $1 =>
        InterconnectApplicationAwareInterconnectStrictPriorityPolicy.fromJson(
          $1,
        ),
    },
  );
}