TargetVpnGateway.fromJson constructor
TargetVpnGateway.fromJson(
- Object? j
Implementation
factory TargetVpnGateway.fromJson(Object? j) {
final json = j as Map<String, Object?>;
return TargetVpnGateway(
creationTimestamp: switch (json['creationTimestamp']) {
null => null,
Object $1 => decodeString($1),
},
description: switch (json['description']) {
null => null,
Object $1 => decodeString($1),
},
forwardingRules: switch (json['forwardingRules']) {
null => [],
List<Object?> $1 => [for (final i in $1) decodeString(i)],
_ => throw const FormatException('"forwardingRules" is not a list'),
},
id: switch (json['id']) {
null => null,
Object $1 => decodeUint64($1),
},
kind: switch (json['kind']) {
null => null,
Object $1 => decodeString($1),
},
labelFingerprint: switch (json['labelFingerprint']) {
null => null,
Object $1 => decodeString($1),
},
labels: switch (json['labels']) {
null => {},
Map<String, Object?> $1 => {
for (final e in $1.entries)
decodeString(e.key): decodeString(e.value),
},
_ => throw const FormatException('"labels" is not an object'),
},
name: switch (json['name']) {
null => null,
Object $1 => decodeString($1),
},
network: switch (json['network']) {
null => null,
Object $1 => decodeString($1),
},
params: switch (json['params']) {
null => null,
Object $1 => TargetVpnGatewayParams.fromJson($1),
},
region: switch (json['region']) {
null => null,
Object $1 => decodeString($1),
},
selfLink: switch (json['selfLink']) {
null => null,
Object $1 => decodeString($1),
},
status: switch (json['status']) {
null => null,
Object $1 => decodeString($1),
},
tunnels: switch (json['tunnels']) {
null => [],
List<Object?> $1 => [for (final i in $1) decodeString(i)],
_ => throw const FormatException('"tunnels" is not a list'),
},
);
}