def encode_request(username, password, uuid, owner_uuid, is_owner_connection, client_type, serialization_version, client_hazelcast_version):
client_message = ClientMessage(payload_size=calculate_size(username, password, uuid, owner_uuid, is_owner_connection, client_type, serialization_version, client_hazelcast_version))<EOL>client_message.set_message_type(REQUEST_TYPE)<EOL>client_message.set_retryable(RETRYABLE)<EOL>client_message.append_str(username)<EOL>client_message.append_str(password)<EOL>client_message.append_bool(uuid is None)<EOL>if uuid is not None:<EOL><INDENT>client_message.append_str(uuid)<EOL><DEDENT>client_message.append_bool(owner_uuid is None)<EOL>if owner_uuid is not None:<EOL><INDENT>client_message.append_str(owner_uuid)<EOL><DEDENT>client_message.append_bool(is_owner_connection)<EOL>client_message.append_str(client_type)<EOL>client_message.append_byte(serialization_version)<EOL>client_message.append_str(client_hazelcast_version)<EOL>client_message.update_frame_length()<EOL>return client_message<EOL>
Encode request into client_message