NetworkInterface.fromJson constructor

NetworkInterface.fromJson(
  1. Object? j
)

Implementation

factory NetworkInterface.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return NetworkInterface(
    accessConfigs: switch (json['accessConfigs']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) AccessConfig.fromJson(i)],
      _ => throw const FormatException('"accessConfigs" is not a list'),
    },
    aliasIpRanges: switch (json['aliasIpRanges']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) AliasIpRange.fromJson(i)],
      _ => throw const FormatException('"aliasIpRanges" is not a list'),
    },
    aliasIpv6Ranges: switch (json['aliasIpv6Ranges']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) AliasIpRange.fromJson(i)],
      _ => throw const FormatException('"aliasIpv6Ranges" is not a list'),
    },
    enableVpcScopedDns: switch (json['enableVpcScopedDns']) {
      null => null,
      Object $1 => decodeBool($1),
    },
    fingerprint: switch (json['fingerprint']) {
      null => null,
      Object $1 => decodeString($1),
    },
    igmpQuery: switch (json['igmpQuery']) {
      null => null,
      Object $1 => decodeString($1),
    },
    internalIpv6PrefixLength: switch (json['internalIpv6PrefixLength']) {
      null => null,
      Object $1 => decodeInt($1),
    },
    ipv6AccessConfigs: switch (json['ipv6AccessConfigs']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) AccessConfig.fromJson(i)],
      _ => throw const FormatException('"ipv6AccessConfigs" is not a list'),
    },
    ipv6AccessType: switch (json['ipv6AccessType']) {
      null => null,
      Object $1 => decodeString($1),
    },
    ipv6Address: switch (json['ipv6Address']) {
      null => null,
      Object $1 => decodeString($1),
    },
    kind: switch (json['kind']) {
      null => null,
      Object $1 => decodeString($1),
    },
    name: switch (json['name']) {
      null => null,
      Object $1 => decodeString($1),
    },
    network: switch (json['network']) {
      null => null,
      Object $1 => decodeString($1),
    },
    networkAttachment: switch (json['networkAttachment']) {
      null => null,
      Object $1 => decodeString($1),
    },
    networkIP: switch (json['networkIP']) {
      null => null,
      Object $1 => decodeString($1),
    },
    nicType: switch (json['nicType']) {
      null => null,
      Object $1 => decodeString($1),
    },
    parentNicName: switch (json['parentNicName']) {
      null => null,
      Object $1 => decodeString($1),
    },
    queueCount: switch (json['queueCount']) {
      null => null,
      Object $1 => decodeInt($1),
    },
    serviceClassId: switch (json['serviceClassId']) {
      null => null,
      Object $1 => decodeString($1),
    },
    stackType: switch (json['stackType']) {
      null => null,
      Object $1 => decodeString($1),
    },
    subnetwork: switch (json['subnetwork']) {
      null => null,
      Object $1 => decodeString($1),
    },
    vlan: switch (json['vlan']) {
      null => null,
      Object $1 => decodeInt($1),
    },
  );
}