// Versions returns all schema version numbers registered for this subject.
172373
func (c *Client) Versions(subject string) (versions []int, err error) {
	if subject == "" {
		err = errRequired("subject")
		return
	}

	// # List all versions of a particular subject
	// GET /subjects/(string: subject)/versions
	path := fmt.Sprintf(subjectPath, subject+"/versions")
	resp, respErr := c.do(http.MethodGet, path, "", nil)
	if respErr != nil {
		err = respErr
		return
	}

	err = c.readJSON(resp, &versions)
	return
}
101374
func Version(url string, kvdbOptions map[string]string) (string, error) {
	return kvdb.ZookeeperVersion1, nil
}
728822
func Versions(p *VersionsParams) (*VersionsResponse, error) {
	if disabled := os.Getenv("CHECKPOINT_DISABLE"); disabled != "" && !p.Force {
		return &VersionsResponse{}, nil
	}

	// Set a default timeout of 1 sec for the versions request (in milliseconds)
	timeout := 1000
	if _, err := strconv.Atoi(os.Getenv("CHECKPOINT_TIMEOUT")); err == nil {
		timeout, _ = strconv.Atoi(os.Getenv("CHECKPOINT_TIMEOUT"))
	}

	v := url.Values{}
	v.Set("product", p.Product)

	u := &url.URL{
		Scheme:   "https",
		Host:     "checkpoint-api.hashicorp.com",
		Path:     fmt.Sprintf("/v1/versions/%s", p.Service),
		RawQuery: v.Encode(),
	}

	req, err := http.NewRequest("GET", u.String(), nil)
	if err != nil {
		return nil, err
	}
	req.Header.Set("Accept", "application/json")
	req.Header.Set("User-Agent", "HashiCorp/go-checkpoint")

	client := cleanhttp.DefaultClient()

	// We use a short timeout since checking for new versions is not critical
	// enough to block on if checkpoint is broken/slow.
	client.Timeout = time.Duration(timeout) * time.Millisecond

	resp, err := client.Do(req)
	if err != nil {
		return nil, err
	}
	defer resp.Body.Close()

	if resp.StatusCode != 200 {
		return nil, fmt.Errorf("Unknown status: %d", resp.StatusCode)
	}

	result := &VersionsResponse{}
	if err := json.NewDecoder(resp.Body).Decode(result); err != nil {
		return nil, err
	}

	return result, nil
}
116076
func (g *GPG) Version(context.Context) semver.Version {
	return semver.Version{Major: 1}
}
948959
func (r *BulkUpdateRequest) Version(version int64) *BulkUpdateRequest {
	r.version = version
	r.source = nil
	return r
}
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
}
782595
func Versions(key string) (string, bool) {
	switch key {
	case "shortcommit":
		s := overrideVersion.GitCommit
		if len(s) > 7 {
			s = s[:7]
		}
		return s, true
	case "version":
		s := lastSemanticVersionWithoutModifiers(overrideVersion.GitVersion)
		return s, true
	default:
		return "", false
	}
}
1299300
func (c *GroupRequestsEventsRollupCall) Versions(versions string) *GroupRequestsEventsRollupCall {
	c.urlParams_.Set("versions", versions)
	return c
}
225825
func (c *Client) Version() (*Version, error) {
	v := &Version{}
	if _, err := c.ExecCmd(NewCmd("version").WithResponse(v)); err != nil {
		return nil, err
	}

	return v, nil
}
790935
func (b *UpdateService) Version(version int64) *UpdateService {
	b.version = &version
	return b
}
745257
func (s *Server) Version(context.Context, *empty.Empty) (*VersionMessage, error) {
	vers := argocd.GetVersion()
	ksonnetVersion, err := ksutil.KsonnetVersion()
	if err != nil {
		return nil, err
	}
	return &VersionMessage{
		Version:        vers.Version,
		BuildDate:      vers.BuildDate,
		GitCommit:      vers.GitCommit,
		GitTag:         vers.GitTag,
		GitTreeState:   vers.GitTreeState,
		GoVersion:      vers.GoVersion,
		Compiler:       vers.Compiler,
		Platform:       vers.Platform,
		KsonnetVersion: ksonnetVersion,
	}, nil
}
527646
func (c *ClientupdateListCall) Version(version string) *ClientupdateListCall {
	c.urlParams_.Set("version", version)
	return c
}
778552
func (g *GPG) Version(ctx context.Context) semver.Version {
	return version(ctx, g.Binary())
}
1199322
func (db *DB) SchemaVersion() (int, error) {
	sql := `select version from schema_migrations order by version desc limit 1`
	var schemaVersion int
	err := db.DB.DB().QueryRow(sql).Scan(&schemaVersion)
	return schemaVersion, err
}
46886
func GetVersions() []Version {
	v := []Version{}
	for k := range tarSumVersions {
		v = append(v, k)
	}
	return v
}
1325060
func (api *SignerAPI) Version(ctx context.Context) (string, error) {
	return ExternalAPIVersion, nil
}
1364151
func (driver *Driver) Versions() (file.Versions, error) {
	versions := file.Versions{}

	rows, err := driver.db.Query("SELECT version FROM " + tableName + " ORDER BY version DESC")
	if err != nil {
		return versions, err
	}
	defer rows.Close()
	for rows.Next() {
		var version file.Version
		err := rows.Scan(&version)
		if err != nil {
			return versions, err
		}
		versions = append(versions, version)
	}
	err = rows.Err()
	return versions, err
}