@@ -34,9 +34,9 @@ public final class RunEngineService {
3434 /* ---- Ping & status --------------------------------------------------- */
3535
3636 public Envelope <?> ping () throws Exception { return http .call (ApiEndpoint .PING , NoBody .INSTANCE ); }
37- public StatusResponse status () throws Exception {
37+ public StatusResponse status () throws Exception {
3838 LOG .log (Level .FINEST , "Fetching status" );
39- return http .send (ApiEndpoint .STATUS , NoBody .INSTANCE , StatusResponse .class );
39+ return http .send (ApiEndpoint .STATUS , NoBody .INSTANCE , StatusResponse .class );
4040 }
4141 public Envelope <?> configGet () throws Exception { return http .call (ApiEndpoint .CONFIG_GET , NoBody .INSTANCE ); }
4242
@@ -136,6 +136,22 @@ public Envelope<?> queueItemAddBatch(List<QueueItem> items,
136136 public Envelope <?> queueItemAddBatch (QueueItemMoveBatch body ) throws Exception { return http .call (ApiEndpoint .QUEUE_ITEM_ADD_BATCH , body ); }
137137 public Envelope <?> queueItemGet (Object params ) throws Exception { return http .call (ApiEndpoint .QUEUE_ITEM_GET , params ); }
138138 public Envelope <?> queueItemUpdate (Object b ) throws Exception { return http .call (ApiEndpoint .QUEUE_ITEM_UPDATE , b ); }
139+
140+ public Envelope <?> queueItemUpdate (QueueItem item ) throws Exception {
141+ Map <String , Object > updateRequest = Map .of (
142+ "item" , Map .of (
143+ "item_type" , item .itemType (),
144+ "name" , item .name (),
145+ "args" , item .args (),
146+ "kwargs" , item .kwargs (),
147+ "item_uid" , item .itemUid ()
148+ ),
149+ "user" , item .user () != null ? item .user () : "GUI Client" ,
150+ "user_group" , item .userGroup () != null ? item .userGroup () : "primary" ,
151+ "replace" , true
152+ );
153+ return queueItemUpdate (updateRequest );
154+ }
139155 public Envelope <?> queueItemRemove (Object b ) throws Exception { return http .call (ApiEndpoint .QUEUE_ITEM_REMOVE , b ); }
140156 public Envelope <?> queueItemRemoveBatch (Object b ) throws Exception {return http .call (ApiEndpoint .QUEUE_ITEM_REMOVE_BATCH ,b ); }
141157 public Envelope <?> queueItemMove (Object b ) throws Exception { return http .call (ApiEndpoint .QUEUE_ITEM_MOVE , b ); }
@@ -234,9 +250,9 @@ public Envelope<?> rePause(String option) throws Exception {
234250 /* ---- Permissions & allowed lists ------------------------------------ */
235251
236252 public Envelope <?> plansAllowed () throws Exception { return http .call (ApiEndpoint .PLANS_ALLOWED , NoBody .INSTANCE ); }
237- public Map <String , Object > plansAllowedRaw () throws Exception {
253+ public Map <String , Object > plansAllowedRaw () throws Exception {
238254 LOG .log (Level .FINE , "Fetching plans allowed (raw)" );
239- return http .send (ApiEndpoint .PLANS_ALLOWED , NoBody .INSTANCE );
255+ return http .send (ApiEndpoint .PLANS_ALLOWED , NoBody .INSTANCE );
240256 }
241257 public Envelope <?> devicesAllowed () throws Exception { return http .call (ApiEndpoint .DEVICES_ALLOWED , NoBody .INSTANCE ); }
242258 public Envelope <?> plansExisting () throws Exception { return http .call (ApiEndpoint .PLANS_EXISTING , NoBody .INSTANCE ); }
@@ -276,4 +292,4 @@ public Map<String, Object> plansAllowedRaw() throws Exception {
276292 public Envelope <?> whoAmI () throws Exception { return http .call (ApiEndpoint .WHOAMI , NoBody .INSTANCE ); }
277293 public Envelope <?> apiScopes () throws Exception { return http .call (ApiEndpoint .API_SCOPES , NoBody .INSTANCE ); }
278294 public Envelope <?> logout () throws Exception { return http .call (ApiEndpoint .LOGOUT , NoBody .INSTANCE ); }
279- }
295+ }
0 commit comments