UsableSubnetwork.fromJson constructor

UsableSubnetwork.fromJson(
  1. Object? j
)

Implementation

factory UsableSubnetwork.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return UsableSubnetwork(
    externalIpv6Prefix: switch (json['externalIpv6Prefix']) {
      null => null,
      Object $1 => decodeString($1),
    },
    internalIpv6Prefix: switch (json['internalIpv6Prefix']) {
      null => null,
      Object $1 => decodeString($1),
    },
    ipCidrRange: switch (json['ipCidrRange']) {
      null => null,
      Object $1 => decodeString($1),
    },
    ipv6AccessType: switch (json['ipv6AccessType']) {
      null => null,
      Object $1 => decodeString($1),
    },
    network: switch (json['network']) {
      null => null,
      Object $1 => decodeString($1),
    },
    purpose: switch (json['purpose']) {
      null => null,
      Object $1 => decodeString($1),
    },
    role: switch (json['role']) {
      null => null,
      Object $1 => decodeString($1),
    },
    secondaryIpRanges: switch (json['secondaryIpRanges']) {
      null => [],
      List<Object?> $1 => [
        for (final i in $1) UsableSubnetworkSecondaryRange.fromJson(i),
      ],
      _ => throw const FormatException('"secondaryIpRanges" is not a list'),
    },
    stackType: switch (json['stackType']) {
      null => null,
      Object $1 => decodeString($1),
    },
    subnetwork: switch (json['subnetwork']) {
      null => null,
      Object $1 => decodeString($1),
    },
  );
}