11package com .slack .api .bolt .context .builtin ;
22
3+ import com .slack .api .RequestConfigurator ;
34import com .slack .api .bolt .context .Context ;
45import com .slack .api .bolt .context .FunctionUtility ;
56import com .slack .api .bolt .context .SayUtility ;
67import com .slack .api .bolt .service .AssistantThreadContextService ;
78import com .slack .api .bolt .util .BuilderConfigurator ;
89import com .slack .api .methods .SlackApiException ;
10+ import com .slack .api .methods .request .assistant .threads .AssistantThreadsSetStatusRequest ;
11+ import com .slack .api .methods .request .assistant .threads .AssistantThreadsSetSuggestedPromptsRequest ;
12+ import com .slack .api .methods .request .assistant .threads .AssistantThreadsSetTitleRequest ;
913import com .slack .api .methods .request .chat .ChatPostMessageRequest ;
1014import com .slack .api .methods .response .asssistant .threads .AssistantThreadsSetStatusResponse ;
1115import com .slack .api .methods .response .asssistant .threads .AssistantThreadsSetSuggestedPromptsResponse ;
16+ import com .slack .api .methods .response .asssistant .threads .AssistantThreadsSetTitleResponse ;
1217import com .slack .api .methods .response .chat .ChatPostMessageResponse ;
1318import com .slack .api .model .Message ;
1419import com .slack .api .model .assistant .AssistantThreadContext ;
@@ -111,6 +116,40 @@ public AssistantThreadsSetStatusResponse setStatus(String status) throws IOExcep
111116 }
112117 }
113118
119+ public AssistantThreadsSetStatusResponse setStatus (RequestConfigurator <AssistantThreadsSetStatusRequest .AssistantThreadsSetStatusRequestBuilder > req ) throws IOException , SlackApiException {
120+ if (isAssistantThreadEvent ()) {
121+ return this .client ().assistantThreadsSetStatus (req .configure (AssistantThreadsSetStatusRequest .builder ()
122+ .channelId (this .getChannelId ())
123+ .threadTs (this .getThreadTs ())
124+ ).build ());
125+ } else {
126+ throw new IllegalStateException ("This utility is only available for Assistant feature enabled app!" );
127+ }
128+ }
129+
130+ public AssistantThreadsSetTitleResponse setTitle (String title ) throws IOException , SlackApiException {
131+ if (isAssistantThreadEvent ()) {
132+ return this .client ().assistantThreadsSetTitle (r -> r
133+ .channelId (this .getChannelId ())
134+ .threadTs (this .getThreadTs ())
135+ .title (title )
136+ );
137+ } else {
138+ throw new IllegalStateException ("This utility is only available for Assistant feature enabled app!" );
139+ }
140+ }
141+
142+ public AssistantThreadsSetTitleResponse setTitle (RequestConfigurator <AssistantThreadsSetTitleRequest .AssistantThreadsSetTitleRequestBuilder > req ) throws IOException , SlackApiException {
143+ if (isAssistantThreadEvent ()) {
144+ return this .client ().assistantThreadsSetTitle (req .configure (AssistantThreadsSetTitleRequest .builder ()
145+ .channelId (this .getChannelId ())
146+ .threadTs (this .getThreadTs ())
147+ ).build ());
148+ } else {
149+ throw new IllegalStateException ("This utility is only available for Assistant feature enabled app!" );
150+ }
151+ }
152+
114153 public AssistantThreadsSetSuggestedPromptsResponse setSuggestedPrompts (List <SuggestedPrompt > prompts ) throws IOException , SlackApiException {
115154 if (isAssistantThreadEvent ()) {
116155 return this .client ().assistantThreadsSetSuggestedPrompts (r -> r
@@ -123,6 +162,17 @@ public AssistantThreadsSetSuggestedPromptsResponse setSuggestedPrompts(List<Sugg
123162 }
124163 }
125164
165+ public AssistantThreadsSetSuggestedPromptsResponse setSuggestedPrompts (RequestConfigurator <AssistantThreadsSetSuggestedPromptsRequest .AssistantThreadsSetSuggestedPromptsRequestBuilder > req ) throws IOException , SlackApiException {
166+ if (isAssistantThreadEvent ()) {
167+ return this .client ().assistantThreadsSetSuggestedPrompts (req .configure (AssistantThreadsSetSuggestedPromptsRequest .builder ()
168+ .channelId (this .getChannelId ())
169+ .threadTs (this .getThreadTs ())
170+ ).build ());
171+ } else {
172+ throw new IllegalStateException ("This utility is only available for Assistant feature enabled app!" );
173+ }
174+ }
175+
126176 public AssistantThreadsSetSuggestedPromptsResponse setSuggestedPrompts (List <SuggestedPrompt > prompts , String title ) throws IOException , SlackApiException {
127177 if (isAssistantThreadEvent ()) {
128178 return this .client ().assistantThreadsSetSuggestedPrompts (r -> r
0 commit comments