File size: 298 Bytes
3dcffd6
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
class ApiResponse:
    def __init__(self, code, message, data=None):
        self.code = code
        self.message = message
        self.data = data

    def to_json(self):
        return {
            'code': self.code,
            'message': self.message,
            'data': self.data
        }