import Foundation

class GroupRequestModel {
    
    struct GroupRequestSuccessModel: Codable {
        var apiStatus: Int?
        var groupChatRequests: [GroupChatRequest]?
        var newGroupChatRequestsCount: Int?

        enum CodingKeys: String, CodingKey {
            case apiStatus = "api_status"
            case groupChatRequests = "group_chat_requests"
            case newGroupChatRequestsCount = "new_group_chat_requests_count"
        }
    }

    struct GroupChatRequest: Codable {
        var userID, groupID: Int?
        var active, lastSeen: String?
        var groupTab: GroupTab?

        enum CodingKeys: String, CodingKey {
            case userID = "user_id"
            case groupID = "group_id"
            case active
            case lastSeen = "last_seen"
            case groupTab = "group_tab"
        }
    }

    struct GroupTab: Codable {
        var groupID, userID, groupName: String?
        var avatar: String?
        var time, timeText: String?

        enum CodingKeys: String, CodingKey {
            case groupID = "group_id"
            case userID = "user_id"
            case groupName = "group_name"
            case avatar, time
            case timeText = "time_text"
        }
    }

}

struct AcceptGroupRequestModel: Codable {
    
    var apiStatus: Int?
    var messageData: String?
    
    enum CodingKeys: String, CodingKey {
        case apiStatus = "api_status"
        case messageData = "message_data"
    }

}

struct RejectGroupRequestModel: Codable {
    
    var apiStatus: Int?
    var messageData: String?
    
    enum CodingKeys: String, CodingKey {
        case apiStatus = "api_status"
        case messageData = "message_data"
    }
    
}
