#NEWLINE# def encode_request( name , expected , updated ) : #NEWLINE# #INDENT# ' Encode request into client_message' #NEWLINE# client_message = ClientMessage ( payload_size = calculate_size ( name , client_message , updated ) ) #NEWLINE# client_message . set_message_type ( REQUEST_TYPE ) #NEWLINE# client_message . set_retryable ( RETRYABLE ) #NEWLINE# client_message . append_str ( name ) #NEWLINE# client_message . append_bool ( ( expected is None ) ) #NEWLINE# if ( expected is not None ) : #NEWLINE# #INDENT# client_message . append_data ( expected ) #NEWLINE# #UNINDENT# client_message . append_bool ( ( updated is None ) ) #NEWLINE# if ( updated is not None ) : #NEWLINE# #INDENT# client_message . append_data ( updated ) #NEWLINE# #UNINDENT# client_message . update_frame_length ( ) #NEWLINE# return client_message