fromJson static method

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

Implementation

static UserPrivacySetting? fromJson(Map<String, dynamic>? json) {
  if (json == null) {
    return null;
  }

  switch (json['@type']) {
    case UserPrivacySettingAllowCalls.constructor:
      return UserPrivacySettingAllowCalls.fromJson(json);

    case UserPrivacySettingAllowChatInvites.constructor:
      return UserPrivacySettingAllowChatInvites.fromJson(json);

    case UserPrivacySettingAllowFindingByPhoneNumber.constructor:
      return UserPrivacySettingAllowFindingByPhoneNumber.fromJson(json);

    case UserPrivacySettingAllowPeerToPeerCalls.constructor:
      return UserPrivacySettingAllowPeerToPeerCalls.fromJson(json);

    case UserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages.constructor:
      return UserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages.fromJson(
        json,
      );

    case UserPrivacySettingAllowUnpaidMessages.constructor:
      return UserPrivacySettingAllowUnpaidMessages.fromJson(json);

    case UserPrivacySettingAutosaveGifts.constructor:
      return UserPrivacySettingAutosaveGifts.fromJson(json);

    case UserPrivacySettingShowBio.constructor:
      return UserPrivacySettingShowBio.fromJson(json);

    case UserPrivacySettingShowBirthdate.constructor:
      return UserPrivacySettingShowBirthdate.fromJson(json);

    case UserPrivacySettingShowLinkInForwardedMessages.constructor:
      return UserPrivacySettingShowLinkInForwardedMessages.fromJson(json);

    case UserPrivacySettingShowPhoneNumber.constructor:
      return UserPrivacySettingShowPhoneNumber.fromJson(json);

    case UserPrivacySettingShowProfileAudio.constructor:
      return UserPrivacySettingShowProfileAudio.fromJson(json);

    case UserPrivacySettingShowProfilePhoto.constructor:
      return UserPrivacySettingShowProfilePhoto.fromJson(json);

    case UserPrivacySettingShowStatus.constructor:
      return UserPrivacySettingShowStatus.fromJson(json);

    default:
      return null;
  }
}