

#import "ArgumentAdapter.h"

RCIMIWGroupReadReceiptVersion toGroupReadReceiptVersion(NSUInteger version) {
  static NSDictionary<NSNumber *, NSNumber *> *RCIMIWGroupReadReceiptVersion_map = nil;
  if (!RCIMIWGroupReadReceiptVersion_map) {
    RCIMIWGroupReadReceiptVersion_map = @{@(0) : @(RCIMIWGroupReadReceiptVersionUnknown), @(1) : @(RCIMIWGroupReadReceiptVersion1), @(2) : @(RCIMIWGroupReadReceiptVersion2), @(3) : @(RCIMIWGroupReadReceiptVersion4), @(4) : @(RCIMIWGroupReadReceiptVersion5)};
  }
  NSNumber *value = RCIMIWGroupReadReceiptVersion_map[@(version)];
  if (!value)
    value = @(RCIMIWGroupReadReceiptVersionUnknown);

  return (RCIMIWGroupReadReceiptVersion)[value integerValue];
}

NSUInteger GroupReadReceiptVersionToNum(RCIMIWGroupReadReceiptVersion version) {
  static NSDictionary<NSNumber *, NSNumber *> *RCIMIWGroupReadReceiptVersion_map = nil;
  if (!RCIMIWGroupReadReceiptVersion_map) {
    RCIMIWGroupReadReceiptVersion_map = @{@(RCIMIWGroupReadReceiptVersionUnknown) : @(0), @(RCIMIWGroupReadReceiptVersion1) : @(1), @(RCIMIWGroupReadReceiptVersion2) : @(2), @(RCIMIWGroupReadReceiptVersion4) : @(3), @(RCIMIWGroupReadReceiptVersion5) : @(4)};
  }
  NSNumber *value = RCIMIWGroupReadReceiptVersion_map[@(version)];
  if (!value)
    value = @(0);

  return [value unsignedIntegerValue];
}

RCIMIWImportanceHW toImportanceHW(NSUInteger w) {
  static NSDictionary<NSNumber *, NSNumber *> *RCIMIWImportanceHW_map = nil;
  if (!RCIMIWImportanceHW_map) {
    RCIMIWImportanceHW_map = @{@(0) : @(RCIMIWImportanceHWNormal), @(1) : @(RCIMIWImportanceHWLow)};
  }
  NSNumber *value = RCIMIWImportanceHW_map[@(w)];
  if (!value)
    value = @(RCIMIWImportanceHWNormal);

  return (RCIMIWImportanceHW)[value integerValue];
}

NSUInteger ImportanceHWToNum(RCIMIWImportanceHW w) {
  static NSDictionary<NSNumber *, NSNumber *> *RCIMIWImportanceHW_map = nil;
  if (!RCIMIWImportanceHW_map) {
    RCIMIWImportanceHW_map = @{@(RCIMIWImportanceHWNormal) : @(0), @(RCIMIWImportanceHWLow) : @(1)};
  }
  NSNumber *value = RCIMIWImportanceHW_map[@(w)];
  if (!value)
    value = @(0);

  return [value unsignedIntegerValue];
}

RCIMIWMessageOperationPolicy toMessageOperationPolicy(NSUInteger policy) {
  static NSDictionary<NSNumber *, NSNumber *> *RCIMIWMessageOperationPolicy_map = nil;
  if (!RCIMIWMessageOperationPolicy_map) {
    RCIMIWMessageOperationPolicy_map = @{@(0) : @(RCIMIWMessageOperationPolicyLocal), @(1) : @(RCIMIWMessageOperationPolicyRemote), @(2) : @(RCIMIWMessageOperationPolicyLocalRemote)};
  }
  NSNumber *value = RCIMIWMessageOperationPolicy_map[@(policy)];
  if (!value)
    value = @(RCIMIWMessageOperationPolicyLocal);

  return (RCIMIWMessageOperationPolicy)[value integerValue];
}

NSUInteger MessageOperationPolicyToNum(RCIMIWMessageOperationPolicy policy) {
  static NSDictionary<NSNumber *, NSNumber *> *RCIMIWMessageOperationPolicy_map = nil;
  if (!RCIMIWMessageOperationPolicy_map) {
    RCIMIWMessageOperationPolicy_map = @{@(RCIMIWMessageOperationPolicyLocal) : @(0), @(RCIMIWMessageOperationPolicyRemote) : @(1), @(RCIMIWMessageOperationPolicyLocalRemote) : @(2)};
  }
  NSNumber *value = RCIMIWMessageOperationPolicy_map[@(policy)];
  if (!value)
    value = @(0);

  return [value unsignedIntegerValue];
}

RCIMIWNativeCustomMessagePersistentFlag toNativeCustomMessagePersistentFlag(NSUInteger flag) {
  static NSDictionary<NSNumber *, NSNumber *> *RCIMIWNativeCustomMessagePersistentFlag_map = nil;
  if (!RCIMIWNativeCustomMessagePersistentFlag_map) {
    RCIMIWNativeCustomMessagePersistentFlag_map = @{@(0) : @(RCIMIWNativeCustomMessagePersistentNone), @(1) : @(RCIMIWNativeCustomMessagePersistentPersisted), @(2) : @(RCIMIWNativeCustomMessagePersistentCounted), @(3) : @(RCIMIWNativeCustomMessagePersistentStatus)};
  }
  NSNumber *value = RCIMIWNativeCustomMessagePersistentFlag_map[@(flag)];
  if (!value)
    value = @(RCIMIWNativeCustomMessagePersistentNone);

  return (RCIMIWNativeCustomMessagePersistentFlag)[value integerValue];
}

NSUInteger NativeCustomMessagePersistentFlagToNum(RCIMIWNativeCustomMessagePersistentFlag flag) {
  static NSDictionary<NSNumber *, NSNumber *> *RCIMIWNativeCustomMessagePersistentFlag_map = nil;
  if (!RCIMIWNativeCustomMessagePersistentFlag_map) {
    RCIMIWNativeCustomMessagePersistentFlag_map = @{@(RCIMIWNativeCustomMessagePersistentNone) : @(0), @(RCIMIWNativeCustomMessagePersistentPersisted) : @(1), @(RCIMIWNativeCustomMessagePersistentCounted) : @(2), @(RCIMIWNativeCustomMessagePersistentStatus) : @(3)};
  }
  NSNumber *value = RCIMIWNativeCustomMessagePersistentFlag_map[@(flag)];
  if (!value)
    value = @(0);

  return [value unsignedIntegerValue];
}

