func NewDuration(input Duration) *Duration {
	return &input
}
NewDuration returns a reference to a Duration with given value.
package v2alpha1
import (
	"time"
	"github.com/arangodb/kube-arangodb/pkg/util/errors"
)
type Duration string
func (d Duration) Validate() error {
	if d != "" {
		if _, err := time.ParseDuration(string(d)); err != nil {
			return errors.WithStack(errors.Wrapf(ValidationError, "Invalid duration: '%s': %s", string(d), err.Error()))
		}
	}
	return nil
}
func (d Duration) AsDuration() time.Duration {
	if d == "" {
		return 0
	}
	result, err := time.ParseDuration(string(d))
	if err != nil {
		return 0
	}
	return result
}