diff --git a/committestresult.go b/committestresult.go index 6d68904..70a7b25 100644 --- a/committestresult.go +++ b/committestresult.go @@ -4,6 +4,7 @@ package openlayer import ( "context" + "errors" "fmt" "net/http" "net/url" @@ -41,6 +42,10 @@ func NewCommitTestResultService(opts ...option.RequestOption) (r *CommitTestResu // List the test results for a commit (project version). func (r *CommitTestResultService) List(ctx context.Context, id string, query CommitTestResultListParams, opts ...option.RequestOption) (res *CommitTestResultListResponse, err error) { opts = append(r.Options[:], opts...) + if id == "" { + err = errors.New("missing required id parameter") + return + } path := fmt.Sprintf("versions/%s/results", id) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &res, opts...) return diff --git a/inferencepipelinedata.go b/inferencepipelinedata.go index 008f815..11e7c95 100644 --- a/inferencepipelinedata.go +++ b/inferencepipelinedata.go @@ -4,6 +4,7 @@ package openlayer import ( "context" + "errors" "fmt" "net/http" @@ -35,6 +36,10 @@ func NewInferencePipelineDataService(opts ...option.RequestOption) (r *Inference // Stream production data to an inference pipeline in Openlayer. func (r *InferencePipelineDataService) Stream(ctx context.Context, id string, body InferencePipelineDataStreamParams, opts ...option.RequestOption) (res *InferencePipelineDataStreamResponse, err error) { opts = append(r.Options[:], opts...) + if id == "" { + err = errors.New("missing required id parameter") + return + } path := fmt.Sprintf("inference-pipelines/%s/data-stream", id) err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &res, opts...) return diff --git a/inferencepipelinetestresult.go b/inferencepipelinetestresult.go index b44c372..469e1ba 100644 --- a/inferencepipelinetestresult.go +++ b/inferencepipelinetestresult.go @@ -4,6 +4,7 @@ package openlayer import ( "context" + "errors" "fmt" "net/http" "net/url" @@ -41,6 +42,10 @@ func NewInferencePipelineTestResultService(opts ...option.RequestOption) (r *Inf // List the test results under an inference pipeline. func (r *InferencePipelineTestResultService) List(ctx context.Context, id string, query InferencePipelineTestResultListParams, opts ...option.RequestOption) (res *InferencePipelineTestResultListResponse, err error) { opts = append(r.Options[:], opts...) + if id == "" { + err = errors.New("missing required id parameter") + return + } path := fmt.Sprintf("inference-pipelines/%s/results", id) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &res, opts...) return diff --git a/projectcommit.go b/projectcommit.go index 1ced822..ef0c657 100644 --- a/projectcommit.go +++ b/projectcommit.go @@ -4,6 +4,7 @@ package openlayer import ( "context" + "errors" "fmt" "net/http" "net/url" @@ -38,6 +39,10 @@ func NewProjectCommitService(opts ...option.RequestOption) (r *ProjectCommitServ // List the commits (project versions) under a project. func (r *ProjectCommitService) List(ctx context.Context, id string, query ProjectCommitListParams, opts ...option.RequestOption) (res *ProjectCommitListResponse, err error) { opts = append(r.Options[:], opts...) + if id == "" { + err = errors.New("missing required id parameter") + return + } path := fmt.Sprintf("projects/%s/versions", id) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &res, opts...) return diff --git a/projectinferencepipeline.go b/projectinferencepipeline.go index 7df1d54..7e02fce 100644 --- a/projectinferencepipeline.go +++ b/projectinferencepipeline.go @@ -4,6 +4,7 @@ package openlayer import ( "context" + "errors" "fmt" "net/http" "net/url" @@ -38,6 +39,10 @@ func NewProjectInferencePipelineService(opts ...option.RequestOption) (r *Projec // List the inference pipelines in a project. func (r *ProjectInferencePipelineService) List(ctx context.Context, id string, query ProjectInferencePipelineListParams, opts ...option.RequestOption) (res *ProjectInferencePipelineListResponse, err error) { opts = append(r.Options[:], opts...) + if id == "" { + err = errors.New("missing required id parameter") + return + } path := fmt.Sprintf("projects/%s/inference-pipelines", id) err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &res, opts...) return