code: func (c *FSM) applyPreparedQueryOperation(buf []byte, index uint64) interface{} {
  	var req structs.PreparedQueryRequest
  	if err := structs.Decode(buf, &req); err != nil {
  		panic(fmt.Errorf("failed to decode request: %v", err))
  	}
  
  	defer metrics.MeasureSinceWithLabels([]string{"fsm", "prepared-query"}, time.Now(),
  		[]metrics.Label{{Name: "op", Value: string(req.Op)}})
  	switch req.Op {
  	case structs.PreparedQueryCreate, structs.PreparedQueryUpdate:
  		return c.state.PreparedQuerySet(index, req.Query)
  	case structs.PreparedQueryDelete:
  		return c.state.PreparedQueryDelete(index, req.Query.ID)
  	default:
  		c.logger.Printf("[WARN] consul.fsm: Invalid PreparedQuery operation '%s'", req.Op)
  		return fmt.Errorf("Invalid PreparedQuery operation '%s'", req.Op)
  	}
  }
docs: // applyPreparedQueryOperation applies the given prepared query operation to the
  // state store.