RCIMIWVIVOPushType toVIVOPushType(NSUInteger type) {
  static NSDictionary<NSNumber *, NSNumber *> *RCIMIWVIVOPushType_map = nil;
  if (!RCIMIWVIVOPushType_map) {
    RCIMIWVIVOPushType_map = @{@(0) : @(RCIMIWVIVOPushTypeOperate), @(1) : @(RCIMIWVIVOPushTypeSystem)};
  }
  NSNumber *value = RCIMIWVIVOPushType_map[@(type)];
  if (!value)
    value = @(RCIMIWVIVOPushTypeOperate);

  return (RCIMIWVIVOPushType)[value integerValue];
}

NSUInteger VIVOPushTypeToNum(RCIMIWVIVOPushType type) {
  static NSDictionary<NSNumber *, NSNumber *> *RCIMIWVIVOPushType_map = nil;
  if (!RCIMIWVIVOPushType_map) {
    RCIMIWVIVOPushType_map = @{@(RCIMIWVIVOPushTypeOperate) : @(0), @(RCIMIWVIVOPushTypeSystem) : @(1)};
  }
  NSNumber *value = RCIMIWVIVOPushType_map[@(type)];
  if (!value)
    value = @(0);

  return [value unsignedIntegerValue];
}

RCIMIWSentStatus toSentStatus(NSUInteger status) {
  static NSDictionary<NSNumber *, NSNumber *> *RCIMIWSentStatus_map = nil;
  if (!RCIMIWSentStatus_map) {
    RCIMIWSentStatus_map = @{@(0) : @(RCIMIWSentStatusSending), @(1) : @(RCIMIWSentStatusFailed), @(2) : @(RCIMIWSentStatusSent), @(3) : @(RCIMIWSentStatusReceived), @(4) : @(RCIMIWSentStatusRead), @(5) : @(RCIMIWSentStatusDestroyed), @(6) : @(RCIMIWSentStatusCanceled)};
  }
  NSNumber *value = RCIMIWSentStatus_map[@(status)];
  if (!value)
    value = @(RCIMIWSentStatusSending);

  return (RCIMIWSentStatus)[value integerValue];
}

NSUInteger SentStatusToNum(RCIMIWSentStatus status) {
  static NSDictionary<NSNumber *, NSNumber *> *RCIMIWSentStatus_map = nil;
  if (!RCIMIWSentStatus_map) {
    RCIMIWSentStatus_map = @{@(RCIMIWSentStatusSending) : @(0), @(RCIMIWSentStatusFailed) : @(1), @(RCIMIWSentStatusSent) : @(2), @(RCIMIWSentStatusReceived) : @(3), @(RCIMIWSentStatusRead) : @(4), @(RCIMIWSentStatusDestroyed) : @(5), @(RCIMIWSentStatusCanceled) : @(6)};
  }
  NSNumber *value = RCIMIWSentStatus_map[@(status)];
  if (!value)
    value = @(0);

  return [value unsignedIntegerValue];
}

RCIMIWChatRoomSyncStatus toChatRoomSyncStatus(NSUInteger status) {
  static NSDictionary<NSNumber *, NSNumber *> *RCIMIWChatRoomSyncStatus_map = nil;
  if (!RCIMIWChatRoomSyncStatus_map) {
    RCIMIWChatRoomSyncStatus_map = @{@(0) : @(RCIMIWChatRoomSyncStatusQuit), @(1) : @(RCIMIWChatRoomSyncStatusJoin)};
  }
  NSNumber *value = RCIMIWChatRoomSyncStatus_map[@(status)];
  if (!value)
    value = @(RCIMIWChatRoomSyncStatusQuit);

  return (RCIMIWChatRoomSyncStatus)[value integerValue];
}

NSUInteger ChatRoomSyncStatusToNum(RCIMIWChatRoomSyncStatus status) {
  static NSDictionary<NSNumber *, NSNumber *> *RCIMIWChatRoomSyncStatus_map = nil;
  if (!RCIMIWChatRoomSyncStatus_map) {
    RCIMIWChatRoomSyncStatus_map = @{@(RCIMIWChatRoomSyncStatusQuit) : @(0), @(RCIMIWChatRoomSyncStatusJoin) : @(1)};
  }
  NSNumber *value = RCIMIWChatRoomSyncStatus_map[@(status)];
  if (!value)
    value = @(0);

  return [value unsignedIntegerValue];
}

RCIMIWPushNotificationQuietHoursLevel toPushNotificationQuietHoursLevel(NSUInteger level) {
  static NSDictionary<NSNumber *, NSNumber *> *RCIMIWPushNotificationQuietHoursLevel_map = nil;
  if (!RCIMIWPushNotificationQuietHoursLevel_map) {
    RCIMIWPushNotificationQuietHoursLevel_map = @{@(0) : @(RCIMIWPushNotificationQuietHoursLevelNone), @(1) : @(RCIMIWPushNotificationQuietHoursLevelMention), @(2) : @(RCIMIWPushNotificationQuietHoursLevelBlocked)};
  }
  NSNumber *value = RCIMIWPushNotificationQuietHoursLevel_map[@(level)];
  if (!value)
    value = @(RCIMIWPushNotificationQuietHoursLevelNone);

  return (RCIMIWPushNotificationQuietHoursLevel)[value integerValue];
}

NSUInteger PushNotificationQuietHoursLevelToNum(RCIMIWPushNotificationQuietHoursLevel level) {
  static NSDictionary<NSNumber *, NSNumber *> *RCIMIWPushNotificationQuietHoursLevel_map = nil;
  if (!RCIMIWPushNotificationQuietHoursLevel_map) {
    RCIMIWPushNotificationQuietHoursLevel_map = @{@(RCIMIWPushNotificationQuietHoursLevelNone) : @(0), @(RCIMIWPushNotificationQuietHoursLevelMention) : @(1), @(RCIMIWPushNotificationQuietHoursLevelBlocked) : @(2)};
  }
  NSNumber *value = RCIMIWPushNotificationQuietHoursLevel_map[@(level)];
  if (!value)
    value = @(0);

  return [value unsignedIntegerValue];
}

RCIMIWMessageDirection toMessageDirection(NSUInteger direction) {
  static NSDictionary<NSNumber *, NSNumber *> *RCIMIWMessageDirection_map = nil;
  if (!RCIMIWMessageDirection_map) {
    RCIMIWMessageDirection_map = @{@(0) : @(RCIMIWMessageDirectionSend), @(1) : @(RCIMIWMessageDirectionReceive)};
  }
  NSNumber *value = RCIMIWMessageDirection_map[@(direction)];
  if (!value)
    value = @(RCIMIWMessageDirectionSend);

  return (RCIMIWMessageDirection)[value integerValue];
}

