Creates a draft or publishes an agent. Use isDraft=true to save a draft, or isDraft=false (or omit) to publish immediately. Only draft and publish modes are supported.
package hello.world;
import com.glean.api_client.glean_api_client.Glean;
import com.glean.api_client.glean_api_client.models.components.EditWorkflowRequest;
import com.glean.api_client.glean_api_client.models.errors.ErrorResponse;
import com.glean.api_client.glean_api_client.models.operations.EditAgentResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws ErrorResponse, Exception {
Glean sdk = Glean.builder()
.apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", ""))
.build();
EditAgentResponse res = sdk.agents().editAgent()
.agentId("<id>")
.editWorkflowRequest(EditWorkflowRequest.builder()
.build())
.call();
// handle response
}
}
| Parameter |
Type |
Required |
Description |
locale |
Optional<String> |
➖ |
The client's preferred locale in rfc5646 format (e.g. en, ja, pt-BR). If omitted, the Accept-Language will be used. If not present or not supported, defaults to the closest match or en. |
timezoneOffset |
Optional<Long> |
➖ |
The offset of the client's timezone in minutes from UTC. e.g. PDT is -420 because it's 7 hours behind UTC. |
agentId |
String |
✔️ |
The ID of the agent. |
editWorkflowRequest |
EditWorkflowRequest |
✔️ |
N/A |
EditAgentResponse
| Error Type |
Status Code |
Content Type |
| models/errors/ErrorResponse |
404 |
application/json |
| models/errors/APIException |
4XX, 5XX |
*/* |