toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['code'] = code;
  data['desc'] = desc;
  dynamic toJsonData = this.data;
  if (this.data == null) {
    data['data'] = this.data;
  } else {
    if (T == V2TimMessage) {
      toJsonData = (this.data as V2TimMessage).toJson();
    } else if (T == V2TimFollowTypeCheckResult) {
      toJsonData = (this.data as V2TimFollowTypeCheckResult).toJson();
    } else if (T == V2TimConversationFilter) {
      toJsonData = (this.data as V2TimConversationFilter).toJson();
    } else if (T == V2TimUserInfoResult) {
      toJsonData = (this.data as V2TimUserInfoResult).toJson();
    } else if (T == V2TimFollowInfo) {
      toJsonData = (this.data as V2TimFollowInfo).toJson();
    } else if (T == V2TimMessageListResult) {
      toJsonData = (this.data as V2TimMessageListResult).toJson();
    } else if (T == V2TimUserFullInfo) {
      toJsonData = (this.data as V2TimUserFullInfo).toJson();
    } else if (T == _getT<List<V2TimOfficialAccountInfoResult>>()) {
      toJsonData = (this.data as List)
          .map((e) => (e as V2TimOfficialAccountInfoResult).toJson())
          .toList();
    } else if (T == _getT<List<V2TimPermissionGroupMemberOperationResult>>()) {
      toJsonData = (this.data as List).map((e) => (e as V2TimPermissionGroupMemberOperationResult).toJson()).toList();
    } else if (T == _getT<List<V2TimPermissionGroupOperationResult>>()) {
      toJsonData = (this.data as List).map((e) => (e as V2TimPermissionGroupOperationResult).toJson()).toList();
    } else if (T == _getT<List<V2TimTopicPermissionResult>>()) {
      toJsonData = (this.data as List).map((e) => (e as V2TimTopicPermissionResult).toJson()).toList();
    } else if (T == _getT<List<V2TimFollowInfo>>()) {
      toJsonData = (this.data as List)
          .map((e) => (e as V2TimFollowInfo).toJson())
          .toList();
    } else if (T == _getT<List<V2TimFollowTypeCheckResult>>()) {
      toJsonData = (this.data as List)
          .map((e) => (e as V2TimFollowTypeCheckResult).toJson())
          .toList();
    } else if (T == _getT<List<V2TimFollowOperationResult>>()) {
      toJsonData = (this.data as List)
          .map((e) => (e as V2TimFollowOperationResult).toJson())
          .toList();
    } else if (T == _getT<List<V2TimUserFullInfo>>()) {
      toJsonData = (this.data as List)
          .map((e) => (e as V2TimUserFullInfo).toJson())
          .toList();
    } else if (T == _getT<List<V2TimGroupInfo>>()) {
      toJsonData = (this.data as List)
          .map((e) => (e as V2TimGroupInfo).toJson())
          .toList();
    } else if (T == _getT<List<V2TimGroupInfoResult>>()) {
      toJsonData = (this.data as List)
          .map((e) => (e as V2TimGroupInfoResult).toJson())
          .toList();
    } else if (T == _getT<Map<String, String>>()) {
      toJsonData = this.data as Map<String, String>;
    } else if (T == _getT<Map<String, int>>()) {
      toJsonData = this.data as Map<String, int>;
    } else if (T == V2TimGroupMemberInfoResult) {
      toJsonData = (this.data as V2TimGroupMemberInfoResult).toJson();
    } else if (T == _getT<List<V2TimGroupMemberFullInfo>>()) {
      toJsonData = (this.data as List)
          .map((e) => (e as V2TimGroupMemberFullInfo).toJson())
          .toList();
    } else if (T == _getT<List<V2TimMessageReactionResult>>()) {
      toJsonData = (this.data as List)
          .map((e) => (e as V2TimMessageReactionResult).toJson())
          .toList();
    } else if (T == _getT<List<V2TimGroupMemberOperationResult>>()) {
      toJsonData = (this.data as List)
          .map((e) => (e as V2TimGroupMemberOperationResult).toJson())
          .toList();
    } else if (T == V2TimGroupApplicationResult) {
      toJsonData = (this.data as V2TimGroupApplicationResult).toJson();
    } else if (T == V2TimConversation) {
      toJsonData = (this.data as V2TimConversation).toJson();
    } else if (T == V2TimConversationResult) {
      toJsonData = (this.data as V2TimConversationResult).toJson();
    } else if (T == _getT<List<V2TimFriendInfo>>()) {
      toJsonData = (this.data as List)
          .map((e) => (e as V2TimFriendInfo).toJson())
          .toList();
    } else if (T == _getT<List<V2TimFriendInfoResult>>()) {
      toJsonData = (this.data as List)
          .map((e) => (e as V2TimFriendInfoResult).toJson())
          .toList();
    } else if (T == _getT<List<V2TimReceiveMessageOptInfo>>()) {
      toJsonData = (this.data as List)
          .map((e) => (e as V2TimReceiveMessageOptInfo).toJson())
          .toList();
    } else if (T == V2TimFriendOperationResult) {
      toJsonData = (this.data as V2TimFriendOperationResult).toJson();
    } else if (T == _getT<List<V2TimFriendOperationResult>>()) {
      toJsonData = (this.data as List)
          .map((e) => (e as V2TimFriendOperationResult).toJson())
          .toList();
    } else if (T == V2TimFriendCheckResult) {
      toJsonData = (this.data as V2TimFriendCheckResult).toJson();
    } else if (T == _getT<List<V2TimFriendCheckResult>>()) {
      toJsonData = (this.data as List)
          .map((e) => (e as V2TimFriendCheckResult).toJson())
          .toList();
    } else if (T == V2TimFriendApplicationResult) {
      toJsonData = (this.data as V2TimFriendApplicationResult).toJson();
    } else if (T == _getT<List<V2TimFriendGroup>>()) {
      toJsonData = (this.data as List)
          .map((e) => (e as V2TimFriendGroup).toJson())
          .toList();
    } else if (T == _getT<List<V2TimMessage>>()) {
      toJsonData = (this.data as List)
          .map((e) => (e as V2TimMessage).toJson())
          .toList();
    } else if (T == _getT<List<V2TimMessageExtensionResult>>()) {
      toJsonData = (this.data as List)
          .map((e) => (e as V2TimMessageExtensionResult).toJson())
          .toList();
    } else if (T == _getT<List<V2TimMessageExtension>>()) {
      toJsonData = (this.data as List)
          .map((e) => (e as V2TimMessageExtension).toJson())
          .toList();
    } else if (T == V2TimMessageSearchResult) {
      toJsonData = (this.data as V2TimMessageSearchResult).toJson();
    } else if (T == V2TimMessageOnlineUrl) {
      toJsonData = (this.data as V2TimMessageOnlineUrl).toJson();
    } else if (T == V2TimSignalingInfo) {
      toJsonData = (this.data as V2TimSignalingInfo).toJson();
    } else if (T == V2TimReceiveMessageOptInfo) {
      toJsonData = (this.data as V2TimReceiveMessageOptInfo).toJson();
    } else if (T == V2TimMsgCreateInfoResult) {
      toJsonData = (this.data as V2TimMsgCreateInfoResult).toJson();
    } else if (T == V2TimMessageChangeInfo) {
      toJsonData = (this.data as V2TimMessageChangeInfo).toJson();
    } else if (T == V2TimPermissionGroupMemberInfoResult) {
      toJsonData = (this.data as V2TimPermissionGroupMemberInfoResult).toJson();
    } else if (T == V2TimConversationOperationResult) {
      toJsonData = (this.data as V2TimConversationOperationResult).toJson();
    } else if (T == V2TimGroupMessageReadMemberList) {
      toJsonData = (this.data as V2TimGroupMessageReadMemberList).toJson();
    } else if (T == _getT<List<V2TimMessageReceipt>>()) {
      toJsonData = (this.data as List)
          .map((e) => (e as V2TimMessageReceipt).toJson())
          .toList();
    } else if (T == _getT<List<V2TimTopicInfoResult>>()) {
      toJsonData = (this.data as List)
          .map((e) => (e as V2TimTopicInfoResult).toJson())
          .toList();
    } else if (T == _getT<List<V2TimTopicOperationResult>>()) {
      toJsonData = (this.data as List)
          .map((e) => (e as V2TimTopicOperationResult).toJson())
          .toList();
    } else if (T == _getT<List<V2TimGroupInfo>>()) {
      toJsonData = (this.data as List)
          .map((e) => (e as V2TimGroupInfo).toJson())
          .toList();
    } else if (T == _getT<List<V2TimUserStatus>>()) {
      toJsonData = (this.data as List)
          .map((e) => (e as V2TimUserStatus).toJson())
          .toList();
    } else if (T == _getT<List<V2TimPermissionGroupInfoResult>>()) {
      toJsonData = (this.data as List).map((e) => (e as V2TimPermissionGroupInfoResult).toJson()).toList();
    } else if (T == _getT<List<V2TimConversationOperationResult>>()) {
      toJsonData = (this.data as List)
          .map((e) => (e as V2TimConversationOperationResult).toJson())
          .toList();
    } else if (T == V2TimReceiveMessageOptInfo) {
      toJsonData = (this.data as V2TimReceiveMessageOptInfo).toJson();
    } else if (T == V2TimMessageReactionResult) {
      toJsonData = (this.data as V2TimMessageReactionResult).toJson();
    } else if (T == V2TimMessageReactionUserResult) {
      toJsonData = (this.data as V2TimMessageReactionUserResult).toJson();
    } else {
      toJsonData = this.data;
    }
    data['data'] = toJsonData;
  }
  return data;
}