//
//  ExtSdkToJson.h
//  im_flutter_sdk
//
//  Created by 杜洁鹏 on 2020/9/27.
//

#import <Foundation/Foundation.h>

#import <AgoraChat/AgoraChatMessage.h>
#import <AgoraChat/AgoraChatThread.h>
#import <AgoraChat/AgoraChatThreadEvent.h>
#import <AgoraChat/AgoraChatroom.h>
#import <AgoraChat/AgoraChatContact.h>
#import <AgoraChat/AgoraChatConversation.h>
#import <AgoraChat/AgoraChatConversationFilter.h>
#import <AgoraChat/AgoraChatCursorResult.h>
#import <AgoraChat/AgoraChatDeviceConfig.h>
#import <AgoraChat/AgoraChatError.h>
#import <AgoraChat/AgoraChatFetchServerMessagesOption.h>
#import <AgoraChat/AgoraChatGroup.h>
#import <AgoraChat/AgoraChatGroupMessageAck.h>
#import <AgoraChat/AgoraChatGroupOptions.h>
#import <AgoraChat/AgoraChatGroupSharedFile.h>
#import <AgoraChat/AgoraChatMessageBody.h>
#import <AgoraChat/AgoraChatMessageReaction.h>
#import <AgoraChat/AgoraChatMessageReactionChange.h>
#import <AgoraChat/AgoraChatMessageReactionOperation.h>
#import <AgoraChat/AgoraChatOptions.h>
#import <AgoraChat/AgoraChatPageResult.h>
#import <AgoraChat/AgoraChatPresence.h>
#import <AgoraChat/AgoraChatPushOptions.h>
#import <AgoraChat/AgoraChatRecallMessageInfo.h>
#import <AgoraChat/AgoraChatSilentModeParam.h>
#import <AgoraChat/AgoraChatSilentModeResult.h>
#import <AgoraChat/AgoraChatSilentModeTime.h>
#import <AgoraChat/AgoraChatTranslateLanguage.h>
#import <AgoraChat/AgoraChatUserInfo.h>

NS_ASSUME_NONNULL_BEGIN

@protocol ExtSdkToJson <NSObject>
- (NSDictionary *)toJsonObject;
@end

@interface AgoraChatroom (Json) <ExtSdkToJson>
- (NSDictionary *)toJsonObject;
@end

@interface AgoraChatConversation (Json) <ExtSdkToJson>
- (NSDictionary *)toJsonObject;
+ (int)typeToInt:(AgoraChatConversationType)aType;
+ (AgoraChatConversationType)typeFromInt:(int)aType;
@end

@interface AgoraChatCursorResult (Json) <ExtSdkToJson>
- (NSDictionary *)toJsonObject;
@end

@interface AgoraChatDeviceConfig (Json) <ExtSdkToJson>
- (NSDictionary *)toJsonObject;
@end

@interface AgoraChatError (Json) <ExtSdkToJson>
- (NSDictionary *)toJsonObject;
@end

@interface AgoraChatGroup (Json) <ExtSdkToJson>
- (NSDictionary *)toJsonObject;
+ (AgoraChatGroupPermissionType)premissionTypeFromInt:(int)type;
+ (int)premissionTypeToInt:(AgoraChatGroupPermissionType)type;
@end

@interface AgoraChatGroupOptions (Json) <ExtSdkToJson>
+ (AgoraChatGroupOptions *)fromJsonObject:(NSDictionary *)dict;
- (NSDictionary *)toJsonObject;
+ (AgoraChatGroupStyle)styleFromInt:(int)style;
+ (int)styleToInt:(AgoraChatGroupStyle)style;
@end

@interface AgoraChatGroupSharedFile (Json) <ExtSdkToJson>
- (NSDictionary *)toJsonObject;
@end

@interface AgoraChatGroupMessageAck (Json) <ExtSdkToJson>
- (NSDictionary *)toJsonObject;
@end

@interface AgoraChatMessage (Json) <ExtSdkToJson>
+ (AgoraChatMessage *)fromJsonObject:(NSDictionary *)aJson;
- (NSDictionary *)toJsonObject;
+ (AgoraChatType)chatTypeFromInt:(int)aType;
+ (int)chatTypeToInt:(AgoraChatType)aType;
+ (AgoraChatRoomMessagePriority)priorityFromInt:(int)priority;
+ (int)priorityToInt:(AgoraChatRoomMessagePriority)priority;
@end