NSUInteger MessageDirectionToNum(RCIMIWMessageDirection direction) {
  static NSDictionary<NSNumber *, NSNumber *> *RCIMIWMessageDirection_map = nil;
  if (!RCIMIWMessageDirection_map) {
    RCIMIWMessageDirection_map = @{@(RCIMIWMessageDirectionSend) : @(0), @(RCIMIWMessageDirectionReceive) : @(1)};
  }
  NSNumber *value = RCIMIWMessageDirection_map[@(direction)];
  if (!value)
    value = @(0);

  return [value unsignedIntegerValue];
}

RCIMIWReceivedStatus toReceivedStatus(NSUInteger status) {
  static NSDictionary<NSNumber *, NSNumber *> *RCIMIWReceivedStatus_map = nil;
  if (!RCIMIWReceivedStatus_map) {
    RCIMIWReceivedStatus_map = @{@(0) : @(RCIMIWReceivedStatusUnread), @(1) : @(RCIMIWReceivedStatusRead), @(2) : @(RCIMIWReceivedStatusListened), @(3) : @(RCIMIWReceivedStatusDownloaded), @(4) : @(RCIMIWReceivedStatusRetrieved), @(5) : @(RCIMIWReceivedStatusMultipleReceive)};
  }
  NSNumber *value = RCIMIWReceivedStatus_map[@(status)];
  if (!value)
    value = @(RCIMIWReceivedStatusUnread);

  return (RCIMIWReceivedStatus)[value integerValue];
}

NSUInteger ReceivedStatusToNum(RCIMIWReceivedStatus status) {
  static NSDictionary<NSNumber *, NSNumber *> *RCIMIWReceivedStatus_map = nil;
  if (!RCIMIWReceivedStatus_map) {
    RCIMIWReceivedStatus_map = @{@(RCIMIWReceivedStatusUnread) : @(0), @(RCIMIWReceivedStatusRead) : @(1), @(RCIMIWReceivedStatusListened) : @(2), @(RCIMIWReceivedStatusDownloaded) : @(3), @(RCIMIWReceivedStatusRetrieved) : @(4), @(RCIMIWReceivedStatusMultipleReceive) : @(5)};
  }
  NSNumber *value = RCIMIWReceivedStatus_map[@(status)];
  if (!value)
    value = @(0);

  return [value unsignedIntegerValue];
}

RCIMIWChatRoomMemberActionType toChatRoomMemberActionType(NSUInteger type) {
  static NSDictionary<NSNumber *, NSNumber *> *RCIMIWChatRoomMemberActionType_map = nil;
  if (!RCIMIWChatRoomMemberActionType_map) {
    RCIMIWChatRoomMemberActionType_map = @{@(0) : @(RCIMIWChatRoomMemberActionTypeUnknown), @(1) : @(RCIMIWChatRoomMemberActionTypeJoin), @(2) : @(RCIMIWChatRoomMemberActionTypeLeave)};
  }
  NSNumber *value = RCIMIWChatRoomMemberActionType_map[@(type)];
  if (!value)
    value = @(RCIMIWChatRoomMemberActionTypeUnknown);

  return (RCIMIWChatRoomMemberActionType)[value integerValue];
}

NSUInteger ChatRoomMemberActionTypeToNum(RCIMIWChatRoomMemberActionType type) {
  static NSDictionary<NSNumber *, NSNumber *> *RCIMIWChatRoomMemberActionType_map = nil;
  if (!RCIMIWChatRoomMemberActionType_map) {
    RCIMIWChatRoomMemberActionType_map = @{@(RCIMIWChatRoomMemberActionTypeUnknown) : @(0), @(RCIMIWChatRoomMemberActionTypeJoin) : @(1), @(RCIMIWChatRoomMemberActionTypeLeave) : @(2)};
  }
  NSNumber *value = RCIMIWChatRoomMemberActionType_map[@(type)];
  if (!value)
    value = @(0);

  return [value unsignedIntegerValue];
}

RCIMIWPushNotificationLevel toPushNotificationLevel(NSUInteger level) {
  static NSDictionary<NSNumber *, NSNumber *> *RCIMIWPushNotificationLevel_map = nil;
  if (!RCIMIWPushNotificationLevel_map) {
    RCIMIWPushNotificationLevel_map = @{@(0) : @(RCIMIWPushNotificationLevelAllMessage), @(1) : @(RCIMIWPushNotificationLevelNone), @(2) : @(RCIMIWPushNotificationLevelMention), @(3) : @(RCIMIWPushNotificationLevelMentionUsers), @(4) : @(RCIMIWPushNotificationLevelMentionAll), @(5) : @(RCIMIWPushNotificationLevelBlocked)};
  }
  NSNumber *value = RCIMIWPushNotificationLevel_map[@(level)];
  if (!value)
    value = @(RCIMIWPushNotificationLevelAllMessage);

  return (RCIMIWPushNotificationLevel)[value integerValue];
}

NSUInteger PushNotificationLevelToNum(RCIMIWPushNotificationLevel level) {
  static NSDictionary<NSNumber *, NSNumber *> *RCIMIWPushNotificationLevel_map = nil;
  if (!RCIMIWPushNotificationLevel_map) {
    RCIMIWPushNotificationLevel_map = @{@(RCIMIWPushNotificationLevelAllMessage) : @(0), @(RCIMIWPushNotificationLevelNone) : @(1), @(RCIMIWPushNotificationLevelMention) : @(2), @(RCIMIWPushNotificationLevelMentionUsers) : @(3), @(RCIMIWPushNotificationLevelMentionAll) : @(4), @(RCIMIWPushNotificationLevelBlocked) : @(5)};
  }
  NSNumber *value = RCIMIWPushNotificationLevel_map[@(level)];
  if (!value)
    value = @(0);

  return [value unsignedIntegerValue];
}

RCIMIWReadReceiptStatus toReadReceiptStatus(NSUInteger status) {
  static NSDictionary<NSNumber *, NSNumber *> *RCIMIWReadReceiptStatus_map = nil;
  if (!RCIMIWReadReceiptStatus_map) {
    RCIMIWReadReceiptStatus_map = @{@(0) : @(RCIMIWReadReceiptStatusRead), @(1) : @(RCIMIWReadReceiptStatusUnread)};
  }
  NSNumber *value = RCIMIWReadReceiptStatus_map[@(status)];
  if (!value)
    value = @(RCIMIWReadReceiptStatusRead);

  return (RCIMIWReadReceiptStatus)[value integerValue];
}

