code: func (a *MovAvgAggregation) Source() (interface{}, error) {
  	source := make(map[string]interface{})
  	params := make(map[string]interface{})
  	source["moving_avg"] = params
  
  	if a.format != "" {
  		params["format"] = a.format
  	}
  	if a.gapPolicy != "" {
  		params["gap_policy"] = a.gapPolicy
  	}
  	if a.model != nil {
  		params["model"] = a.model.Name()
  		settings := a.model.Settings()
  		if len(settings) > 0 {
  			params["settings"] = settings
  		}
  	}
  	if a.window != nil {
  		params["window"] = *a.window
  	}
  	if a.predict != nil {
  		params["predict"] = *a.predict
  	}
  	if a.minimize != nil {
  		params["minimize"] = *a.minimize
  	}
  
  	// Add buckets paths
  	switch len(a.bucketsPaths) {
  	case 0:
  	case 1:
  		params["buckets_path"] = a.bucketsPaths[0]
  	default:
  		params["buckets_path"] = a.bucketsPaths
  	}
  
  	// Add Meta data if available
  	if len(a.meta) > 0 {
  		source["meta"] = a.meta
  	}
  
  	return source, nil
  }
docs: // Source returns the a JSON-serializable interface.