@@ -42,19 +42,19 @@ func (r *WorkerService) New(ctx context.Context, body WorkerNewParams, opts ...o
4242 opts = slices .Concat (r .Options , opts )
4343 path := "v1/workers"
4444 err = requestconfig .ExecuteNewRequest (ctx , http .MethodPost , path , body , & res , opts ... )
45- return
45+ return res , err
4646}
4747
4848// Update a worker
4949func (r * WorkerService ) Update (ctx context.Context , id string , body WorkerUpdateParams , opts ... option.RequestOption ) (res * WorkerResponse , err error ) {
5050 opts = slices .Concat (r .Options , opts )
5151 if id == "" {
5252 err = errors .New ("missing required id parameter" )
53- return
53+ return nil , err
5454 }
5555 path := fmt .Sprintf ("v1/workers/%s" , id )
5656 err = requestconfig .ExecuteNewRequest (ctx , http .MethodPatch , path , body , & res , opts ... )
57- return
57+ return res , err
5858}
5959
6060// List all workers with their definitions
@@ -86,35 +86,35 @@ func (r *WorkerService) Delete(ctx context.Context, id string, opts ...option.Re
8686 opts = append ([]option.RequestOption {option .WithHeader ("Accept" , "*/*" )}, opts ... )
8787 if id == "" {
8888 err = errors .New ("missing required id parameter" )
89- return
89+ return err
9090 }
9191 path := fmt .Sprintf ("v1/workers/%s" , id )
9292 err = requestconfig .ExecuteNewRequest (ctx , http .MethodDelete , path , nil , nil , opts ... )
93- return
93+ return err
9494}
9595
9696// Get a worker by ID
9797func (r * WorkerService ) Get (ctx context.Context , id string , opts ... option.RequestOption ) (res * WorkerResponse , err error ) {
9898 opts = slices .Concat (r .Options , opts )
9999 if id == "" {
100100 err = errors .New ("missing required id parameter" )
101- return
101+ return nil , err
102102 }
103103 path := fmt .Sprintf ("v1/workers/%s" , id )
104104 err = requestconfig .ExecuteNewRequest (ctx , http .MethodGet , path , nil , & res , opts ... )
105- return
105+ return res , err
106106}
107107
108108// Get the health of a worker
109109func (r * WorkerService ) Health (ctx context.Context , id string , opts ... option.RequestOption ) (res * WorkerHealthResponse , err error ) {
110110 opts = slices .Concat (r .Options , opts )
111111 if id == "" {
112112 err = errors .New ("missing required id parameter" )
113- return
113+ return nil , err
114114 }
115115 path := fmt .Sprintf ("v1/workers/%s/health" , id )
116116 err = requestconfig .ExecuteNewRequest (ctx , http .MethodGet , path , nil , & res , opts ... )
117- return
117+ return res , err
118118}
119119
120120// Returns a page of tools
@@ -124,7 +124,7 @@ func (r *WorkerService) Tools(ctx context.Context, id string, query WorkerToolsP
124124 opts = append ([]option.RequestOption {option .WithResponseInto (& raw )}, opts ... )
125125 if id == "" {
126126 err = errors .New ("missing required id parameter" )
127- return
127+ return nil , err
128128 }
129129 path := fmt .Sprintf ("v1/workers/%s/tools" , id )
130130 cfg , err := requestconfig .NewRequestConfig (ctx , http .MethodGet , path , query , & res , opts ... )
0 commit comments