Tunnel.fromJson constructor
Implementation
factory Tunnel.fromJson(Map<String, dynamic> json) {
return Tunnel(
createdAt: timeStampFromJson(json['createdAt']),
description: json['description'] as String?,
destinationConfig: json['destinationConfig'] != null
? DestinationConfig.fromJson(
json['destinationConfig'] as Map<String, dynamic>)
: null,
destinationConnectionState: json['destinationConnectionState'] != null
? ConnectionState.fromJson(
json['destinationConnectionState'] as Map<String, dynamic>)
: null,
lastUpdatedAt: timeStampFromJson(json['lastUpdatedAt']),
sourceConnectionState: json['sourceConnectionState'] != null
? ConnectionState.fromJson(
json['sourceConnectionState'] as Map<String, dynamic>)
: null,
status: (json['status'] as String?)?.toTunnelStatus(),
tags: (json['tags'] as List?)
?.whereNotNull()
.map((e) => Tag.fromJson(e as Map<String, dynamic>))
.toList(),
timeoutConfig: json['timeoutConfig'] != null
? TimeoutConfig.fromJson(
json['timeoutConfig'] as Map<String, dynamic>)
: null,
tunnelArn: json['tunnelArn'] as String?,
tunnelId: json['tunnelId'] as String?,
);
}