code: func (s *ClusterStateService) buildURL() (string, url.Values, error) {
  	// Build URL
  	metrics := strings.Join(s.metrics, ",")
  	if metrics == "" {
  		metrics = "_all"
  	}
  	indices := strings.Join(s.indices, ",")
  	if indices == "" {
  		indices = "_all"
  	}
  	path, err := uritemplates.Expand("/_cluster/state/{metrics}/{indices}", map[string]string{
  		"metrics": metrics,
  		"indices": indices,
  	})
  	if err != nil {
  		return "", url.Values{}, err
  	}
  
  	// Add query string parameters
  	params := url.Values{}
  	if s.pretty {
  		params.Set("pretty", "true")
  	}
  	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.flatSettings != nil {
  		params.Set("flat_settings", fmt.Sprintf("%v", *s.flatSettings))
  	}
  	if s.ignoreUnavailable != nil {
  		params.Set("ignore_unavailable", fmt.Sprintf("%v", *s.ignoreUnavailable))
  	}
  	if s.local != nil {
  		params.Set("local", fmt.Sprintf("%v", *s.local))
  	}
  	if s.masterTimeout != "" {
  		params.Set("master_timeout", s.masterTimeout)
  	}
  	return path, params, nil
  }
docs: // buildURL builds the URL for the operation.