NSUInteger ReadReceiptStatusToNum(RCIMIWReadReceiptStatus status) {
  static NSDictionary<NSNumber *, NSNumber *> *RCIMIWReadReceiptStatus_map = nil;
  if (!RCIMIWReadReceiptStatus_map) {
    RCIMIWReadReceiptStatus_map = @{@(RCIMIWReadReceiptStatusRead) : @(0), @(RCIMIWReadReceiptStatusUnread) : @(1)};
  }
  NSNumber *value = RCIMIWReadReceiptStatus_map[@(status)];
  if (!value)
    value = @(0);

  return [value unsignedIntegerValue];
}

RCIMIWMessageType toMessageType(NSUInteger type) {
  static NSDictionary<NSNumber *, NSNumber *> *RCIMIWMessageType_map = nil;
  if (!RCIMIWMessageType_map) {
    RCIMIWMessageType_map = @{
      @(0) : @(RCIMIWMessageTypeUnknown),
      @(1) : @(RCIMIWMessageTypeCustom),
      @(2) : @(RCIMIWMessageTypeText),
      @(3) : @(RCIMIWMessageTypeVoice),
      @(4) : @(RCIMIWMessageTypeImage),
      @(5) : @(RCIMIWMessageTypeFile),
      @(6) : @(RCIMIWMessageTypeSight),
      @(7) : @(RCIMIWMessageTypeGIF),
      @(8) : @(RCIMIWMessageTypeRecall),
      @(9) : @(RCIMIWMessageTypeReference),
      @(10) : @(RCIMIWMessageTypeCommand),
      @(11) : @(RCIMIWMessageTypeCommandNotification),
      @(12) : @(RCIMIWMessageTypeLocation),
      @(13) : @(RCIMIWMessageTypeUserCustom),
      @(14) : @(RCIMIWMessageTypeNativeCustom),
      @(15) : @(RCIMIWMessageTypeNativeCustomMedia),
      @(16) : @(RCIMIWMessageTypeGroupNotification),
      @(17) : @(RCIMIWMessageTypeInformationNotification)
    };
  }
  NSNumber *value = RCIMIWMessageType_map[@(type)];
  if (!value)
    value = @(RCIMIWMessageTypeUnknown);

  return (RCIMIWMessageType)[value integerValue];
}

NSUInteger MessageTypeToNum(RCIMIWMessageType type) {
  static NSDictionary<NSNumber *, NSNumber *> *RCIMIWMessageType_map = nil;
  if (!RCIMIWMessageType_map) {
    RCIMIWMessageType_map = @{
      @(RCIMIWMessageTypeUnknown) : @(0),
      @(RCIMIWMessageTypeCustom) : @(1),
      @(RCIMIWMessageTypeText) : @(2),
      @(RCIMIWMessageTypeVoice) : @(3),
      @(RCIMIWMessageTypeImage) : @(4),
      @(RCIMIWMessageTypeFile) : @(5),
      @(RCIMIWMessageTypeSight) : @(6),
      @(RCIMIWMessageTypeGIF) : @(7),
      @(RCIMIWMessageTypeRecall) : @(8),
      @(RCIMIWMessageTypeReference) : @(9),
      @(RCIMIWMessageTypeCommand) : @(10),
      @(RCIMIWMessageTypeCommandNotification) : @(11),
      @(RCIMIWMessageTypeLocation) : @(12),
      @(RCIMIWMessageTypeUserCustom) : @(13),
      @(RCIMIWMessageTypeNativeCustom) : @(14),
      @(RCIMIWMessageTypeNativeCustomMedia) : @(15),
      @(RCIMIWMessageTypeGroupNotification) : @(16),
      @(RCIMIWMessageTypeInformationNotification) : @(17)
    };
  }
  NSNumber *value = RCIMIWMessageType_map[@(type)];
  if (!value)
    value = @(0);

  return [value unsignedIntegerValue];
}

RCIMIWMessageBlockType toMessageBlockType(NSUInteger type) {
  static NSDictionary<NSNumber *, NSNumber *> *RCIMIWMessageBlockType_map = nil;
  if (!RCIMIWMessageBlockType_map) {
    RCIMIWMessageBlockType_map = @{@(0) : @(RCIMIWMessageBlockTypeUnknown), @(1) : @(RCIMIWMessageBlockTypeGlobal), @(2) : @(RCIMIWMessageBlockTypeCustom), @(3) : @(RCIMIWMessageBlockTypeThirdParty)};
  }
  NSNumber *value = RCIMIWMessageBlockType_map[@(type)];
  if (!value)
    value = @(RCIMIWMessageBlockTypeUnknown);

  return (RCIMIWMessageBlockType)[value integerValue];
}

NSUInteger MessageBlockTypeToNum(RCIMIWMessageBlockType type) {
  static NSDictionary<NSNumber *, NSNumber *> *RCIMIWMessageBlockType_map = nil;
  if (!RCIMIWMessageBlockType_map) {
    RCIMIWMessageBlockType_map = @{@(RCIMIWMessageBlockTypeUnknown) : @(0), @(RCIMIWMessageBlockTypeGlobal) : @(1), @(RCIMIWMessageBlockTypeCustom) : @(2), @(RCIMIWMessageBlockTypeThirdParty) : @(3)};
  }
  NSNumber *value = RCIMIWMessageBlockType_map[@(type)];
  if (!value)
    value = @(0);

  return [value unsignedIntegerValue];
}

RCIMIWMessageAuditType toMessageAuditType(NSUInteger type) {
  static NSDictionary<NSNumber *, NSNumber *> *RCIMIWMessageAuditType_map = nil;
  if (!RCIMIWMessageAuditType_map) {
    RCIMIWMessageAuditType_map = @{@(0) : @(RCIMIWMessageAuditTypeDisallow), @(1) : @(RCIMIWMessageAuditTypeAllow)};
  }
  NSNumber *value = RCIMIWMessageAuditType_map[@(type)];
  if (!value)
    value = @(RCIMIWMessageAuditTypeDisallow);

  return (RCIMIWMessageAuditType)[value integerValue];
}

NSUInteger MessageAuditTypeToNum(RCIMIWMessageAuditType type) {
  static NSDictionary<NSNumber *, NSNumber *> *RCIMIWMessageAuditType_map = nil;
  if (!RCIMIWMessageAuditType_map) {
    RCIMIWMessageAuditType_map = @{@(RCIMIWMessageAuditTypeDisallow) : @(0), @(RCIMIWMessageAuditTypeAllow) : @(1)};
  }
  NSNumber *value = RCIMIWMessageAuditType_map[@(type)];
  if (!value)
    value = @(0);

  return [value unsignedIntegerValue];
}

