code: def encode_request(name, start_sequence, min_count, max_count, filter):
      
      client_message = ClientMessage(payload_size=calculate_size(name, start_sequence, min_count, max_count, filter))
      client_message.set_message_type(REQUEST_TYPE)
      client_message.set_retryable(RETRYABLE)
      client_message.append_str(name)
      client_message.append_long(start_sequence)
      client_message.append_int(min_count)
      client_message.append_int(max_count)
      client_message.append_bool(filter is None)
      if filter is not None:
          client_message.append_data(filter)
      client_message.update_frame_length()
      return client_message
docs: Encode request into client_message