Skip to content

Commit

Permalink
feat: add artifact id
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippHeuer committed Feb 9, 2023
1 parent 07b63a2 commit 4159685
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ func (sdk SDK) ArtifactUploadByteArray(request ArtifactUploadByteArrayRequest) e
}

type ArtifactDownloadRequest struct {
ID string `json:"id"`
Module string `json:"module"`
Type string `json:"type"`
Name string `json:"name"`
Expand All @@ -351,6 +352,7 @@ type ArtifactDownloadRequest struct {
// ArtifactDownload request
func (sdk SDK) ArtifactDownload(request ArtifactDownloadRequest) error {
resp, err := sdk.client.R().
SetQueryParam("id", request.ID).
SetQueryParam("module", request.Module).
SetQueryParam("type", request.Type).
SetQueryParam("name", request.Name).
Expand All @@ -367,6 +369,7 @@ func (sdk SDK) ArtifactDownload(request ArtifactDownloadRequest) error {
}

type ArtifactDownloadByteArrayRequest struct {
ID string `json:"id"`
Module string `json:"module"`
Type string `json:"type"`
Name string `json:"name"`
Expand All @@ -375,6 +378,7 @@ type ArtifactDownloadByteArrayRequest struct {
// ArtifactDownloadByteArray request
func (sdk SDK) ArtifactDownloadByteArray(request ArtifactDownloadByteArrayRequest) ([]byte, error) {
resp, err := sdk.client.R().
SetQueryParam("id", request.ID).
SetQueryParam("module", request.Module).
SetQueryParam("type", request.Type).
SetQueryParam("name", request.Name).
Expand Down
3 changes: 2 additions & 1 deletion client_test.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package cidsdk

import (
"github.com/stretchr/testify/assert"
"os"
"testing"

"github.com/stretchr/testify/assert"
)

func TestSDKHealth(t *testing.T) {
Expand Down
3 changes: 3 additions & 0 deletions const.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const (
LanguageJavascript ProjectLanguage = "javascript"
LanguageTypescript ProjectLanguage = "typescript"
LanguagePython ProjectLanguage = "python"
LanguagePHP ProjectLanguage = "php"
)

type ProjectBuildSystem string
Expand All @@ -26,6 +27,8 @@ const (
BuildSystemPipfile ProjectBuildSystem = "pipfile"
BuildSystemSetupPy ProjectBuildSystem = "setup.py"
BuildSystemMkdocs ProjectBuildSystem = "mkdocs"
BuildSystemComposer ProjectBuildSystem = "composer"
BuildSystemDotNet ProjectBuildSystem = "dotnet"
)

type ProjectBuildSystemSyntax string
Expand Down
1 change: 1 addition & 0 deletions types.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ const (
type ActionArtifact struct {
BuildID string `json:"build_id,omitempty"`
JobID string `json:"job_id,omitempty"`
ID string `json:"id,omitempty"`
Module string `json:"module,omitempty"`
Type ActionArtifactType `json:"type,omitempty"`
Name string `json:"name,omitempty"`
Expand Down

0 comments on commit 4159685

Please sign in to comment.