RCIMIWChatRoomMemberBanType toChatRoomMemberBanType(NSUInteger type) {
  static NSDictionary<NSNumber *, NSNumber *> *RCIMIWChatRoomMemberBanType_map = nil;
  if (!RCIMIWChatRoomMemberBanType_map) {
    RCIMIWChatRoomMemberBanType_map = @{@(0) : @(RCIMIWChatRoomMemberBanTypeUnmuteUsers), @(1) : @(RCIMIWChatRoomMemberBanTypeMuteUsers), @(2) : @(RCIMIWChatRoomMemberBanTypeUnmuteAll), @(3) : @(RCIMIWChatRoomMemberBanTypeMuteAll), @(4) : @(RCIMIWChatRoomMemberBanTypeRemoveWhitelist), @(5) : @(RCIMIWChatRoomMemberBanTypeAddWhitelist), @(6) : @(RCIMIWChatRoomMemberBanTypeUnmuteGlobal), @(7) : @(RCIMIWChatRoomMemberBanTypeMuteGlobal)};
  }
  NSNumber *value = RCIMIWChatRoomMemberBanType_map[@(type)];
  if (!value)
    value = @(RCIMIWChatRoomMemberBanTypeUnmuteUsers);

  return (RCIMIWChatRoomMemberBanType)[value integerValue];
}

NSUInteger ChatRoomMemberBanTypeToNum(RCIMIWChatRoomMemberBanType type) {
  static NSDictionary<NSNumber *, NSNumber *> *RCIMIWChatRoomMemberBanType_map = nil;
  if (!RCIMIWChatRoomMemberBanType_map) {
    RCIMIWChatRoomMemberBanType_map = @{@(RCIMIWChatRoomMemberBanTypeUnmuteUsers) : @(0), @(RCIMIWChatRoomMemberBanTypeMuteUsers) : @(1), @(RCIMIWChatRoomMemberBanTypeUnmuteAll) : @(2), @(RCIMIWChatRoomMemberBanTypeMuteAll) : @(3), @(RCIMIWChatRoomMemberBanTypeRemoveWhitelist) : @(4), @(RCIMIWChatRoomMemberBanTypeAddWhitelist) : @(5), @(RCIMIWChatRoomMemberBanTypeUnmuteGlobal) : @(6), @(RCIMIWChatRoomMemberBanTypeMuteGlobal) : @(7)};
  }
  NSNumber *value = RCIMIWChatRoomMemberBanType_map[@(type)];
  if (!value)
    value = @(0);

  return [value unsignedIntegerValue];
}

RCIMIWReadReceiptOrder toReadReceiptOrder(NSUInteger order) {
  static NSDictionary<NSNumber *, NSNumber *> *RCIMIWReadReceiptOrder_map = nil;
  if (!RCIMIWReadReceiptOrder_map) {
    RCIMIWReadReceiptOrder_map = @{@(0) : @(RCIMIWReadReceiptOrderDescending), @(1) : @(RCIMIWReadReceiptOrderAscending)};
  }
  NSNumber *value = RCIMIWReadReceiptOrder_map[@(order)];
  if (!value)
    value = @(RCIMIWReadReceiptOrderDescending);

  return (RCIMIWReadReceiptOrder)[value integerValue];
}

NSUInteger ReadReceiptOrderToNum(RCIMIWReadReceiptOrder order) {
  static NSDictionary<NSNumber *, NSNumber *> *RCIMIWReadReceiptOrder_map = nil;
  if (!RCIMIWReadReceiptOrder_map) {
    RCIMIWReadReceiptOrder_map = @{@(RCIMIWReadReceiptOrderDescending) : @(0), @(RCIMIWReadReceiptOrderAscending) : @(1)};
  }
  NSNumber *value = RCIMIWReadReceiptOrder_map[@(order)];
  if (!value)
    value = @(0);

  return [value unsignedIntegerValue];
}

RCIMIWChatRoomMemberOperateType toChatRoomMemberOperateType(NSUInteger type) {
  static NSDictionary<NSNumber *, NSNumber *> *RCIMIWChatRoomMemberOperateType_map = nil;
  if (!RCIMIWChatRoomMemberOperateType_map) {
    RCIMIWChatRoomMemberOperateType_map = @{@(0) : @(RCIMIWChatRoomMemberOperateTypeDeblock), @(1) : @(RCIMIWChatRoomMemberOperateTypeBlocked)};
  }
  NSNumber *value = RCIMIWChatRoomMemberOperateType_map[@(type)];
  if (!value)
    value = @(RCIMIWChatRoomMemberOperateTypeDeblock);

  return (RCIMIWChatRoomMemberOperateType)[value integerValue];
}

NSUInteger ChatRoomMemberOperateTypeToNum(RCIMIWChatRoomMemberOperateType type) {
  static NSDictionary<NSNumber *, NSNumber *> *RCIMIWChatRoomMemberOperateType_map = nil;
  if (!RCIMIWChatRoomMemberOperateType_map) {
    RCIMIWChatRoomMemberOperateType_map = @{@(RCIMIWChatRoomMemberOperateTypeDeblock) : @(0), @(RCIMIWChatRoomMemberOperateTypeBlocked) : @(1)};
  }
  NSNumber *value = RCIMIWChatRoomMemberOperateType_map[@(type)];
  if (!value)
    value = @(0);

  return [value unsignedIntegerValue];
}

RCIMIWTimeOrder toTimeOrder(NSUInteger order) {
  static NSDictionary<NSNumber *, NSNumber *> *RCIMIWTimeOrder_map = nil;
  if (!RCIMIWTimeOrder_map) {
    RCIMIWTimeOrder_map = @{@(0) : @(RCIMIWTimeOrderBefore), @(1) : @(RCIMIWTimeOrderAfter)};
  }
  NSNumber *value = RCIMIWTimeOrder_map[@(order)];
  if (!value)
    value = @(RCIMIWTimeOrderBefore);

  return (RCIMIWTimeOrder)[value integerValue];
}

NSUInteger TimeOrderToNum(RCIMIWTimeOrder order) {
  static NSDictionary<NSNumber *, NSNumber *> *RCIMIWTimeOrder_map = nil;
  if (!RCIMIWTimeOrder_map) {
    RCIMIWTimeOrder_map = @{@(RCIMIWTimeOrderBefore) : @(0), @(RCIMIWTimeOrderAfter) : @(1)};
  }
  NSNumber *value = RCIMIWTimeOrder_map[@(order)];
  if (!value)
    value = @(0);

  return [value unsignedIntegerValue];
}