@interface AgoraChatMessageBody (Json) <ExtSdkToJson>
+ (AgoraChatMessageBody *)fromJsonObject:(NSDictionary *)aJson;
- (NSDictionary *)toJsonObject;
+ (AgoraChatMessageBodyType)fromString:(NSString *)aStrType;
+ (NSString *)toString:(AgoraChatMessageBodyType)type;
@end

@interface AgoraChatOptions (Json) <ExtSdkToJson>
- (NSDictionary *)toJsonObject;
+ (AgoraChatOptions *)fromJsonObject:(NSDictionary *)aJson;
+ (AreaCode)AreaCodeFromInt:(int)code;
@end

@interface AgoraChatPageResult (Json) <ExtSdkToJson>
- (NSDictionary *)toJsonObject;
@end

@interface AgoraChatPresence (Helper) <ExtSdkToJson>
- (NSDictionary *)toJsonObject;
@end

@interface AgoraChatPushOptions (Json) <ExtSdkToJson>
- (NSDictionary *)toJsonObject;
@end

@interface AgoraChatUserInfo (Json) <ExtSdkToJson>
- (NSDictionary *)toJsonObject;
+ (AgoraChatUserInfo *)fromJsonObject:(NSDictionary *)aJson;
@end

@interface AgoraChatTranslateLanguage (Json) <ExtSdkToJson>
- (NSDictionary *)toJsonObject;
@end

@interface NSArray (Json)
- (NSArray *)toJsonArray;
@end

@interface AgoraChatMessageReactionOperation (Json) <ExtSdkToJson>
- (NSDictionary *)toJsonObject;
@end

@interface AgoraChatMessageReaction (Json) <ExtSdkToJson>
- (NSDictionary *)toJsonObject;
@end

@interface AgoraChatMessageReactionChange (Json) <ExtSdkToJson>
- (NSDictionary *)toJsonObject;
@end

@interface AgoraChatThread (Json) <ExtSdkToJson>
- (NSDictionary *)toJsonObject;
@end

@interface AgoraChatThreadEvent (Json) <ExtSdkToJson>
- (NSDictionary *)toJsonObject;
@end

@interface AgoraChatSilentModeParam (Json)
+ (AgoraChatSilentModeParam *)fromJsonObject:(NSDictionary *)dict;
+ (int)remindTypeToInt:(AgoraChatPushRemindType)type;
@end

@interface AgoraChatSilentModeResult (Json) <ExtSdkToJson>
- (NSDictionary *)toJsonObject;
@end

@interface AgoraChatSilentModeTime (Json) <ExtSdkToJson>
+ (AgoraChatSilentModeTime *)fromJsonObject:(NSDictionary *)dict;
- (NSDictionary *)toJsonObject;
@end

@interface AgoraChatFetchServerMessagesOption (Json) <ExtSdkToJson>
+ (AgoraChatFetchServerMessagesOption *)fromJsonObject:(NSDictionary *)dict;
- (NSDictionary *)toJsonObject;
@end

@interface AgoraChatContact (Json) <ExtSdkToJson>
+ (AgoraChatContact *)fromJsonObject:(NSDictionary *)dict;
- (NSDictionary *)toJsonObject;
@end

@interface AgoraChatConversationFilter (Json)
+ (AgoraChatConversationFilter *)fromJsonObject:(NSDictionary *)dict;
+ (NSString *)getCursor:(NSDictionary *)dict;
+ (BOOL)getPinned:(NSDictionary *)dict;
+ (BOOL)hasMark:(NSDictionary *)dict;
+ (NSInteger)pageSize:(NSDictionary *)dict;
@end

@interface AgoraChatMessagePinInfo (Json) <ExtSdkToJson>
+ (AgoraChatMessagePinInfo *)fromJsonObject:(NSDictionary *)dict;
- (NSDictionary *)toJsonObject;
@end

@interface AgoraChatRecallMessageInfo (Json) <ExtSdkToJson>
+ (AgoraChatRecallMessageInfo *)fromJsonObject:(NSDictionary *)dict;
- (NSDictionary *)toJsonObject;
@end

NS_ASSUME_NONNULL_END
