Connection.fromJson constructor

Connection.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory Connection.fromJson(Map<String, dynamic> json) {
  return Connection(
    connectedDeviceId: json['ConnectedDeviceId'] as String?,
    connectedLinkId: json['ConnectedLinkId'] as String?,
    connectionArn: json['ConnectionArn'] as String?,
    connectionId: json['ConnectionId'] as String?,
    createdAt: timeStampFromJson(json['CreatedAt']),
    description: json['Description'] as String?,
    deviceId: json['DeviceId'] as String?,
    globalNetworkId: json['GlobalNetworkId'] as String?,
    linkId: json['LinkId'] as String?,
    state: (json['State'] as String?)?.toConnectionState(),
    tags: (json['Tags'] as List?)
        ?.whereNotNull()
        .map((e) => Tag.fromJson(e as Map<String, dynamic>))
        .toList(),
  );
}