RCIMIWCustomMessagePolicy toCustomMessagePolicy(NSUInteger policy) {
  static NSDictionary<NSNumber *, NSNumber *> *RCIMIWCustomMessagePolicy_map = nil;
  if (!RCIMIWCustomMessagePolicy_map) {
    RCIMIWCustomMessagePolicy_map = @{@(0) : @(RCIMIWCustomMessagePolicyCommand), @(1) : @(RCIMIWCustomMessagePolicyNormal), @(2) : @(RCIMIWCustomMessagePolicyStatus), @(3) : @(RCIMIWCustomMessagePolicyStorage)};
  }
  NSNumber *value = RCIMIWCustomMessagePolicy_map[@(policy)];
  if (!value)
    value = @(RCIMIWCustomMessagePolicyCommand);

  return (RCIMIWCustomMessagePolicy)[value integerValue];
}

NSUInteger CustomMessagePolicyToNum(RCIMIWCustomMessagePolicy policy) {
  static NSDictionary<NSNumber *, NSNumber *> *RCIMIWCustomMessagePolicy_map = nil;
  if (!RCIMIWCustomMessagePolicy_map) {
    RCIMIWCustomMessagePolicy_map = @{@(RCIMIWCustomMessagePolicyCommand) : @(0), @(RCIMIWCustomMessagePolicyNormal) : @(1), @(RCIMIWCustomMessagePolicyStatus) : @(2), @(RCIMIWCustomMessagePolicyStorage) : @(3)};
  }
  NSNumber *value = RCIMIWCustomMessagePolicy_map[@(policy)];
  if (!value)
    value = @(0);

  return [value unsignedIntegerValue];
}

RCIMIWChatRoomStatus toChatRoomStatus(NSUInteger status) {
  static NSDictionary<NSNumber *, NSNumber *> *RCIMIWChatRoomStatus_map = nil;
  if (!RCIMIWChatRoomStatus_map) {
    RCIMIWChatRoomStatus_map = @{@(0) : @(RCIMIWChatRoomStatusReset), @(1) : @(RCIMIWChatRoomStatusDestroyManual), @(2) : @(RCIMIWChatRoomStatusDestroyAuto)};
  }
  NSNumber *value = RCIMIWChatRoomStatus_map[@(status)];
  if (!value)
    value = @(RCIMIWChatRoomStatusReset);

  return (RCIMIWChatRoomStatus)[value integerValue];
}

NSUInteger ChatRoomStatusToNum(RCIMIWChatRoomStatus status) {
  static NSDictionary<NSNumber *, NSNumber *> *RCIMIWChatRoomStatus_map = nil;
  if (!RCIMIWChatRoomStatus_map) {
    RCIMIWChatRoomStatus_map = @{@(RCIMIWChatRoomStatusReset) : @(0), @(RCIMIWChatRoomStatusDestroyManual) : @(1), @(RCIMIWChatRoomStatusDestroyAuto) : @(2)};
  }
  NSNumber *value = RCIMIWChatRoomStatus_map[@(status)];
  if (!value)
    value = @(0);

  return [value unsignedIntegerValue];
}

RCIMIWConversationType toConversationType(NSUInteger type) {
  static NSDictionary<NSNumber *, NSNumber *> *RCIMIWConversationType_map = nil;
  if (!RCIMIWConversationType_map) {
    RCIMIWConversationType_map = @{@(0) : @(RCIMIWConversationTypeInvalid), @(1) : @(RCIMIWConversationTypePrivate), @(2) : @(RCIMIWConversationTypeGroup), @(3) : @(RCIMIWConversationTypeChatroom), @(4) : @(RCIMIWConversationTypeSystem), @(5) : @(RCIMIWConversationTypeUltraGroup)};
  }
  NSNumber *value = RCIMIWConversationType_map[@(type)];
  if (!value)
    value = @(RCIMIWConversationTypeInvalid);

  return (RCIMIWConversationType)[value integerValue];
}

NSUInteger ConversationTypeToNum(RCIMIWConversationType type) {
  static NSDictionary<NSNumber *, NSNumber *> *RCIMIWConversationType_map = nil;
  if (!RCIMIWConversationType_map) {
    RCIMIWConversationType_map = @{@(RCIMIWConversationTypeInvalid) : @(0), @(RCIMIWConversationTypePrivate) : @(1), @(RCIMIWConversationTypeGroup) : @(2), @(RCIMIWConversationTypeChatroom) : @(3), @(RCIMIWConversationTypeSystem) : @(4), @(RCIMIWConversationTypeUltraGroup) : @(5)};
  }
  NSNumber *value = RCIMIWConversationType_map[@(type)];
  if (!value)
    value = @(0);

  return [value unsignedIntegerValue];
}

RCIMIWErrorCode toErrorCode(NSUInteger code) {
  static NSDictionary<NSNumber *, NSNumber *> *RCIMIWErrorCode_map = nil;
  if (!RCIMIWErrorCode_map) {
    RCIMIWErrorCode_map = @{@(0) : @(RCIMIWErrorCodeSuccess), @(1) : @(RCIMIWErrorCodeParamError), @(2) : @(RCIMIWErrorCodeEngineDestroyed), @(3) : @(RCIMIWErrorCodeNativeOperationError), @(4) : @(RCIMIWErrorCodeResultUnknown)};
  }
  NSNumber *value = RCIMIWErrorCode_map[@(code)];
  if (!value)
    value = @(RCIMIWErrorCodeSuccess);

  return (RCIMIWErrorCode)[value integerValue];
}

NSUInteger ErrorCodeToNum(RCIMIWErrorCode code) {
  static NSDictionary<NSNumber *, NSNumber *> *RCIMIWErrorCode_map = nil;
  if (!RCIMIWErrorCode_map) {
    RCIMIWErrorCode_map = @{@(RCIMIWErrorCodeSuccess) : @(0), @(RCIMIWErrorCodeParamError) : @(1), @(RCIMIWErrorCodeEngineDestroyed) : @(2), @(RCIMIWErrorCodeNativeOperationError) : @(3), @(RCIMIWErrorCodeResultUnknown) : @(4)};
  }
  NSNumber *value = RCIMIWErrorCode_map[@(code)];
  if (!value)
    value = @(0);

  return [value unsignedIntegerValue];
}

RCIMIWChatRoomSyncStatusReason toChatRoomSyncStatusReason(NSUInteger reason) {
  static NSDictionary<NSNumber *, NSNumber *> *RCIMIWChatRoomSyncStatusReason_map = nil;
  if (!RCIMIWChatRoomSyncStatusReason_map) {
    RCIMIWChatRoomSyncStatusReason_map = @{@(0) : @(RCIMIWChatRoomSyncStatusLeaveOnMyOwn), @(1) : @(RCIMIWChatRoomSyncStatusOtherDeviceLogin)};
  }
  NSNumber *value = RCIMIWChatRoomSyncStatusReason_map[@(reason)];
  if (!value)
    value = @(RCIMIWChatRoomSyncStatusLeaveOnMyOwn);

  return (RCIMIWChatRoomSyncStatusReason)[value integerValue];
}

