fromJson static method
Inherited by: PollVoteRestrictionReasonClosed PollVoteRestrictionReasonCountryRestricted PollVoteRestrictionReasonMembershipRequired PollVoteRestrictionReasonOther PollVoteRestrictionReasonScheduled PollVoteRestrictionReasonYetUnsent
Implementation
static PollVoteRestrictionReason? fromJson(Map<String, dynamic>? json) {
if (json == null) {
return null;
}
switch (json['@type']) {
case PollVoteRestrictionReasonClosed.constructor:
return PollVoteRestrictionReasonClosed.fromJson(json);
case PollVoteRestrictionReasonCountryRestricted.constructor:
return PollVoteRestrictionReasonCountryRestricted.fromJson(json);
case PollVoteRestrictionReasonMembershipRequired.constructor:
return PollVoteRestrictionReasonMembershipRequired.fromJson(json);
case PollVoteRestrictionReasonOther.constructor:
return PollVoteRestrictionReasonOther.fromJson(json);
case PollVoteRestrictionReasonScheduled.constructor:
return PollVoteRestrictionReasonScheduled.fromJson(json);
case PollVoteRestrictionReasonYetUnsent.constructor:
return PollVoteRestrictionReasonYetUnsent.fromJson(json);
default:
return null;
}
}