Channel.fromJson constructor

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

Implementation

factory Channel.fromJson(Map<String, dynamic> json) {
  return Channel(
    arn: json['arn'] as String?,
    creationTime: timeStampFromJson(json['creationTime']),
    lastMessageArrivalTime: timeStampFromJson(json['lastMessageArrivalTime']),
    lastUpdateTime: timeStampFromJson(json['lastUpdateTime']),
    name: json['name'] as String?,
    retentionPeriod: json['retentionPeriod'] != null
        ? RetentionPeriod.fromJson(
            json['retentionPeriod'] as Map<String, dynamic>)
        : null,
    status: (json['status'] as String?)?.toChannelStatus(),
    storage: json['storage'] != null
        ? ChannelStorage.fromJson(json['storage'] as Map<String, dynamic>)
        : null,
  );
}