From 345e17a6247c9b829314c27761759073871ba50a Mon Sep 17 00:00:00 2001 From: Angelo Paparazzi Date: Wed, 21 Feb 2024 10:49:08 -0600 Subject: [PATCH] feat(wa-v2): new method params --- .../ibm/watson/assistant/v2/Assistant.java | 81 +++++++------------ .../v2/model/MessageInputOptions.java | 35 +++++++- .../model/MessageInputOptionsStateless.java | 33 ++++++++ .../assistant/v2/model/SkillImport.java | 7 +- .../v2/model/UpdateEnvironmentOptions.java | 36 +++++++-- .../watson/assistant/v2/AssistantTest.java | 26 +++--- .../assistant/v2/model/EnvironmentTest.java | 3 +- .../v2/model/MessageInputOptionsTest.java | 5 +- .../assistant/v2/model/MessageInputTest.java | 4 +- .../v2/model/MessageOptionsTest.java | 4 +- .../model/UpdateEnvironmentOptionsTest.java | 8 +- 11 files changed, 165 insertions(+), 77 deletions(-) diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/Assistant.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/Assistant.java index e0ddf09cc1..0bd102f4fd 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/Assistant.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/Assistant.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2024. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,7 @@ */ /* - * IBM OpenAPI SDK Code Generator Version: 3.64.1-cee95189-20230124-211647 + * IBM OpenAPI SDK Code Generator Version: 3.85.0-75c38f8f-20240206-210220 */ package com.ibm.watson.assistant.v2; @@ -68,13 +68,15 @@ import java.util.Map.Entry; /** - * The IBM Watson™ Assistant service combines machine learning, natural language + * The IBM® watsonx™ Assistant service combines machine learning, natural language * understanding, and an integrated dialog editor to create conversation flows between your apps and * your users. * *

The Assistant v2 API provides runtime methods your client application can use to send user * input to an assistant and receive a response. * + *

You need a paid Plus plan or higher to use the watsonx Assistant v2 API. + * *

API Version: 2.0 See: https://cloud.ibm.com/docs/assistant */ public class Assistant extends BaseService { @@ -93,7 +95,7 @@ public class Assistant extends BaseService { * the client instance. * * @param version Release date of the API version you want to use. Specify dates in YYYY-MM-DD - * format. The current version is `2021-11-27`. + * format. The current version is `2023-06-15`. */ public Assistant(String version) { this( @@ -107,7 +109,7 @@ public Assistant(String version) { * authenticator are used to configure the client instance. * * @param version Release date of the API version you want to use. Specify dates in YYYY-MM-DD - * format. The current version is `2021-11-27`. + * format. The current version is `2023-06-15`. * @param authenticator the {@link Authenticator} instance to be configured for this client */ public Assistant(String version, Authenticator authenticator) { @@ -119,7 +121,7 @@ public Assistant(String version, Authenticator authenticator) { * configure the client instance. * * @param version Release date of the API version you want to use. Specify dates in YYYY-MM-DD - * format. The current version is `2021-11-27`. + * format. The current version is `2023-06-15`. * @param serviceName the service name to be used when configuring the client instance */ public Assistant(String version, String serviceName) { @@ -131,7 +133,7 @@ public Assistant(String version, String serviceName) { * are used to configure the client instance. * * @param version Release date of the API version you want to use. Specify dates in YYYY-MM-DD - * format. The current version is `2021-11-27`. + * format. The current version is `2023-06-15`. * @param serviceName the service name to be used when configuring the client instance * @param authenticator the {@link Authenticator} instance to be configured for this client */ @@ -146,7 +148,7 @@ public Assistant(String version, String serviceName, Authenticator authenticator * Gets the version. * *

Release date of the API version you want to use. Specify dates in YYYY-MM-DD format. The - * current version is `2021-11-27`. + * current version is `2023-06-15`. * * @return the version */ @@ -169,8 +171,6 @@ public void setVersion(final String version) { * *

Create a new assistant. * - *

This method is available only with Enterprise plans. - * * @param createAssistantOptions the {@link CreateAssistantOptions} containing the options for the * call * @return a {@link ServiceCall} with a result of type {@link AssistantData} @@ -214,8 +214,6 @@ public ServiceCall createAssistant(CreateAssistantOptions createA * *

Create a new assistant. * - *

This method is available only with Enterprise plans. - * * @return a {@link ServiceCall} with a result of type {@link AssistantData} */ public ServiceCall createAssistant() { @@ -225,9 +223,7 @@ public ServiceCall createAssistant() { /** * List assistants. * - *

List the assistants associated with a Watson Assistant service instance. - * - *

This method is available only with Enterprise plans. + *

List the assistants associated with a watsonx Assistant service instance. * * @param listAssistantsOptions the {@link ListAssistantsOptions} containing the options for the * call @@ -271,9 +267,7 @@ public ServiceCall listAssistants( /** * List assistants. * - *

List the assistants associated with a Watson Assistant service instance. - * - *

This method is available only with Enterprise plans. + *

List the assistants associated with a watsonx Assistant service instance. * * @return a {@link ServiceCall} with a result of type {@link AssistantCollection} */ @@ -286,8 +280,6 @@ public ServiceCall listAssistants() { * *

Delete an assistant. * - *

This method is available only with Enterprise plans. - * * @param deleteAssistantOptions the {@link DeleteAssistantOptions} containing the options for the * call * @return a {@link ServiceCall} with a void result @@ -318,7 +310,7 @@ public ServiceCall deleteAssistant(DeleteAssistantOptions deleteAssistantO *

Create a new session. A session is used to send user input to a skill and receive responses. * It also maintains the state of the conversation. A session persists until it is deleted, or * until it times out because of inactivity. (For more information, see the - * [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-assistant-settings). + * [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-assistant-settings).). * * @param createSessionOptions the {@link CreateSessionOptions} containing the options for the * call @@ -390,7 +382,7 @@ public ServiceCall deleteSession(DeleteSessionOptions deleteSessionOptions * Send user input to assistant (stateful). * *

Send user input to an assistant and receive a response, with conversation state (including - * context data) stored by Watson Assistant for the duration of the session. + * context data) stored by watsonx Assistant for the duration of the session. * * @param messageOptions the {@link MessageOptions} containing the options for the call * @return a {@link ServiceCall} with a result of type {@link MessageResponse} @@ -527,7 +519,7 @@ public ServiceCall bulkClassify(BulkClassifyOptions bulkCl * *

List the events from the log of an assistant. * - *

This method requires Manager access, and is available only with Plus and Enterprise plans. + *

This method requires Manager access. * *

**Note:** If you use the **cursor** parameter to retrieve results one page at a time, * subsequent requests must be no more than 5 minutes apart. Any returned value for the **cursor** @@ -583,7 +575,7 @@ public ServiceCall listLogs(ListLogsOptions listLogsOptions) { * *

**Note:** This operation is intended only for deleting data associated with a single * specific customer, not for deleting data associated with multiple customers or for any other - * purpose. For more information, see [Labeling and deleting data in Watson + * purpose. For more information, see [Labeling and deleting data in watsonx * Assistant](https://cloud.ibm.com/docs/assistant?topic=assistant-information-security#information-security-gdpr-wa). * * @param deleteUserDataOptions the {@link DeleteUserDataOptions} containing the options for the @@ -612,8 +604,6 @@ public ServiceCall deleteUserData(DeleteUserDataOptions deleteUserDataOpti * *

List the environments associated with an assistant. * - *

This method is available only with Enterprise plans. - * * @param listEnvironmentsOptions the {@link ListEnvironmentsOptions} containing the options for * the call * @return a {@link ServiceCall} with a result of type {@link EnvironmentCollection} @@ -662,8 +652,6 @@ public ServiceCall listEnvironments( *

Get information about an environment. For more information about environments, see * [Environments](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-publish-overview#environments). * - *

This method is available only with Enterprise plans. - * * @param getEnvironmentOptions the {@link GetEnvironmentOptions} containing the options for the * call * @return a {@link ServiceCall} with a result of type {@link Environment} @@ -703,8 +691,6 @@ public ServiceCall getEnvironment(GetEnvironmentOptions getEnvironm * see * [Environments](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-publish-overview#environments). * - *

This method is available only with Enterprise plans. - * * @param updateEnvironmentOptions the {@link UpdateEnvironmentOptions} containing the options for * the call * @return a {@link ServiceCall} with a result of type {@link Environment} @@ -736,6 +722,12 @@ public ServiceCall updateEnvironment( if (updateEnvironmentOptions.description() != null) { contentJson.addProperty("description", updateEnvironmentOptions.description()); } + if (updateEnvironmentOptions.orchestration() != null) { + contentJson.add( + "orchestration", + com.ibm.cloud.sdk.core.util.GsonSingleton.getGson() + .toJsonTree(updateEnvironmentOptions.orchestration())); + } if (updateEnvironmentOptions.sessionTimeout() != null) { contentJson.addProperty("session_timeout", updateEnvironmentOptions.sessionTimeout()); } @@ -756,9 +748,7 @@ public ServiceCall updateEnvironment( * Create release. * *

Create a new release using the current content of the dialog and action skills in the draft - * environment. (In the Watson Assistant user interface, a release is called a *version*.) - * - *

This method is available only with Enterprise plans. + * environment. (In the watsonx Assistant user interface, a release is called a *version*.). * * @param createReleaseOptions the {@link CreateReleaseOptions} containing the options for the * call @@ -793,10 +783,8 @@ public ServiceCall createRelease(CreateReleaseOptions createReleaseOpti /** * List releases. * - *

List the releases associated with an assistant. (In the Watson Assistant user interface, a - * release is called a *version*.) - * - *

This method is available only with Enterprise plans. + *

List the releases associated with an assistant. (In the watsonx Assistant user interface, a + * release is called a *version*.). * * @param listReleasesOptions the {@link ListReleasesOptions} containing the options for the call * @return a {@link ServiceCall} with a result of type {@link ReleaseCollection} @@ -847,8 +835,6 @@ public ServiceCall listReleases(ListReleasesOptions listRelea * value of the **status** property. When processing has completed, the request returns the * release data. * - *

This method is available only with Enterprise plans. - * * @param getReleaseOptions the {@link GetReleaseOptions} containing the options for the call * @return a {@link ServiceCall} with a result of type {@link Release} */ @@ -882,9 +868,8 @@ public ServiceCall getRelease(GetReleaseOptions getReleaseOptions) { /** * Delete release. * - *

Delete a release. (In the Watson Assistant user interface, a release is called a *version*.) - * - *

This method is available only with Enterprise plans. + *

Delete a release. (In the watsonx Assistant user interface, a release is called a + * *version*.). * * @param deleteReleaseOptions the {@link DeleteReleaseOptions} containing the options for the * call @@ -918,8 +903,6 @@ public ServiceCall deleteRelease(DeleteReleaseOptions deleteReleaseOptions *

Update the environment with the content of the release. All snapshots saved as part of the * release become active in the environment. * - *

This method is available only with Enterprise plans. - * * @param deployReleaseOptions the {@link DeployReleaseOptions} containing the options for the * call * @return a {@link ServiceCall} with a result of type {@link Environment} @@ -959,8 +942,6 @@ public ServiceCall deployRelease(DeployReleaseOptions deployRelease * *

Get information about a skill. * - *

This method is available only with Enterprise plans. - * * @param getSkillOptions the {@link GetSkillOptions} containing the options for the call * @return a {@link ServiceCall} with a result of type {@link Skill} */ @@ -994,8 +975,6 @@ public ServiceCall getSkill(GetSkillOptions getSkillOptions) { *

**Note:** The update is performed asynchronously; you can see the status of the update by * calling the **Get skill** method and checking the value of the **status** property. * - *

This method is available only with Enterprise plans. - * * @param updateSkillOptions the {@link UpdateSkillOptions} containing the options for the call * @return a {@link ServiceCall} with a result of type {@link Skill} */ @@ -1066,8 +1045,6 @@ public ServiceCall updateSkill(UpdateSkillOptions updateSkillOptions) { *

When processing has completed, the request returns the exported JSON data. Remember that the * usual rate limits apply. * - *

This method is available only with Enterprise plans. - * * @param exportSkillsOptions the {@link ExportSkillsOptions} containing the options for the call * @return a {@link ServiceCall} with a result of type {@link SkillsExport} */ @@ -1107,8 +1084,6 @@ public ServiceCall exportSkills(ExportSkillsOptions exportSkillsOp * belonging to the assistant are not available until processing completes. To check the status of * the asynchronous import operation, use the **Get status of skills import** method. * - *

This method is available only with Enterprise plans. - * * @param importSkillsOptions the {@link ImportSkillsOptions} containing the options for the call * @return a {@link ServiceCall} with a result of type {@link SkillsAsyncRequestStatus} */ @@ -1153,8 +1128,6 @@ public ServiceCall importSkills( *

Retrieve the status of an asynchronous import operation previously initiated by using the * **Import skills** method. * - *

This method is available only with Enterprise plans. - * * @param importSkillsStatusOptions the {@link ImportSkillsStatusOptions} containing the options * for the call * @return a {@link ServiceCall} with a result of type {@link SkillsAsyncRequestStatus} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageInputOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageInputOptions.java index 6367b77a93..eddfe9917d 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageInputOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageInputOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2024. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -23,6 +23,9 @@ public class MessageInputOptions extends GenericModel { @SerializedName("alternate_intents") protected Boolean alternateIntents; + @SerializedName("async_callout") + protected Boolean asyncCallout; + protected MessageInputOptionsSpelling spelling; protected Boolean debug; @@ -35,6 +38,7 @@ public class MessageInputOptions extends GenericModel { public static class Builder { private Boolean restart; private Boolean alternateIntents; + private Boolean asyncCallout; private MessageInputOptionsSpelling spelling; private Boolean debug; private Boolean returnContext; @@ -48,6 +52,7 @@ public static class Builder { private Builder(MessageInputOptions messageInputOptions) { this.restart = messageInputOptions.restart; this.alternateIntents = messageInputOptions.alternateIntents; + this.asyncCallout = messageInputOptions.asyncCallout; this.spelling = messageInputOptions.spelling; this.debug = messageInputOptions.debug; this.returnContext = messageInputOptions.returnContext; @@ -88,6 +93,17 @@ public Builder alternateIntents(Boolean alternateIntents) { return this; } + /** + * Set the asyncCallout. + * + * @param asyncCallout the asyncCallout + * @return the MessageInputOptions builder + */ + public Builder asyncCallout(Boolean asyncCallout) { + this.asyncCallout = asyncCallout; + return this; + } + /** * Set the spelling. * @@ -138,6 +154,7 @@ protected MessageInputOptions() {} protected MessageInputOptions(Builder builder) { restart = builder.restart; alternateIntents = builder.alternateIntents; + asyncCallout = builder.asyncCallout; spelling = builder.spelling; debug = builder.debug; returnContext = builder.returnContext; @@ -176,6 +193,22 @@ public Boolean alternateIntents() { return alternateIntents; } + /** + * Gets the asyncCallout. + * + *

Whether custom extension callouts are executed asynchronously. Asynchronous execution means + * the response to the extension callout will be processed on the subsequent message call, the + * initial message response signals to the client that the operation may be long running. With + * synchronous execution the custom extension is executed and returns the response in a single + * message turn. **Note:** **async_callout** defaults to true for API versions earlier than + * 2023-06-15. + * + * @return the asyncCallout + */ + public Boolean asyncCallout() { + return asyncCallout; + } + /** * Gets the spelling. * diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageInputOptionsStateless.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageInputOptionsStateless.java index cab36462c6..30a1422889 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageInputOptionsStateless.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageInputOptionsStateless.java @@ -23,6 +23,9 @@ public class MessageInputOptionsStateless extends GenericModel { @SerializedName("alternate_intents") protected Boolean alternateIntents; + @SerializedName("async_callout") + protected Boolean asyncCallout; + protected MessageInputOptionsSpelling spelling; protected Boolean debug; @@ -30,6 +33,7 @@ public class MessageInputOptionsStateless extends GenericModel { public static class Builder { private Boolean restart; private Boolean alternateIntents; + private Boolean asyncCallout; private MessageInputOptionsSpelling spelling; private Boolean debug; @@ -41,6 +45,7 @@ public static class Builder { private Builder(MessageInputOptionsStateless messageInputOptionsStateless) { this.restart = messageInputOptionsStateless.restart; this.alternateIntents = messageInputOptionsStateless.alternateIntents; + this.asyncCallout = messageInputOptions.asyncCallout; this.spelling = messageInputOptionsStateless.spelling; this.debug = messageInputOptionsStateless.debug; } @@ -79,6 +84,17 @@ public Builder alternateIntents(Boolean alternateIntents) { return this; } + /** + * Set the asyncCallout. + * + * @param asyncCallout the asyncCallout + * @return the MessageInputOptions builder + */ + public Builder asyncCallout(Boolean asyncCallout) { + this.asyncCallout = asyncCallout; + return this; + } + /** * Set the spelling. * @@ -107,6 +123,7 @@ protected MessageInputOptionsStateless() {} protected MessageInputOptionsStateless(Builder builder) { restart = builder.restart; alternateIntents = builder.alternateIntents; + asyncCallout = builder.asyncCallout; spelling = builder.spelling; debug = builder.debug; } @@ -143,6 +160,22 @@ public Boolean alternateIntents() { return alternateIntents; } + /** + * Gets the asyncCallout. + * + *

Whether custom extension callouts are executed asynchronously. Asynchronous execution means + * the response to the extension callout will be processed on the subsequent message call, the + * initial message response signals to the client that the operation may be long running. With + * synchronous execution the custom extension is executed and returns the response in a single + * message turn. **Note:** **async_callout** defaults to true for API versions earlier than + * 2023-06-15. + * + * @return the asyncCallout + */ + public Boolean asyncCallout() { + return asyncCallout; + } + /** * Gets the spelling. * diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SkillImport.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SkillImport.java index 1ce9aa493d..1f1bc42e58 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SkillImport.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SkillImport.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2023. + * (C) Copyright IBM Corp. 2024. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -48,8 +48,6 @@ public interface Type { String ACTION = "action"; /** dialog. */ String DIALOG = "dialog"; - /** search. */ - String SEARCH = "search"; } protected String name; @@ -398,6 +396,9 @@ public String nextSnapshotVersion() { * *

An object describing the search skill configuration. * + *

**Note:** Search settings are not supported in **Import skills** requests, and are not + * included in **Export skills** responses. + * * @return the searchSettings */ public SearchSettings searchSettings() { diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/UpdateEnvironmentOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/UpdateEnvironmentOptions.java index d741c4a432..03e30db6a5 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/UpdateEnvironmentOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/UpdateEnvironmentOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2023. + * (C) Copyright IBM Corp. 2024. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -23,6 +23,7 @@ public class UpdateEnvironmentOptions extends GenericModel { protected String environmentId; protected String name; protected String description; + protected BaseEnvironmentOrchestration orchestration; protected Long sessionTimeout; protected List skillReferences; @@ -32,6 +33,7 @@ public static class Builder { private String environmentId; private String name; private String description; + private BaseEnvironmentOrchestration orchestration; private Long sessionTimeout; private List skillReferences; @@ -45,6 +47,7 @@ private Builder(UpdateEnvironmentOptions updateEnvironmentOptions) { this.environmentId = updateEnvironmentOptions.environmentId; this.name = updateEnvironmentOptions.name; this.description = updateEnvironmentOptions.description; + this.orchestration = updateEnvironmentOptions.orchestration; this.sessionTimeout = updateEnvironmentOptions.sessionTimeout; this.skillReferences = updateEnvironmentOptions.skillReferences; } @@ -73,9 +76,9 @@ public UpdateEnvironmentOptions build() { } /** - * Adds an skillReference to skillReferences. + * Adds a new element to skillReferences. * - * @param skillReference the new skillReference + * @param skillReference the new element to be added * @return the UpdateEnvironmentOptions builder */ public Builder addSkillReference(EnvironmentSkill skillReference) { @@ -132,6 +135,17 @@ public Builder description(String description) { return this; } + /** + * Set the orchestration. + * + * @param orchestration the orchestration + * @return the UpdateEnvironmentOptions builder + */ + public Builder orchestration(BaseEnvironmentOrchestration orchestration) { + this.orchestration = orchestration; + return this; + } + /** * Set the sessionTimeout. * @@ -166,6 +180,7 @@ protected UpdateEnvironmentOptions(Builder builder) { environmentId = builder.environmentId; name = builder.name; description = builder.description; + orchestration = builder.orchestration; sessionTimeout = builder.sessionTimeout; skillReferences = builder.skillReferences; } @@ -187,7 +202,7 @@ public Builder newBuilder() { * environment ID of the environment where the assistant is deployed. - For all other requests, * specify the assistant ID of the assistant. * - *

To find the environment ID or assistant ID in the Watson Assistant user interface, open the + *

To find the environment ID or assistant ID in the watsonx Assistant user interface, open the * assistant settings and scroll to the **Environments** section. * *

**Note:** If you are using the classic Watson Assistant experience, always use the assistant @@ -203,7 +218,7 @@ public String assistantId() { /** * Gets the environmentId. * - *

Unique identifier of the environment. To find the environment ID in the Watson Assistant + *

Unique identifier of the environment. To find the environment ID in the watsonx Assistant * user interface, open the environment settings and click **API Details**. **Note:** Currently, * the API does not support creating environments. * @@ -235,6 +250,17 @@ public String description() { return description; } + /** + * Gets the orchestration. + * + *

The search skill orchestration settings for the environment. + * + * @return the orchestration + */ + public BaseEnvironmentOrchestration orchestration() { + return orchestration; + } + /** * Gets the sessionTimeout. * diff --git a/assistant/src/test/java/com/ibm/watson/assistant/v2/AssistantTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/AssistantTest.java index b29696de3c..b3622537ab 100644 --- a/assistant/src/test/java/com/ibm/watson/assistant/v2/AssistantTest.java +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/AssistantTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2024. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -21,6 +21,7 @@ import com.ibm.watson.assistant.v2.model.AssistantCollection; import com.ibm.watson.assistant.v2.model.AssistantData; import com.ibm.watson.assistant.v2.model.AssistantState; +import com.ibm.watson.assistant.v2.model.BaseEnvironmentOrchestration; import com.ibm.watson.assistant.v2.model.BulkClassifyOptions; import com.ibm.watson.assistant.v2.model.BulkClassifyResponse; import com.ibm.watson.assistant.v2.model.BulkClassifyUtterance; @@ -191,7 +192,7 @@ public void testListAssistantsWOptions() throws Throwable { // Construct an instance of the ListAssistantsOptions model ListAssistantsOptions listAssistantsOptionsModel = new ListAssistantsOptions.Builder() - .pageLimit(Long.valueOf("26")) + .pageLimit(Long.valueOf("100")) .includeCount(false) .sort("name") .cursor("testString") @@ -216,7 +217,7 @@ public void testListAssistantsWOptions() throws Throwable { Map query = TestUtilities.parseQueryString(request); assertNotNull(query); assertEquals(query.get("version"), "testString"); - assertEquals(Long.valueOf(query.get("page_limit")), Long.valueOf("26")); + assertEquals(Long.valueOf(query.get("page_limit")), Long.valueOf("100")); assertEquals(Boolean.valueOf(query.get("include_count")), Boolean.valueOf(false)); assertEquals(query.get("sort"), "name"); assertEquals(query.get("cursor"), "testString"); @@ -502,6 +503,7 @@ public void testMessageWOptions() throws Throwable { new MessageInputOptions.Builder() .restart(false) .alternateIntents(false) + .asyncCallout(false) .spelling(messageInputOptionsSpellingModel) .debug(false) .returnContext(false) @@ -727,6 +729,7 @@ public void testMessageStatelessWOptions() throws Throwable { new MessageInputOptionsStateless.Builder() .restart(false) .alternateIntents(false) + .asyncCallout(false) .spelling(messageInputOptionsSpellingModel) .debug(false) .build(); @@ -928,7 +931,7 @@ public void testListLogsWOptions() throws Throwable { .assistantId("testString") .sort("testString") .filter("testString") - .pageLimit(Long.valueOf("26")) + .pageLimit(Long.valueOf("100")) .cursor("testString") .build(); @@ -951,7 +954,7 @@ public void testListLogsWOptions() throws Throwable { assertEquals(query.get("version"), "testString"); assertEquals(query.get("sort"), "testString"); assertEquals(query.get("filter"), "testString"); - assertEquals(Long.valueOf(query.get("page_limit")), Long.valueOf("26")); + assertEquals(Long.valueOf(query.get("page_limit")), Long.valueOf("100")); assertEquals(query.get("cursor"), "testString"); } @@ -1038,7 +1041,7 @@ public void testListEnvironmentsWOptions() throws Throwable { ListEnvironmentsOptions listEnvironmentsOptionsModel = new ListEnvironmentsOptions.Builder() .assistantId("testString") - .pageLimit(Long.valueOf("26")) + .pageLimit(Long.valueOf("100")) .includeCount(false) .sort("name") .cursor("testString") @@ -1063,7 +1066,7 @@ public void testListEnvironmentsWOptions() throws Throwable { Map query = TestUtilities.parseQueryString(request); assertNotNull(query); assertEquals(query.get("version"), "testString"); - assertEquals(Long.valueOf(query.get("page_limit")), Long.valueOf("26")); + assertEquals(Long.valueOf(query.get("page_limit")), Long.valueOf("100")); assertEquals(Boolean.valueOf(query.get("include_count")), Boolean.valueOf(false)); assertEquals(query.get("sort"), "name"); assertEquals(query.get("cursor"), "testString"); @@ -1159,6 +1162,10 @@ public void testUpdateEnvironmentWOptions() throws Throwable { .setResponseCode(200) .setBody(mockResponseBody)); + // Construct an instance of the BaseEnvironmentOrchestration model + BaseEnvironmentOrchestration baseEnvironmentOrchestrationModel = + new BaseEnvironmentOrchestration.Builder().searchSkillFallback(true).build(); + // Construct an instance of the EnvironmentSkill model EnvironmentSkill environmentSkillModel = new EnvironmentSkill.Builder() @@ -1176,6 +1183,7 @@ public void testUpdateEnvironmentWOptions() throws Throwable { .environmentId("testString") .name("testString") .description("testString") + .orchestration(baseEnvironmentOrchestrationModel) .sessionTimeout(Long.valueOf("10")) .skillReferences(java.util.Arrays.asList(environmentSkillModel)) .build(); @@ -1291,7 +1299,7 @@ public void testListReleasesWOptions() throws Throwable { ListReleasesOptions listReleasesOptionsModel = new ListReleasesOptions.Builder() .assistantId("testString") - .pageLimit(Long.valueOf("26")) + .pageLimit(Long.valueOf("100")) .includeCount(false) .sort("name") .cursor("testString") @@ -1316,7 +1324,7 @@ public void testListReleasesWOptions() throws Throwable { Map query = TestUtilities.parseQueryString(request); assertNotNull(query); assertEquals(query.get("version"), "testString"); - assertEquals(Long.valueOf(query.get("page_limit")), Long.valueOf("26")); + assertEquals(Long.valueOf(query.get("page_limit")), Long.valueOf("100")); assertEquals(Boolean.valueOf(query.get("include_count")), Boolean.valueOf(false)); assertEquals(query.get("sort"), "name"); assertEquals(query.get("cursor"), "testString"); diff --git a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/EnvironmentTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/EnvironmentTest.java index c1b336d01d..ec122a158c 100644 --- a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/EnvironmentTest.java +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/EnvironmentTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022, 2023. + * (C) Copyright IBM Corp. 2024. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -33,6 +33,7 @@ public void testEnvironment() throws Throwable { Environment environmentModel = new Environment(); assertNull(environmentModel.getName()); assertNull(environmentModel.getDescription()); + assertNull(environmentModel.getOrchestration()); assertNull(environmentModel.getSessionTimeout()); assertNull(environmentModel.getSkillReferences()); } diff --git a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/MessageInputOptionsTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/MessageInputOptionsTest.java index bc4711e928..07427175ed 100644 --- a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/MessageInputOptionsTest.java +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/MessageInputOptionsTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020, 2021. + * (C) Copyright IBM Corp. 2024. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -39,6 +39,7 @@ public void testMessageInputOptions() throws Throwable { new MessageInputOptions.Builder() .restart(false) .alternateIntents(false) + .asyncCallout(false) .spelling(messageInputOptionsSpellingModel) .debug(false) .returnContext(false) @@ -46,6 +47,7 @@ public void testMessageInputOptions() throws Throwable { .build(); assertEquals(messageInputOptionsModel.restart(), Boolean.valueOf(false)); assertEquals(messageInputOptionsModel.alternateIntents(), Boolean.valueOf(false)); + assertEquals(messageInputOptionsModel.asyncCallout(), Boolean.valueOf(false)); assertEquals(messageInputOptionsModel.spelling(), messageInputOptionsSpellingModel); assertEquals(messageInputOptionsModel.debug(), Boolean.valueOf(false)); assertEquals(messageInputOptionsModel.returnContext(), Boolean.valueOf(false)); @@ -58,6 +60,7 @@ public void testMessageInputOptions() throws Throwable { assertTrue(messageInputOptionsModelNew instanceof MessageInputOptions); assertEquals(messageInputOptionsModelNew.restart(), Boolean.valueOf(false)); assertEquals(messageInputOptionsModelNew.alternateIntents(), Boolean.valueOf(false)); + assertEquals(messageInputOptionsModelNew.asyncCallout(), Boolean.valueOf(false)); assertEquals( messageInputOptionsModelNew.spelling().toString(), messageInputOptionsSpellingModel.toString()); diff --git a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/MessageInputTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/MessageInputTest.java index caf8d9ac2e..0f82997aad 100644 --- a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/MessageInputTest.java +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/MessageInputTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020, 2023. + * (C) Copyright IBM Corp. 2024. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -163,6 +163,7 @@ public void testMessageInput() throws Throwable { new MessageInputOptions.Builder() .restart(false) .alternateIntents(false) + .asyncCallout(false) .spelling(messageInputOptionsSpellingModel) .debug(false) .returnContext(false) @@ -170,6 +171,7 @@ public void testMessageInput() throws Throwable { .build(); assertEquals(messageInputOptionsModel.restart(), Boolean.valueOf(false)); assertEquals(messageInputOptionsModel.alternateIntents(), Boolean.valueOf(false)); + assertEquals(messageInputOptionsModel.asyncCallout(), Boolean.valueOf(false)); assertEquals(messageInputOptionsModel.spelling(), messageInputOptionsSpellingModel); assertEquals(messageInputOptionsModel.debug(), Boolean.valueOf(false)); assertEquals(messageInputOptionsModel.returnContext(), Boolean.valueOf(false)); diff --git a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/MessageOptionsTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/MessageOptionsTest.java index b7c0c0dc5d..b122413daf 100644 --- a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/MessageOptionsTest.java +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/MessageOptionsTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020, 2023. + * (C) Copyright IBM Corp. 2024. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -163,6 +163,7 @@ public void testMessageOptions() throws Throwable { new MessageInputOptions.Builder() .restart(false) .alternateIntents(false) + .asyncCallout(false) .spelling(messageInputOptionsSpellingModel) .debug(false) .returnContext(false) @@ -170,6 +171,7 @@ public void testMessageOptions() throws Throwable { .build(); assertEquals(messageInputOptionsModel.restart(), Boolean.valueOf(false)); assertEquals(messageInputOptionsModel.alternateIntents(), Boolean.valueOf(false)); + assertEquals(messageInputOptionsModel.asyncCallout(), Boolean.valueOf(false)); assertEquals(messageInputOptionsModel.spelling(), messageInputOptionsSpellingModel); assertEquals(messageInputOptionsModel.debug(), Boolean.valueOf(false)); assertEquals(messageInputOptionsModel.returnContext(), Boolean.valueOf(false)); diff --git a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/UpdateEnvironmentOptionsTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/UpdateEnvironmentOptionsTest.java index 7817946ac3..a041039df4 100644 --- a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/UpdateEnvironmentOptionsTest.java +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/UpdateEnvironmentOptionsTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2023. + * (C) Copyright IBM Corp. 2024. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -30,6 +30,10 @@ public class UpdateEnvironmentOptionsTest { @Test public void testUpdateEnvironmentOptions() throws Throwable { + BaseEnvironmentOrchestration baseEnvironmentOrchestrationModel = + new BaseEnvironmentOrchestration.Builder().searchSkillFallback(true).build(); + assertEquals(baseEnvironmentOrchestrationModel.searchSkillFallback(), Boolean.valueOf(true)); + EnvironmentSkill environmentSkillModel = new EnvironmentSkill.Builder() .skillId("testString") @@ -50,6 +54,7 @@ public void testUpdateEnvironmentOptions() throws Throwable { .environmentId("testString") .name("testString") .description("testString") + .orchestration(baseEnvironmentOrchestrationModel) .sessionTimeout(Long.valueOf("10")) .skillReferences(java.util.Arrays.asList(environmentSkillModel)) .build(); @@ -57,6 +62,7 @@ public void testUpdateEnvironmentOptions() throws Throwable { assertEquals(updateEnvironmentOptionsModel.environmentId(), "testString"); assertEquals(updateEnvironmentOptionsModel.name(), "testString"); assertEquals(updateEnvironmentOptionsModel.description(), "testString"); + assertEquals(updateEnvironmentOptionsModel.orchestration(), baseEnvironmentOrchestrationModel); assertEquals(updateEnvironmentOptionsModel.sessionTimeout(), Long.valueOf("10")); assertEquals( updateEnvironmentOptionsModel.skillReferences(),