NSUInteger ChatRoomSyncStatusReasonToNum(RCIMIWChatRoomSyncStatusReason reason) {
  static NSDictionary<NSNumber *, NSNumber *> *RCIMIWChatRoomSyncStatusReason_map = nil;
  if (!RCIMIWChatRoomSyncStatusReason_map) {
    RCIMIWChatRoomSyncStatusReason_map = @{@(RCIMIWChatRoomSyncStatusLeaveOnMyOwn) : @(0), @(RCIMIWChatRoomSyncStatusOtherDeviceLogin) : @(1)};
  }
  NSNumber *value = RCIMIWChatRoomSyncStatusReason_map[@(reason)];
  if (!value)
    value = @(0);

  return [value unsignedIntegerValue];
}

RCIMIWUltraGroupTypingStatus toUltraGroupTypingStatus(NSUInteger status) {
  static NSDictionary<NSNumber *, NSNumber *> *RCIMIWUltraGroupTypingStatus_map = nil;
  if (!RCIMIWUltraGroupTypingStatus_map) {
    RCIMIWUltraGroupTypingStatus_map = @{@(0) : @(RCIMIWUltraGroupTypingStatusText)};
  }
  NSNumber *value = RCIMIWUltraGroupTypingStatus_map[@(status)];
  if (!value)
    value = @(RCIMIWUltraGroupTypingStatusText);

  return (RCIMIWUltraGroupTypingStatus)[value integerValue];
}

NSUInteger UltraGroupTypingStatusToNum(RCIMIWUltraGroupTypingStatus status) {
  static NSDictionary<NSNumber *, NSNumber *> *RCIMIWUltraGroupTypingStatus_map = nil;
  if (!RCIMIWUltraGroupTypingStatus_map) {
    RCIMIWUltraGroupTypingStatus_map = @{@(RCIMIWUltraGroupTypingStatusText) : @(0)};
  }
  NSNumber *value = RCIMIWUltraGroupTypingStatus_map[@(status)];
  if (!value)
    value = @(0);

  return [value unsignedIntegerValue];
}

RCIMIWMentionedType toMentionedType(NSUInteger type) {
  static NSDictionary<NSNumber *, NSNumber *> *RCIMIWMentionedType_map = nil;
  if (!RCIMIWMentionedType_map) {
    RCIMIWMentionedType_map = @{@(0) : @(RCIMIWMentionedTypeAll), @(1) : @(RCIMIWMentionedTypePart)};
  }
  NSNumber *value = RCIMIWMentionedType_map[@(type)];
  if (!value)
    value = @(RCIMIWMentionedTypeAll);

  return (RCIMIWMentionedType)[value integerValue];
}

NSUInteger MentionedTypeToNum(RCIMIWMentionedType type) {
  static NSDictionary<NSNumber *, NSNumber *> *RCIMIWMentionedType_map = nil;
  if (!RCIMIWMentionedType_map) {
    RCIMIWMentionedType_map = @{@(RCIMIWMentionedTypeAll) : @(0), @(RCIMIWMentionedTypePart) : @(1)};
  }
  NSNumber *value = RCIMIWMentionedType_map[@(type)];
  if (!value)
    value = @(0);

  return [value unsignedIntegerValue];
}

RCIMIWAreaCode toAreaCode(NSUInteger code) {
  static NSDictionary<NSNumber *, NSNumber *> *RCIMIWAreaCode_map = nil;
  if (!RCIMIWAreaCode_map) {
    RCIMIWAreaCode_map = @{@(0) : @(RCIMIWAreaCodeBJ), @(1) : @(RCIMIWAreaCodeSG), @(2) : @(RCIMIWAreaCodeNA), @(3) : @(RCIMIWAreaCodeSGB), @(4) : @(RCIMIWAreaCodeSA)};
  }
  NSNumber *value = RCIMIWAreaCode_map[@(code)];
  if (!value)
    value = @(RCIMIWAreaCodeBJ);

  return (RCIMIWAreaCode)[value integerValue];
}

NSUInteger AreaCodeToNum(RCIMIWAreaCode code) {
  static NSDictionary<NSNumber *, NSNumber *> *RCIMIWAreaCode_map = nil;
  if (!RCIMIWAreaCode_map) {
    RCIMIWAreaCode_map = @{@(RCIMIWAreaCodeBJ) : @(0), @(RCIMIWAreaCodeSG) : @(1), @(RCIMIWAreaCodeNA) : @(2), @(RCIMIWAreaCodeSGB) : @(3), @(RCIMIWAreaCodeSA) : @(4)};
  }
  NSNumber *value = RCIMIWAreaCode_map[@(code)];
  if (!value)
    value = @(0);

  return [value unsignedIntegerValue];
}

RCIMIWChatRoomEntriesOperationType toChatRoomEntriesOperationType(NSUInteger type) {
  static NSDictionary<NSNumber *, NSNumber *> *RCIMIWChatRoomEntriesOperationType_map = nil;
  if (!RCIMIWChatRoomEntriesOperationType_map) {
    RCIMIWChatRoomEntriesOperationType_map = @{@(0) : @(RCIMIWChatRoomEntriesOperationTypeUpdate), @(1) : @(RCIMIWChatRoomEntriesOperationTypeRemove)};
  }
  NSNumber *value = RCIMIWChatRoomEntriesOperationType_map[@(type)];
  if (!value)
    value = @(RCIMIWChatRoomEntriesOperationTypeUpdate);

  return (RCIMIWChatRoomEntriesOperationType)[value integerValue];
}

NSUInteger ChatRoomEntriesOperationTypeToNum(RCIMIWChatRoomEntriesOperationType type) {
  static NSDictionary<NSNumber *, NSNumber *> *RCIMIWChatRoomEntriesOperationType_map = nil;
  if (!RCIMIWChatRoomEntriesOperationType_map) {
    RCIMIWChatRoomEntriesOperationType_map = @{@(RCIMIWChatRoomEntriesOperationTypeUpdate) : @(0), @(RCIMIWChatRoomEntriesOperationTypeRemove) : @(1)};
  }
  NSNumber *value = RCIMIWChatRoomEntriesOperationType_map[@(type)];
  if (!value)
    value = @(0);

  return [value unsignedIntegerValue];
}

