func (s *XPackWatcherGetWatchService) Do(ctx context.Context) (*XPackWatcherGetWatchResponse, error) {
	if err := s.Validate(); err != nil {
		return nil, err
	}
	path, params, err := s.buildURL()
	if err != nil {
		return nil, err
	}
	res, err := s.client.PerformRequest(ctx, PerformRequestOptions{
		Method:  "GET",
		Path:    path,
		Params:  params,
		Headers: s.headers,
	})
	if err != nil {
		return nil, err
	}
	ret := new(XPackWatcherGetWatchResponse)
	if err := json.Unmarshal(res.Body, ret); err != nil {
		return nil, err
	}
	return ret, nil
}
Do executes the operation.
package elastic
import (
	"context"
	"encoding/json"
	"fmt"
	"net/http"
	"net/url"
	"strings"
	"time"
	"github.com/olivere/elastic/v7/uritemplates"
)
type XPackWatcherGetWatchService struct {
	client *Client
	pretty     *bool        
	human      *bool        
	errorTrace *bool        
	filterPath []string     
	headers    http.Header  
	id string
}
func NewXPackWatcherGetWatchService(client *Client) *XPackWatcherGetWatchService {
	return &XPackWatcherGetWatchService{
		client: client,
	}
}
func (s *XPackWatcherGetWatchService) Pretty(pretty bool) *XPackWatcherGetWatchService {
	s.pretty = &pretty
	return s
}
func (s *XPackWatcherGetWatchService) Human(human bool) *XPackWatcherGetWatchService {
	s.human = &human
	return s
}
func (s *XPackWatcherGetWatchService) ErrorTrace(errorTrace bool) *XPackWatcherGetWatchService {
	s.errorTrace = &errorTrace
	return s
}
func (s *XPackWatcherGetWatchService) FilterPath(filterPath ...string) *XPackWatcherGetWatchService {
	s.filterPath = filterPath
	return s
}
func (s *XPackWatcherGetWatchService) Header(name string, value string) *XPackWatcherGetWatchService {
	if s.headers == nil {
		s.headers = http.Header{}
	}
	s.headers.Add(name, value)
	return s
}
func (s *XPackWatcherGetWatchService) Headers(headers http.Header) *XPackWatcherGetWatchService {
	s.headers = headers
	return s
}
func (s *XPackWatcherGetWatchService) Id(id string) *XPackWatcherGetWatchService {
	s.id = id
	return s
}
func (s *XPackWatcherGetWatchService) buildURL() (string, url.Values, error) {
	path, err := uritemplates.Expand("/_watcher/watch/{id}", map[string]string{
		"id": s.id,
	})
	if err != nil {
		return "", url.Values{}, err
	}
	params := url.Values{}
	if v := s.pretty; v != nil {
		params.Set("pretty", fmt.Sprint(*v))
	}
	if v := s.human; v != nil {
		params.Set("human", fmt.Sprint(*v))
	}
	if v := s.errorTrace; v != nil {
		params.Set("error_trace", fmt.Sprint(*v))
	}
	if len(s.filterPath) > 0 {
		params.Set("filter_path", strings.Join(s.filterPath, ","))
	}
	return path, params, nil
}
func (s *XPackWatcherGetWatchService) Validate() error {
	var invalid []string
	if s.id == "" {
		invalid = append(invalid, "Id")
	}
	if len(invalid) > 0 {
		return fmt.Errorf("missing required fields: %v", invalid)
	}
	return nil
}