code: func (ns *Namespace) ExecuteAsTemplate(args ...interface{}) (resource.Resource, error) {
  	if len(args) != 3 {
  		return nil, fmt.Errorf("must provide targetPath, the template data context and a Resource object")
  	}
  	targetPath, err := cast.ToStringE(args[0])
  	if err != nil {
  		return nil, err
  	}
  	data := args[1]
  
  	r, ok := args[2].(resource.Resource)
  	if !ok {
  		return nil, fmt.Errorf("type %T not supported in Resource transformations", args[2])
  	}
  
  	return ns.templatesClient.ExecuteAsTemplate(r, targetPath, data)
  }
docs: // ExecuteAsTemplate creates a Resource from a Go template, parsed and executed with
  // the given data, and published to the relative target path.