code: func (a *MovFnAggregation) Source() (interface{}, error) {
  	source := make(map[string]interface{})
  	params := make(map[string]interface{})
  	source["moving_fn"] = params
  
  	// Add buckets paths
  	switch len(a.bucketsPaths) {
  	case 0:
  	case 1:
  		params["buckets_path"] = a.bucketsPaths[0]
  	default:
  		params["buckets_path"] = a.bucketsPaths
  	}
  
  	// Script
  	if a.script != nil {
  		src, err := a.script.Source()
  		if err != nil {
  			return nil, err
  		}
  		params["script"] = src
  	}
  
  	if a.format != "" {
  		params["format"] = a.format
  	}
  	if a.gapPolicy != "" {
  		params["gap_policy"] = a.gapPolicy
  	}
  	params["window"] = a.window
  
  	// 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.