chore(tasks): support looking up tasks by script id (#437)
This commit is contained in:
@ -701,6 +701,7 @@ type ApiGetTasksRequest struct {
|
|||||||
offset *int32
|
offset *int32
|
||||||
sortBy *string
|
sortBy *string
|
||||||
type_ *string
|
type_ *string
|
||||||
|
scriptID *string
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r ApiGetTasksRequest) ZapTraceSpan(zapTraceSpan string) ApiGetTasksRequest {
|
func (r ApiGetTasksRequest) ZapTraceSpan(zapTraceSpan string) ApiGetTasksRequest {
|
||||||
@ -791,6 +792,14 @@ func (r ApiGetTasksRequest) GetType_() *string {
|
|||||||
return r.type_
|
return r.type_
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (r ApiGetTasksRequest) ScriptID(scriptID string) ApiGetTasksRequest {
|
||||||
|
r.scriptID = &scriptID
|
||||||
|
return r
|
||||||
|
}
|
||||||
|
func (r ApiGetTasksRequest) GetScriptID() *string {
|
||||||
|
return r.scriptID
|
||||||
|
}
|
||||||
|
|
||||||
func (r ApiGetTasksRequest) Execute() (Tasks, error) {
|
func (r ApiGetTasksRequest) Execute() (Tasks, error) {
|
||||||
return r.ApiService.GetTasksExecute(r)
|
return r.ApiService.GetTasksExecute(r)
|
||||||
}
|
}
|
||||||
@ -882,6 +891,9 @@ func (a *TasksApiService) GetTasksExecuteWithHttpInfo(r ApiGetTasksRequest) (Tas
|
|||||||
if r.type_ != nil {
|
if r.type_ != nil {
|
||||||
localVarQueryParams.Add("type", parameterToString(*r.type_, ""))
|
localVarQueryParams.Add("type", parameterToString(*r.type_, ""))
|
||||||
}
|
}
|
||||||
|
if r.scriptID != nil {
|
||||||
|
localVarQueryParams.Add("scriptID", parameterToString(*r.scriptID, ""))
|
||||||
|
}
|
||||||
// to determine the Content-Type header
|
// to determine the Content-Type header
|
||||||
localVarHTTPContentTypes := []string{}
|
localVarHTTPContentTypes := []string{}
|
||||||
|
|
||||||
|
Submodule api/contract/openapi updated: 0df6358a78...226874df68
@ -109,9 +109,10 @@ func (c Client) Create(ctx context.Context, params *CreateParams) error {
|
|||||||
|
|
||||||
type FindParams struct {
|
type FindParams struct {
|
||||||
clients.OrgParams
|
clients.OrgParams
|
||||||
TaskID string
|
TaskID string
|
||||||
UserID string
|
UserID string
|
||||||
Limit int
|
ScriptID string
|
||||||
|
Limit int
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c Client) Find(ctx context.Context, params *FindParams) error {
|
func (c Client) Find(ctx context.Context, params *FindParams) error {
|
||||||
@ -141,6 +142,9 @@ func (c Client) Find(ctx context.Context, params *FindParams) error {
|
|||||||
if params.UserID != "" {
|
if params.UserID != "" {
|
||||||
getTask = getTask.User(params.UserID)
|
getTask = getTask.User(params.UserID)
|
||||||
}
|
}
|
||||||
|
if params.ScriptID != "" {
|
||||||
|
getTask = getTask.ScriptID(params.ScriptID)
|
||||||
|
}
|
||||||
tasksResult, err := getTask.Execute()
|
tasksResult, err := getTask.Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -125,6 +125,11 @@ func newTaskFindCmd() cli.Command {
|
|||||||
Usage: "task owner ID",
|
Usage: "task owner ID",
|
||||||
Destination: ¶ms.UserID,
|
Destination: ¶ms.UserID,
|
||||||
},
|
},
|
||||||
|
&cli.StringFlag{
|
||||||
|
Name: "script-id",
|
||||||
|
Usage: "script ID",
|
||||||
|
Destination: ¶ms.ScriptID,
|
||||||
|
},
|
||||||
&cli.IntFlag{
|
&cli.IntFlag{
|
||||||
Name: "limit",
|
Name: "limit",
|
||||||
Usage: "the number of tasks to find",
|
Usage: "the number of tasks to find",
|
||||||
|
Reference in New Issue
Block a user