Skip to content

Commit

Permalink
feat: use versioned api endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippHeuer committed Jul 23, 2024
1 parent e0fb2c0 commit 4c8a505
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
20 changes: 10 additions & 10 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func (sdk SDK) Health() (*HealthcheckResponse, error) {
SetHeader("Accept", "application/json").
SetResult(&HealthcheckResponse{}).
SetError(&APIError{}).
Get("/health")
Get("/v1/health")

if err != nil {
return nil, err
Expand All @@ -115,7 +115,7 @@ func (sdk SDK) Env() (map[string]string, error) {
SetHeader("Accept", "application/json").
SetResult(&map[string]string{}).
SetError(&APIError{}).
Get("/env")
Get("/v1/job/env")

if err != nil {
return nil, err
Expand All @@ -132,7 +132,7 @@ func (sdk SDK) CurrentConfig() (*CurrentConfig, error) {
SetHeader("Accept", "application/json").
SetResult(&CurrentConfig{}).
SetError(&APIError{}).
Get("/config/current")
Get("/v1/job/config")

if err != nil {
return nil, err
Expand All @@ -149,7 +149,7 @@ func (sdk SDK) Modules() (*[]ProjectModule, error) {
SetHeader("Accept", "application/json").
SetResult(&[]ProjectModule{}).
SetError(&APIError{}).
Get("/module")
Get("/v1/repoanalyzer/module")

if err != nil {
return nil, err
Expand All @@ -166,7 +166,7 @@ func (sdk SDK) CurrentModule() (*ProjectModule, error) {
SetHeader("Accept", "application/json").
SetResult(&ProjectModule{}).
SetError(&APIError{}).
Get("/module/current")
Get("/v1/job/module")

if err != nil {
return nil, err
Expand All @@ -190,7 +190,7 @@ func (sdk SDK) VCSCommits(request VCSCommitsRequest) (*[]VCSCommit, error) {
SetHeader("Accept", "application/json").
SetResult(&[]VCSCommit{}).
SetError(&APIError{}).
Get(fmt.Sprintf("/vcs/commit?from=%s&to=%s&changes=%s&limit=%s", request.FromHash, request.ToHash, strconv.FormatBool(request.IncludeChanges), strconv.Itoa(request.Limit)))
Get(fmt.Sprintf("/v1/vcs/commit?from=%s&to=%s&changes=%s&limit=%s", request.FromHash, request.ToHash, strconv.FormatBool(request.IncludeChanges), strconv.Itoa(request.Limit)))

if err != nil {
return nil, err
Expand All @@ -212,7 +212,7 @@ func (sdk SDK) VCSCommitByHash(request VCSCommitByHashRequest) (*VCSCommit, erro
SetHeader("Accept", "application/json").
SetResult(&VCSCommit{}).
SetError(&APIError{}).
Get(fmt.Sprintf("/vcs/commit/%s?changes=%s", request.Hash, strconv.FormatBool(request.IncludeChanges)))
Get(fmt.Sprintf("/v1/vcs/commit/%s?changes=%s", request.Hash, strconv.FormatBool(request.IncludeChanges)))

if err != nil {
return nil, err
Expand All @@ -229,7 +229,7 @@ func (sdk SDK) VCSTags() (*[]VCSTag, error) {
SetHeader("Accept", "application/json").
SetResult(&[]VCSTag{}).
SetError(&APIError{}).
Get("/vcs/tag")
Get("/v1/vcs/tag")

if err != nil {
return nil, err
Expand All @@ -250,7 +250,7 @@ func (sdk SDK) VCSReleases(request VCSReleasesRequest) (*[]VCSRelease, error) {
SetHeader("Accept", "application/json").
SetResult(&[]VCSRelease{}).
SetError(&APIError{}).
Get(fmt.Sprintf("/vcs/release?type=%s", request.Type))
Get(fmt.Sprintf("/v1/vcs/release?type=%s", request.Type))

if err != nil {
return nil, err
Expand All @@ -272,7 +272,7 @@ func (sdk SDK) VCSDiff(request VCSDiffRequest) (*[]VCSDiff, error) {
SetHeader("Accept", "application/json").
SetResult(&[]VCSDiff{}).
SetError(&APIError{}).
Get(fmt.Sprintf("/vcs/diff?from=%s&to=%s", request.FromHash, request.ToHash))
Get(fmt.Sprintf("/v1/vcs/diff?from=%s&to=%s", request.FromHash, request.ToHash))

if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion command.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func (sdk SDK) ExecuteCommand(req ExecuteCommandRequest) (*ExecuteCommandRespons
SetBody(req).
SetResult(&ExecuteCommandResponse{}).
SetError(&APIError{}).
Post("/command")
Post("/v1/command/execute")

if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion log.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ func (sdk SDK) Log(req LogMessageRequest) error {
SetHeader("Accept", "application/json").
SetBody(req).
SetError(&APIError{}).
Post("/log")
Post("/v1/log")

if err != nil {
return err
Expand Down

0 comments on commit 4c8a505

Please sign in to comment.