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