code: func (r *RefsRequest) Validate() error {
  	switch {
  	case r.Project == "":
  		return errors.New("project is required")
  	case r.RefsPath != "refs" && !strings.HasPrefix(r.RefsPath, "refs/"):
  		return fmt.Errorf(`refsPath must be "refs" or start with "refs/": %q`, r.RefsPath)
  	default:
  		return nil
  	}
  }
docs: // Validate returns an error if r is invalid.