code: func (c *FSM) applyIntentionOperation(buf []byte, index uint64) interface{} {
  	var req structs.IntentionRequest
  	if err := structs.Decode(buf, &req); err != nil {
  		panic(fmt.Errorf("failed to decode request: %v", err))
  	}
  
  	defer metrics.MeasureSinceWithLabels([]string{"consul", "fsm", "intention"}, time.Now(),
  		[]metrics.Label{{Name: "op", Value: string(req.Op)}})
  	defer metrics.MeasureSinceWithLabels([]string{"fsm", "intention"}, time.Now(),
  		[]metrics.Label{{Name: "op", Value: string(req.Op)}})
  	switch req.Op {
  	case structs.IntentionOpCreate, structs.IntentionOpUpdate:
  		return c.state.IntentionSet(index, req.Intention)
  	case structs.IntentionOpDelete:
  		return c.state.IntentionDelete(index, req.Intention.ID)
  	default:
  		c.logger.Printf("[WARN] consul.fsm: Invalid Intention operation '%s'", req.Op)
  		return fmt.Errorf("Invalid Intention operation '%s'", req.Op)
  	}
  }
docs: // applyIntentionOperation applies the given intention operation to the state store.