PostActionResponse.fromJson constructor
PostActionResponse.fromJson(
- Map<String, dynamic> json
)
Implementation
factory PostActionResponse.fromJson(Map<String, dynamic> json) {
String result = json['result'];
if ('no_further_action_required' == result) {
return PostActionDone();
} else if ('follow_next_url' == result) {
return PostActionNextUrl(json['next_url'], message: json['message']);
} else {
throw UnknownPostActionResponseResult("Unknown result '" +
result +
"' received in the post action response");
}
}