Пример #1
0
 def parse_structure(data):
     data = parse_dictionary(data, [
         "company_id", "short_url", "company_server_ip", "is_group",
         "file_server_info"
     ])
     company_id = data.get("company_id")
     company_id = parse_structure_UnsignedIntegerType_32(company_id)
     short_url = data.get("short_url")
     short_url = parse_structure_Text(short_url)
     company_server_ip = data.get("company_server_ip")
     company_server_ip = parse_structure_RecordType_protocol_IPAddress(
         company_server_ip)
     file_server_info = data.get("file_server_info")
     file_server_info = parse_structure_VectorType_RecordType_protocol_FileServer(
         file_server_info)
     is_group = data.get("is_group")
     is_group = parse_structure_Bool(is_group)
     return Server(company_id, short_url, company_server_ip,
                   file_server_info, is_group)
Пример #2
0
 def parse_structure(data):
     data = parse_dictionary(data, [
         "company_id", "short_url", "db_username", "db_password", "db_name",
         "db_ip", "company_server_ip", "is_group"
     ])
     company_id = data.get("company_id")
     company_id = parse_structure_UnsignedIntegerType_32(company_id)
     short_url = data.get("short_url")
     short_url = parse_structure_Text(short_url)
     db_username = data.get("db_username")
     db_username = parse_structure_Text(db_username)
     db_password = data.get("db_password")
     db_password = parse_structure_Text(db_password)
     db_name = data.get("db_name")
     db_name = parse_structure_Text(db_name)
     db_ip = data.get("db_ip")
     db_ip = parse_structure_RecordType_protocol_IPAddress(db_ip)
     company_server_ip = data.get("company_server_ip")
     company_server_ip = parse_structure_RecordType_protocol_IPAddress(
         company_server_ip)
     is_group = data.get("is_group")
     is_group = parse_structure_Bool(is_group)
     return Company(company_id, short_url, db_username, db_password,
                    db_name, db_ip, company_server_ip, is_group)