RCIMIWLogLevel toLogLevel(NSUInteger level) {
  static NSDictionary<NSNumber *, NSNumber *> *RCIMIWLogLevel_map = nil;
  if (!RCIMIWLogLevel_map) {
    RCIMIWLogLevel_map = @{@(0) : @(RCIMIWLogLevelNone), @(1) : @(RCIMIWLogLevelError), @(2) : @(RCIMIWLogLevelWarn), @(3) : @(RCIMIWLogLevelInfo), @(4) : @(RCIMIWLogLevelDebug), @(5) : @(RCIMIWLogLevelVerbose)};
  }
  NSNumber *value = RCIMIWLogLevel_map[@(level)];
  if (!value)
    value = @(RCIMIWLogLevelNone);

  return (RCIMIWLogLevel)[value integerValue];
}

NSUInteger LogLevelToNum(RCIMIWLogLevel level) {
  static NSDictionary<NSNumber *, NSNumber *> *RCIMIWLogLevel_map = nil;
  if (!RCIMIWLogLevel_map) {
    RCIMIWLogLevel_map = @{@(RCIMIWLogLevelNone) : @(0), @(RCIMIWLogLevelError) : @(1), @(RCIMIWLogLevelWarn) : @(2), @(RCIMIWLogLevelInfo) : @(3), @(RCIMIWLogLevelDebug) : @(4), @(RCIMIWLogLevelVerbose) : @(5)};
  }
  NSNumber *value = RCIMIWLogLevel_map[@(level)];
  if (!value)
    value = @(0);

  return [value unsignedIntegerValue];
}

RCIMIWBlacklistStatus toBlacklistStatus(NSUInteger status) {
  static NSDictionary<NSNumber *, NSNumber *> *RCIMIWBlacklistStatus_map = nil;
  if (!RCIMIWBlacklistStatus_map) {
    RCIMIWBlacklistStatus_map = @{@(0) : @(RCIMIWBlacklistStatusUnknown), @(1) : @(RCIMIWBlacklistStatusInBlacklist), @(2) : @(RCIMIWBlacklistStatusNotInBlacklist)};
  }
  NSNumber *value = RCIMIWBlacklistStatus_map[@(status)];
  if (!value)
    value = @(RCIMIWBlacklistStatusUnknown);

  return (RCIMIWBlacklistStatus)[value integerValue];
}

NSUInteger BlacklistStatusToNum(RCIMIWBlacklistStatus status) {
  static NSDictionary<NSNumber *, NSNumber *> *RCIMIWBlacklistStatus_map = nil;
  if (!RCIMIWBlacklistStatus_map) {
    RCIMIWBlacklistStatus_map = @{@(RCIMIWBlacklistStatusUnknown) : @(0), @(RCIMIWBlacklistStatusInBlacklist) : @(1), @(RCIMIWBlacklistStatusNotInBlacklist) : @(2)};
  }
  NSNumber *value = RCIMIWBlacklistStatus_map[@(status)];
  if (!value)
    value = @(0);

  return [value unsignedIntegerValue];
}

RCIMIWImportanceHonor toImportanceHonor(NSUInteger honor) {
  static NSDictionary<NSNumber *, NSNumber *> *RCIMIWImportanceHonor_map = nil;
  if (!RCIMIWImportanceHonor_map) {
    RCIMIWImportanceHonor_map = @{@(0) : @(RCIMIWImportanceHonorNormal), @(1) : @(RCIMIWImportanceHonorLow)};
  }
  NSNumber *value = RCIMIWImportanceHonor_map[@(honor)];
  if (!value)
    value = @(RCIMIWImportanceHonorNormal);

  return (RCIMIWImportanceHonor)[value integerValue];
}

NSUInteger ImportanceHonorToNum(RCIMIWImportanceHonor honor) {
  static NSDictionary<NSNumber *, NSNumber *> *RCIMIWImportanceHonor_map = nil;
  if (!RCIMIWImportanceHonor_map) {
    RCIMIWImportanceHonor_map = @{@(RCIMIWImportanceHonorNormal) : @(0), @(RCIMIWImportanceHonorLow) : @(1)};
  }
  NSNumber *value = RCIMIWImportanceHonor_map[@(honor)];
  if (!value)
    value = @(0);

  return [value unsignedIntegerValue];
}

RCIMIWConnectionStatus toConnectionStatus(NSUInteger status) {
  static NSDictionary<NSNumber *, NSNumber *> *RCIMIWConnectionStatus_map = nil;
  if (!RCIMIWConnectionStatus_map) {
    RCIMIWConnectionStatus_map = @{
      @(0) : @(RCIMIWConnectionStatusNetworkUnavailable),
      @(1) : @(RCIMIWConnectionStatusConnected),
      @(2) : @(RCIMIWConnectionStatusConnecting),
      @(3) : @(RCIMIWConnectionStatusUnconnected),
      @(4) : @(RCIMIWConnectionStatusKickedOfflineByOtherClient),
      @(5) : @(RCIMIWConnectionStatusTokenIncorrect),
      @(6) : @(RCIMIWConnectionStatusConnUserBlocked),
      @(7) : @(RCIMIWConnectionStatusSignOut),
      @(8) : @(RCIMIWConnectionStatusSuspend),
      @(9) : @(RCIMIWConnectionStatusTimeout),
      @(10) : @(RCIMIWConnectionStatusUnknown)
    };
  }
  NSNumber *value = RCIMIWConnectionStatus_map[@(status)];
  if (!value)
    value = @(RCIMIWConnectionStatusNetworkUnavailable);

  return (RCIMIWConnectionStatus)[value integerValue];
}

NSUInteger ConnectionStatusToNum(RCIMIWConnectionStatus status) {
  static NSDictionary<NSNumber *, NSNumber *> *RCIMIWConnectionStatus_map = nil;
  if (!RCIMIWConnectionStatus_map) {
    RCIMIWConnectionStatus_map = @{
      @(RCIMIWConnectionStatusNetworkUnavailable) : @(0),
      @(RCIMIWConnectionStatusConnected) : @(1),
      @(RCIMIWConnectionStatusConnecting) : @(2),
      @(RCIMIWConnectionStatusUnconnected) : @(3),
      @(RCIMIWConnectionStatusKickedOfflineByOtherClient) : @(4),
      @(RCIMIWConnectionStatusTokenIncorrect) : @(5),
      @(RCIMIWConnectionStatusConnUserBlocked) : @(6),
      @(RCIMIWConnectionStatusSignOut) : @(7),
      @(RCIMIWConnectionStatusSuspend) : @(8),
      @(RCIMIWConnectionStatusTimeout) : @(9),
      @(RCIMIWConnectionStatusUnknown) : @(10)
    };
  }
  NSNumber *value = RCIMIWConnectionStatus_map[@(status)];
  if (!value)
    value = @(0);

  return [value unsignedIntegerValue];
}
