// ElasticsearchVersion returns the version number of Elasticsearch
// running on the given URL.
198976
func (c *Client) ElasticsearchVersion(url string) (string, error) {
	res, _, err := c.Ping().URL(url).Do()
	if err != nil {
		return "", err
	}
	return res.Version.Number, nil
}
403368
func (c *GroupRequestsVersionsRollupCall) Versions(versions string) *GroupRequestsVersionsRollupCall {
	c.urlParams_.Set("versions", versions)
	return c
}
526791
func (s *Snapshot) GetVersion(typ string) string {
	if s == nil {
		return ""
	}
	switch typ {
	case EndpointType:
		return s.Endpoints.Version
	case ClusterType:
		return s.Clusters.Version
	case RouteType:
		return s.Routes.Version
	case ListenerType:
		return s.Listeners.Version
	case SecretType:
		return s.Secrets.Version
	}
	return ""
}
1148527
func (r *ReindexDestination) Version(version int64) *ReindexDestination {
	r.version = version
	return r
}
180985
func Version(buildVer, buildDate, commitHash string) Option {
	return func(o *Options) {
		BuildVersion = buildVer
		BuildDate = buildDate
		CommitHash = commitHash
	}
}
272545
func (x *Index) schemaVersion() int {
	schemaVersionStr, err := x.s.Get(keySchemaVersion.name)
	if err != nil {
		if err == sorted.ErrNotFound {
			return 0
		}
		panic(fmt.Sprintf("Could not get index schema version: %v", err))
	}
	schemaVersion, err := strconv.Atoi(schemaVersionStr)
	if err != nil {
		panic(fmt.Sprintf("Bogus index schema version: %q", schemaVersionStr))
	}
	return schemaVersion
}
10981
func (c *ClusterInfo) GetVersion(addr string) (semver.Version, error) {
	endpoint := fmt.Sprintf("http://%s/info", addr)
	var resp struct {
		Version string `json:"version"`
	}
	err := c.client.GETV1(endpoint, &resp)
	if err != nil {
		return semver.Version{}, err
	}
	if resp.Version == "" {
		resp.Version = "unknown"
	}
	return semver.Parse(resp.Version)
}
303698
func (c *FakeClient) GetVersion(opts ...VersionOption) (*rls.GetVersionResponse, error) {
	return &rls.GetVersionResponse{
		Version: &version.Version{
			SemVer: "1.2.3-fakeclient+testonly",
		},
	}, nil
}
1341229
func CompareVersion(version interface{}) int {
	return compareVersionsWithSuffix(CurrentVersion.Number, CurrentVersion.PatchLevel, CurrentVersion.Suffix, version)
}
1299300
func (c *GroupRequestsEventsRollupCall) Versions(versions string) *GroupRequestsEventsRollupCall {
	c.urlParams_.Set("versions", versions)
	return c
}
193510
func (x *XC) Version(ctx context.Context) semver.Version {
	return semver.Version{
		Patch: 1,
	}
}
931121
func (s *SearchSource) Version(version bool) *SearchSource {
	s.version = &version
	return s
}
1037913
func (s *SearchService) Version(version bool) *SearchService {
	s.searchSource = s.searchSource.Version(version)
	return s
}
764546
func (osx OSX) Version() (result string) {
	data := Execute("system_profiler", "SPSoftwareDataType")

	rVersion := regexp.MustCompile(versionPattern)

	subs := rVersion.FindAllStringSubmatch(data, 1)
	if len(subs) == 0 {
		return
	}

	find := subs[0]
	if len(find) < 1 {
		return
	}

	return find[1]
}
684105
func (h *Client) GetVersion(opts ...VersionOption) (*rls.GetVersionResponse, error) {
	reqOpts := h.opts
	for _, opt := range opts {
		opt(&reqOpts)
	}
	req := &rls.GetVersionRequest{}
	ctx := NewContext()

	if reqOpts.before != nil {
		if err := reqOpts.before(ctx, req); err != nil {
			return nil, err
		}
	}
	return h.version(ctx, req)
}
813839
func (c *Client) Version() (*Env, error) {
	resp, err := c.do("GET", "/version", doOptions{})
	if err != nil {
		return nil, err
	}
	defer resp.Body.Close()
	var env Env
	if err := env.Decode(resp.Body); err != nil {
		return nil, err
	}
	return &env, nil
}
1107955
func (c *ClientupdateCountCall) Version(version string) *ClientupdateCountCall {
	c.urlParams_.Set("version", version)
	return c
}