func (s *ExistsService) Validate() error {
	var invalid []string
	if s.id == "" {
		invalid = append(invalid, "Id")
	}
	if s.index == "" {
		invalid = append(invalid, "Index")
	}
	if s.typ == "" {
		invalid = append(invalid, "Type")
	}
	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/http"
	"net/url"
	"gopkg.in/olivere/elastic.v3/uritemplates"
)
type ExistsService struct {
	client     *Client
	pretty     bool
	id         string
	index      string
	typ        string
	preference string
	realtime   *bool
	refresh    *bool
	routing    string
	parent     string
}
func NewExistsService(client *Client) *ExistsService {
	return &ExistsService{
		client: client,
	}
}
func (s *ExistsService) Id(id string) *ExistsService {
	s.id = id
	return s
}
func (s *ExistsService) Index(index string) *ExistsService {
	s.index = index
	return s
}
func (s *ExistsService) Type(typ string) *ExistsService {
	s.typ = typ
	return s
}
func (s *ExistsService) Preference(preference string) *ExistsService {
	s.preference = preference
	return s
}
func (s *ExistsService) Realtime(realtime bool) *ExistsService {
	s.realtime = &realtime
	return s
}
func (s *ExistsService) Refresh(refresh bool) *ExistsService {
	s.refresh = &refresh
	return s
}
func (s *ExistsService) Routing(routing string) *ExistsService {
	s.routing = routing
	return s
}
func (s *ExistsService) Parent(parent string) *ExistsService {
	s.parent = parent
	return s
}
func (s *ExistsService) Pretty(pretty bool) *ExistsService {
	s.pretty = pretty
	return s
}
func (s *ExistsService) buildURL() (string, url.Values, error) {
	path, err := uritemplates.Expand("/{index}/{type}/{id}", map[string]string{
		"id":    s.id,
		"index": s.index,
		"type":  s.typ,
	})
	if err != nil {
		return "", url.Values{}, err
	}
	params := url.Values{}
	if s.pretty {
		params.Set("pretty", "1")
	}
	if s.realtime != nil {
		params.Set("realtime", fmt.Sprintf("%v", *s.realtime))
	}
	if s.refresh != nil {
		params.Set("refresh", fmt.Sprintf("%v", *s.refresh))
	}
	if s.routing != "" {
		params.Set("routing", s.routing)
	}
	if s.parent != "" {
		params.Set("parent", s.parent)
	}
	if s.preference != "" {
		params.Set("preference", s.preference)
	}
	return path, params, nil
}