func (s *IndicesCloseService) Validate() error {
	var invalid []string
	if s.index == "" {
		invalid = append(invalid, "Index")
	}
	if len(invalid) > 0 {
		return fmt.Errorf("missing required fields: %v", invalid)
	}
	return nil
}
Validate checks if the operation is valid.
package elastic
import (
	"fmt"
	"net/url"
	"gopkg.in/olivere/elastic.v3/uritemplates"
)
type IndicesCloseService struct {
	client            *Client
	pretty            bool
	index             string
	timeout           string
	masterTimeout     string
	ignoreUnavailable *bool
	allowNoIndices    *bool
	expandWildcards   string
}
func NewIndicesCloseService(client *Client) *IndicesCloseService {
	return &IndicesCloseService{client: client}
}
func (s *IndicesCloseService) Index(index string) *IndicesCloseService {
	s.index = index
	return s
}
func (s *IndicesCloseService) Timeout(timeout string) *IndicesCloseService {
	s.timeout = timeout
	return s
}
func (s *IndicesCloseService) MasterTimeout(masterTimeout string) *IndicesCloseService {
	s.masterTimeout = masterTimeout
	return s
}
func (s *IndicesCloseService) IgnoreUnavailable(ignoreUnavailable bool) *IndicesCloseService {
	s.ignoreUnavailable = &ignoreUnavailable
	return s
}
func (s *IndicesCloseService) AllowNoIndices(allowNoIndices bool) *IndicesCloseService {
	s.allowNoIndices = &allowNoIndices
	return s
}
func (s *IndicesCloseService) ExpandWildcards(expandWildcards string) *IndicesCloseService {
	s.expandWildcards = expandWildcards
	return s
}
func (s *IndicesCloseService) Pretty(pretty bool) *IndicesCloseService {
	s.pretty = pretty
	return s
}
func (s *IndicesCloseService) buildURL() (string, url.Values, error) {
	path, err := uritemplates.Expand("/{index}/_close", map[string]string{
		"index": s.index,
	})
	if err != nil {
		return "", url.Values{}, err
	}
	params := url.Values{}
	if s.allowNoIndices != nil {
		params.Set("allow_no_indices", fmt.Sprintf("%v", *s.allowNoIndices))
	}
	if s.expandWildcards != "" {
		params.Set("expand_wildcards", s.expandWildcards)
	}
	if s.timeout != "" {
		params.Set("timeout", s.timeout)
	}
	if s.masterTimeout != "" {
		params.Set("master_timeout", s.masterTimeout)
	}
	if s.ignoreUnavailable != nil {
		params.Set("ignore_unavailable", fmt.Sprintf("%v", *s.ignoreUnavailable))
	}
	return path, params, nil
}