code: func (tc *TelegrafConfig) MarshalJSON() ([]byte, error) {
  	tce := new(telegrafConfigEncode)
  	*tce = telegrafConfigEncode{
  		ID:             tc.ID,
  		OrganizationID: tc.OrganizationID,
  		Name:           tc.Name,
  		Agent:          tc.Agent,
  		Plugins:        make([]telegrafPluginEncode, len(tc.Plugins)),
  	}
  	for k, p := range tc.Plugins {
  		tce.Plugins[k] = telegrafPluginEncode{
  			Name:    p.Config.PluginName(),
  			Type:    p.Config.Type(),
  			Comment: p.Comment,
  			Config:  p.Config,
  		}
  	}
  	return json.Marshal(tce)
  }
docs: // MarshalJSON implement the json.Marshaler interface.