Link.fromJson constructor

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

Implementation

factory Link.fromJson(Map<String, dynamic> json) {
  return Link(
    bandwidth: json['Bandwidth'] != null
        ? Bandwidth.fromJson(json['Bandwidth'] as Map<String, dynamic>)
        : null,
    createdAt: timeStampFromJson(json['CreatedAt']),
    description: json['Description'] as String?,
    globalNetworkId: json['GlobalNetworkId'] as String?,
    linkArn: json['LinkArn'] as String?,
    linkId: json['LinkId'] as String?,
    provider: json['Provider'] as String?,
    siteId: json['SiteId'] as String?,
    state: (json['State'] as String?)?.toLinkState(),
    tags: (json['Tags'] as List?)
        ?.whereNotNull()
        .map((e) => Tag.fromJson(e as Map<String, dynamic>))
        .toList(),
    type: json['Type'] as String?,
  );
}