func (a *DerivativeAggregation) Unit(unit string) *DerivativeAggregation {
	a.unit = unit
	return a
}
Unit sets the unit provided, e.g. "1d" or "1y".
It is only useful when calculating the derivative using a date_histogram.
package elastic
type DerivativeAggregation struct {
	format    string
	gapPolicy string
	unit      string
	subAggregations map[string]Aggregation
	meta            map[string]interface{}
	bucketsPaths    []string
}
func NewDerivativeAggregation() *DerivativeAggregation {
	return &DerivativeAggregation{
		subAggregations: make(map[string]Aggregation),
		bucketsPaths:    make([]string, 0),
	}
}
func (a *DerivativeAggregation) Format(format string) *DerivativeAggregation {
	a.format = format
	return a
}
func (a *DerivativeAggregation) GapPolicy(gapPolicy string) *DerivativeAggregation {
	a.gapPolicy = gapPolicy
	return a
}
func (a *DerivativeAggregation) GapInsertZeros() *DerivativeAggregation {
	a.gapPolicy = "insert_zeros"
	return a
}
func (a *DerivativeAggregation) GapSkip() *DerivativeAggregation {
	a.gapPolicy = "skip"
	return a
}