From aaf9b773317042358240fb62fd369dad69678092 Mon Sep 17 00:00:00 2001 From: repjarms Date: Tue, 7 Mar 2023 10:11:49 -0500 Subject: [PATCH] feat(assistantv2): add new assistant, environment, and skills lifecycle methods these allow greater control over actions and v2 assistants using the api and sdk BREAKING CHANGE: 'createSession' param replaced with 'requestAnalytics' param. 'language' property removed from 'Environment' model. method name changes in environment and release models. --- .../ibm/watson/assistant/v2/Assistant.java | 549 +++++++++++++++++- .../v2/model/AgentAvailabilityMessage.java | 4 +- .../watson/assistant/v2/model/Assistant.java | 192 ++++++ .../v2/model/AssistantCollection.java | 48 ++ .../assistant/v2/model/AssistantData.java | 192 ++++++ .../assistant/v2/model/AssistantSkill.java | 133 +++++ .../assistant/v2/model/AssistantState.java | 132 +++++ .../model/BaseEnvironmentOrchestration.java | 88 +++ .../BaseEnvironmentReleaseReference.java | 84 +++ .../v2/model/BulkClassifyOptions.java | 7 +- .../v2/model/BulkClassifyOutput.java | 4 +- .../v2/model/BulkClassifyResponse.java | 4 +- .../v2/model/BulkClassifyUtterance.java | 7 +- .../assistant/v2/model/CaptureGroup.java | 7 +- .../v2/model/ChannelTransferInfo.java | 4 +- .../v2/model/ChannelTransferTarget.java | 4 +- .../v2/model/ChannelTransferTargetChat.java | 4 +- .../v2/model/CreateAssistantOptions.java | 151 +++++ .../v2/model/CreateReleaseOptions.java | 142 +++++ .../v2/model/CreateSessionOptions.java | 49 +- .../v2/model/DeleteAssistantOptions.java | 105 ++++ .../v2/model/DeleteReleaseOptions.java | 134 +++++ .../v2/model/DeleteSessionOptions.java | 22 +- .../v2/model/DeleteUserDataOptions.java | 7 +- .../v2/model/DeployReleaseOptions.java | 22 +- .../assistant/v2/model/DialogLogMessage.java | 4 +- .../assistant/v2/model/DialogNodeAction.java | 4 +- ...gNodeOutputConnectToAgentTransferInfo.java | 4 +- .../model/DialogNodeOutputOptionsElement.java | 4 +- .../DialogNodeOutputOptionsElementValue.java | 4 +- .../assistant/v2/model/DialogNodeVisited.java | 4 +- .../assistant/v2/model/DialogSuggestion.java | 7 +- .../v2/model/DialogSuggestionValue.java | 7 +- .../assistant/v2/model/Environment.java | 33 +- .../v2/model/EnvironmentCollection.java | 7 +- .../v2/model/EnvironmentReference.java | 72 ++- .../assistant/v2/model/EnvironmentSkill.java | 216 +++++++ .../v2/model/ExportSkillsOptions.java | 132 +++++ .../v2/model/GetEnvironmentOptions.java | 22 +- .../assistant/v2/model/GetReleaseOptions.java | 22 +- .../assistant/v2/model/GetSkillOptions.java | 135 +++++ .../v2/model/ImportSkillsOptions.java | 213 +++++++ .../v2/model/ImportSkillsStatusOptions.java | 105 ++++ .../v2/model/IntegrationReference.java | 72 ++- .../v2/model/ListAssistantsOptions.java | 203 +++++++ .../v2/model/ListEnvironmentsOptions.java | 22 +- .../assistant/v2/model/ListLogsOptions.java | 22 +- .../v2/model/ListReleasesOptions.java | 22 +- .../ibm/watson/assistant/v2/model/Log.java | 4 +- .../assistant/v2/model/LogCollection.java | 7 +- .../v2/model/LogMessageSourceAction.java | 7 +- .../v2/model/LogMessageSourceDialogNode.java | 7 +- .../v2/model/LogMessageSourceHandler.java | 7 +- .../v2/model/LogMessageSourceStep.java | 7 +- .../assistant/v2/model/LogPagination.java | 9 +- .../assistant/v2/model/MessageContext.java | 17 +- .../v2/model/MessageContextGlobal.java | 7 +- .../model/MessageContextGlobalStateless.java | 7 +- .../v2/model/MessageContextGlobalSystem.java | 7 +- .../v2/model/MessageContextSkillAction.java | 174 ++++++ .../v2/model/MessageContextSkillDialog.java | 115 ++++ .../v2/model/MessageContextSkillSystem.java | 7 +- .../v2/model/MessageContextSkills.java | 114 ++++ .../v2/model/MessageContextStateless.java | 17 +- .../assistant/v2/model/MessageInput.java | 44 +- .../v2/model/MessageInputAttachment.java | 7 +- .../v2/model/MessageInputOptions.java | 7 +- .../v2/model/MessageInputOptionsSpelling.java | 7 +- .../model/MessageInputOptionsStateless.java | 7 +- .../v2/model/MessageInputStateless.java | 44 +- .../assistant/v2/model/MessageOptions.java | 22 +- .../assistant/v2/model/MessageOutput.java | 4 +- .../v2/model/MessageOutputDebug.java | 6 +- .../v2/model/MessageOutputDebugTurnEvent.java | 37 +- ...DebugTurnEventTurnEventActionFinished.java | 13 +- ...tDebugTurnEventTurnEventActionVisited.java | 13 +- ...eOutputDebugTurnEventTurnEventCallout.java | 23 +- ...DebugTurnEventTurnEventHandlerVisited.java | 13 +- ...putDebugTurnEventTurnEventNodeVisited.java | 13 +- ...geOutputDebugTurnEventTurnEventSearch.java | 23 +- ...utDebugTurnEventTurnEventStepAnswered.java | 12 +- ...putDebugTurnEventTurnEventStepVisited.java | 13 +- .../v2/model/MessageOutputSpelling.java | 4 +- .../assistant/v2/model/MessageRequest.java | 7 +- .../assistant/v2/model/MessageResponse.java | 4 +- .../v2/model/MessageResponseStateless.java | 4 +- .../v2/model/MessageStatelessOptions.java | 22 +- .../watson/assistant/v2/model/Pagination.java | 9 +- .../watson/assistant/v2/model/Release.java | 70 ++- .../assistant/v2/model/ReleaseCollection.java | 7 +- .../assistant/v2/model/ReleaseContent.java | 44 +- .../assistant/v2/model/ReleaseSkill.java | 160 +++++ .../assistant/v2/model/RequestAnalytics.java | 139 +++++ .../v2/model/ResponseGenericChannel.java | 4 +- .../assistant/v2/model/RuntimeEntity.java | 11 +- .../v2/model/RuntimeEntityAlternative.java | 7 +- .../v2/model/RuntimeEntityInterpretation.java | 7 +- .../assistant/v2/model/RuntimeEntityRole.java | 7 +- .../assistant/v2/model/RuntimeIntent.java | 11 +- .../v2/model/RuntimeResponseGeneric.java | 16 +- ...sponseGenericRuntimeResponseTypeAudio.java | 7 +- ...ricRuntimeResponseTypeChannelTransfer.java | 18 +- ...ericRuntimeResponseTypeConnectToAgent.java | 18 +- ...esponseGenericRuntimeResponseTypeDate.java | 7 +- ...ponseGenericRuntimeResponseTypeIframe.java | 7 +- ...sponseGenericRuntimeResponseTypeImage.java | 7 +- ...ponseGenericRuntimeResponseTypeOption.java | 4 +- ...sponseGenericRuntimeResponseTypePause.java | 7 +- ...ponseGenericRuntimeResponseTypeSearch.java | 7 +- ...eGenericRuntimeResponseTypeSuggestion.java | 7 +- ...esponseGenericRuntimeResponseTypeText.java | 7 +- ...GenericRuntimeResponseTypeUserDefined.java | 7 +- ...sponseGenericRuntimeResponseTypeVideo.java | 7 +- .../assistant/v2/model/SearchResult.java | 8 +- .../v2/model/SearchResultAnswer.java | 4 +- .../v2/model/SearchResultMetadata.java | 4 +- .../assistant/v2/model/SearchSettings.java | 161 +++++ .../v2/model/SearchSettingsDiscovery.java | 342 +++++++++++ ...SearchSettingsDiscoveryAuthentication.java | 116 ++++ .../v2/model/SearchSettingsMessages.java | 155 +++++ .../v2/model/SearchSettingsSchemaMapping.java | 155 +++++ .../v2/model/SearchSkillWarning.java | 136 +++++ .../assistant/v2/model/SessionResponse.java | 4 +- .../ibm/watson/assistant/v2/model/Skill.java | 293 ++++++++++ .../assistant/v2/model/SkillImport.java | 440 ++++++++++++++ .../v2/model/SkillsAsyncRequestStatus.java | 101 ++++ .../assistant/v2/model/SkillsExport.java | 53 ++ .../assistant/v2/model/StatusError.java | 84 +++ .../v2/model/TurnEventActionSource.java | 4 +- .../v2/model/TurnEventCalloutCallout.java | 27 +- .../v2/model/TurnEventCalloutError.java | 4 +- .../v2/model/TurnEventNodeSource.java | 4 +- .../v2/model/TurnEventSearchError.java | 4 +- .../v2/model/UpdateEnvironmentOptions.java | 260 +++++++++ .../v2/model/UpdateSkillOptions.java | 268 +++++++++ 135 files changed, 7148 insertions(+), 374 deletions(-) create mode 100644 assistant/src/main/java/com/ibm/watson/assistant/v2/model/Assistant.java create mode 100644 assistant/src/main/java/com/ibm/watson/assistant/v2/model/AssistantCollection.java create mode 100644 assistant/src/main/java/com/ibm/watson/assistant/v2/model/AssistantData.java create mode 100644 assistant/src/main/java/com/ibm/watson/assistant/v2/model/AssistantSkill.java create mode 100644 assistant/src/main/java/com/ibm/watson/assistant/v2/model/AssistantState.java create mode 100644 assistant/src/main/java/com/ibm/watson/assistant/v2/model/BaseEnvironmentOrchestration.java create mode 100644 assistant/src/main/java/com/ibm/watson/assistant/v2/model/BaseEnvironmentReleaseReference.java create mode 100644 assistant/src/main/java/com/ibm/watson/assistant/v2/model/CreateAssistantOptions.java create mode 100644 assistant/src/main/java/com/ibm/watson/assistant/v2/model/CreateReleaseOptions.java create mode 100644 assistant/src/main/java/com/ibm/watson/assistant/v2/model/DeleteAssistantOptions.java create mode 100644 assistant/src/main/java/com/ibm/watson/assistant/v2/model/DeleteReleaseOptions.java create mode 100644 assistant/src/main/java/com/ibm/watson/assistant/v2/model/EnvironmentSkill.java create mode 100644 assistant/src/main/java/com/ibm/watson/assistant/v2/model/ExportSkillsOptions.java create mode 100644 assistant/src/main/java/com/ibm/watson/assistant/v2/model/GetSkillOptions.java create mode 100644 assistant/src/main/java/com/ibm/watson/assistant/v2/model/ImportSkillsOptions.java create mode 100644 assistant/src/main/java/com/ibm/watson/assistant/v2/model/ImportSkillsStatusOptions.java create mode 100644 assistant/src/main/java/com/ibm/watson/assistant/v2/model/ListAssistantsOptions.java create mode 100644 assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageContextSkillAction.java create mode 100644 assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageContextSkillDialog.java create mode 100644 assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageContextSkills.java create mode 100644 assistant/src/main/java/com/ibm/watson/assistant/v2/model/ReleaseSkill.java create mode 100644 assistant/src/main/java/com/ibm/watson/assistant/v2/model/RequestAnalytics.java create mode 100644 assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchSettings.java create mode 100644 assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchSettingsDiscovery.java create mode 100644 assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchSettingsDiscoveryAuthentication.java create mode 100644 assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchSettingsMessages.java create mode 100644 assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchSettingsSchemaMapping.java create mode 100644 assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchSkillWarning.java create mode 100644 assistant/src/main/java/com/ibm/watson/assistant/v2/model/Skill.java create mode 100644 assistant/src/main/java/com/ibm/watson/assistant/v2/model/SkillImport.java create mode 100644 assistant/src/main/java/com/ibm/watson/assistant/v2/model/SkillsAsyncRequestStatus.java create mode 100644 assistant/src/main/java/com/ibm/watson/assistant/v2/model/SkillsExport.java create mode 100644 assistant/src/main/java/com/ibm/watson/assistant/v2/model/StatusError.java create mode 100644 assistant/src/main/java/com/ibm/watson/assistant/v2/model/UpdateEnvironmentOptions.java create mode 100644 assistant/src/main/java/com/ibm/watson/assistant/v2/model/UpdateSkillOptions.java 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 b1e44e1aad6..517e3943f76 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, 2022. + * (C) Copyright IBM Corp. 2023. * * 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.53.0-9710cac3-20220713-193508 + * IBM OpenAPI SDK Code Generator Version: 3.64.1-cee95189-20230124-211647 */ package com.ibm.watson.assistant.v2; @@ -25,16 +25,27 @@ import com.ibm.cloud.sdk.core.security.ConfigBasedAuthenticatorFactory; import com.ibm.cloud.sdk.core.service.BaseService; import com.ibm.cloud.sdk.core.util.ResponseConverterUtils; +import com.ibm.watson.assistant.v2.model.AssistantCollection; +import com.ibm.watson.assistant.v2.model.AssistantData; import com.ibm.watson.assistant.v2.model.BulkClassifyOptions; import com.ibm.watson.assistant.v2.model.BulkClassifyResponse; +import com.ibm.watson.assistant.v2.model.CreateAssistantOptions; +import com.ibm.watson.assistant.v2.model.CreateReleaseOptions; import com.ibm.watson.assistant.v2.model.CreateSessionOptions; +import com.ibm.watson.assistant.v2.model.DeleteAssistantOptions; +import com.ibm.watson.assistant.v2.model.DeleteReleaseOptions; import com.ibm.watson.assistant.v2.model.DeleteSessionOptions; import com.ibm.watson.assistant.v2.model.DeleteUserDataOptions; import com.ibm.watson.assistant.v2.model.DeployReleaseOptions; import com.ibm.watson.assistant.v2.model.Environment; import com.ibm.watson.assistant.v2.model.EnvironmentCollection; +import com.ibm.watson.assistant.v2.model.ExportSkillsOptions; import com.ibm.watson.assistant.v2.model.GetEnvironmentOptions; import com.ibm.watson.assistant.v2.model.GetReleaseOptions; +import com.ibm.watson.assistant.v2.model.GetSkillOptions; +import com.ibm.watson.assistant.v2.model.ImportSkillsOptions; +import com.ibm.watson.assistant.v2.model.ImportSkillsStatusOptions; +import com.ibm.watson.assistant.v2.model.ListAssistantsOptions; import com.ibm.watson.assistant.v2.model.ListEnvironmentsOptions; import com.ibm.watson.assistant.v2.model.ListLogsOptions; import com.ibm.watson.assistant.v2.model.ListReleasesOptions; @@ -46,6 +57,11 @@ import com.ibm.watson.assistant.v2.model.Release; import com.ibm.watson.assistant.v2.model.ReleaseCollection; import com.ibm.watson.assistant.v2.model.SessionResponse; +import com.ibm.watson.assistant.v2.model.Skill; +import com.ibm.watson.assistant.v2.model.SkillsAsyncRequestStatus; +import com.ibm.watson.assistant.v2.model.SkillsExport; +import com.ibm.watson.assistant.v2.model.UpdateEnvironmentOptions; +import com.ibm.watson.assistant.v2.model.UpdateSkillOptions; import com.ibm.watson.common.SdkCommon; import java.util.HashMap; import java.util.Map; @@ -63,8 +79,10 @@ */ public class Assistant extends BaseService { - public static final String DEFAULT_SERVICE_NAME = "assistant"; + /** Default service name used when configuring the `Assistant` client. */ + public static final String DEFAULT_SERVICE_NAME = "conversation"; + /** Default service endpoint URL. */ public static final String DEFAULT_SERVICE_URL = "https://api.us-south.assistant.watson.cloud.ibm.com"; @@ -146,6 +164,154 @@ public void setVersion(final String version) { this.version = version; } + /** + * Create an assistant. + * + *

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} + */ + public ServiceCall createAssistant(CreateAssistantOptions createAssistantOptions) { + boolean skipBody = false; + if (createAssistantOptions == null) { + createAssistantOptions = new CreateAssistantOptions.Builder().build(); + skipBody = true; + } + RequestBuilder builder = + RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v2/assistants")); + Map sdkHeaders = + SdkCommon.getSdkHeaders("conversation", "v2", "createAssistant"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + builder.query("version", String.valueOf(this.version)); + if (!skipBody) { + final JsonObject contentJson = new JsonObject(); + if (createAssistantOptions.name() != null) { + contentJson.addProperty("name", createAssistantOptions.name()); + } + if (createAssistantOptions.description() != null) { + contentJson.addProperty("description", createAssistantOptions.description()); + } + if (createAssistantOptions.language() != null) { + contentJson.addProperty("language", createAssistantOptions.language()); + } + builder.bodyJson(contentJson); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue( + new com.google.gson.reflect.TypeToken() {}.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Create an assistant. + * + *

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() { + return createAssistant(null); + } + + /** + * List assistants. + * + *

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

This method is available only with Enterprise plans. + * + * @param listAssistantsOptions the {@link ListAssistantsOptions} containing the options for the + * call + * @return a {@link ServiceCall} with a result of type {@link AssistantCollection} + */ + public ServiceCall listAssistants( + ListAssistantsOptions listAssistantsOptions) { + if (listAssistantsOptions == null) { + listAssistantsOptions = new ListAssistantsOptions.Builder().build(); + } + RequestBuilder builder = + RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v2/assistants")); + Map sdkHeaders = + SdkCommon.getSdkHeaders("conversation", "v2", "listAssistants"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + builder.query("version", String.valueOf(this.version)); + if (listAssistantsOptions.pageLimit() != null) { + builder.query("page_limit", String.valueOf(listAssistantsOptions.pageLimit())); + } + if (listAssistantsOptions.includeCount() != null) { + builder.query("include_count", String.valueOf(listAssistantsOptions.includeCount())); + } + if (listAssistantsOptions.sort() != null) { + builder.query("sort", String.valueOf(listAssistantsOptions.sort())); + } + if (listAssistantsOptions.cursor() != null) { + builder.query("cursor", String.valueOf(listAssistantsOptions.cursor())); + } + if (listAssistantsOptions.includeAudit() != null) { + builder.query("include_audit", String.valueOf(listAssistantsOptions.includeAudit())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue( + new com.google.gson.reflect.TypeToken() {}.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * List assistants. + * + *

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

This method is available only with Enterprise plans. + * + * @return a {@link ServiceCall} with a result of type {@link AssistantCollection} + */ + public ServiceCall listAssistants() { + return listAssistants(null); + } + + /** + * Delete assistant. + * + *

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 + */ + public ServiceCall deleteAssistant(DeleteAssistantOptions deleteAssistantOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull( + deleteAssistantOptions, "deleteAssistantOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("assistant_id", deleteAssistantOptions.assistantId()); + RequestBuilder builder = + RequestBuilder.delete( + RequestBuilder.resolveRequestUrl( + getServiceUrl(), "/v2/assistants/{assistant_id}", pathParamsMap)); + Map sdkHeaders = + SdkCommon.getSdkHeaders("conversation", "v2", "deleteAssistant"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + builder.query("version", String.valueOf(this.version)); + ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); + return createServiceCall(builder.build(), responseConverter); + } + /** * Create a session. * @@ -174,6 +340,12 @@ public ServiceCall createSession(CreateSessionOptions createSes builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); final JsonObject contentJson = new JsonObject(); + if (createSessionOptions.analytics() != null) { + contentJson.add( + "analytics", + com.ibm.cloud.sdk.core.util.GsonSingleton.getGson() + .toJsonTree(createSessionOptions.analytics())); + } builder.bodyJson(contentJson); ResponseConverter responseConverter = ResponseConverterUtils.getValue( @@ -355,7 +527,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 Enterprise plans. + *

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

**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** @@ -440,6 +612,8 @@ 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} @@ -488,6 +662,8 @@ 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} @@ -520,11 +696,107 @@ public ServiceCall getEnvironment(GetEnvironmentOptions getEnvironm return createServiceCall(builder.build(), responseConverter); } + /** + * Update environment. + * + *

Update an environment with new or modified data. 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 updateEnvironmentOptions the {@link UpdateEnvironmentOptions} containing the options for + * the call + * @return a {@link ServiceCall} with a result of type {@link Environment} + */ + public ServiceCall updateEnvironment( + UpdateEnvironmentOptions updateEnvironmentOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull( + updateEnvironmentOptions, "updateEnvironmentOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("assistant_id", updateEnvironmentOptions.assistantId()); + pathParamsMap.put("environment_id", updateEnvironmentOptions.environmentId()); + RequestBuilder builder = + RequestBuilder.post( + RequestBuilder.resolveRequestUrl( + getServiceUrl(), + "/v2/assistants/{assistant_id}/environments/{environment_id}", + pathParamsMap)); + Map sdkHeaders = + SdkCommon.getSdkHeaders("conversation", "v2", "updateEnvironment"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + builder.query("version", String.valueOf(this.version)); + final JsonObject contentJson = new JsonObject(); + if (updateEnvironmentOptions.name() != null) { + contentJson.addProperty("name", updateEnvironmentOptions.name()); + } + if (updateEnvironmentOptions.description() != null) { + contentJson.addProperty("description", updateEnvironmentOptions.description()); + } + if (updateEnvironmentOptions.sessionTimeout() != null) { + contentJson.addProperty("session_timeout", updateEnvironmentOptions.sessionTimeout()); + } + if (updateEnvironmentOptions.skillReferences() != null) { + contentJson.add( + "skill_references", + com.ibm.cloud.sdk.core.util.GsonSingleton.getGson() + .toJsonTree(updateEnvironmentOptions.skillReferences())); + } + builder.bodyJson(contentJson); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue( + new com.google.gson.reflect.TypeToken() {}.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * 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. + * + * @param createReleaseOptions the {@link CreateReleaseOptions} containing the options for the + * call + * @return a {@link ServiceCall} with a result of type {@link Release} + */ + public ServiceCall createRelease(CreateReleaseOptions createReleaseOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull( + createReleaseOptions, "createReleaseOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("assistant_id", createReleaseOptions.assistantId()); + RequestBuilder builder = + RequestBuilder.post( + RequestBuilder.resolveRequestUrl( + getServiceUrl(), "/v2/assistants/{assistant_id}/releases", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("conversation", "v2", "createRelease"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + builder.query("version", String.valueOf(this.version)); + final JsonObject contentJson = new JsonObject(); + if (createReleaseOptions.description() != null) { + contentJson.addProperty("description", createReleaseOptions.description()); + } + builder.bodyJson(contentJson); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue( + new com.google.gson.reflect.TypeToken() {}.getType()); + return createServiceCall(builder.build(), responseConverter); + } + /** * List releases. * *

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

This method is available only with Enterprise plans. * * @param listReleasesOptions the {@link ListReleasesOptions} containing the options for the call * @return a {@link ServiceCall} with a result of type {@link ReleaseCollection} @@ -575,6 +847,8 @@ 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} */ @@ -605,12 +879,47 @@ public ServiceCall getRelease(GetReleaseOptions getReleaseOptions) { return createServiceCall(builder.build(), responseConverter); } + /** + * 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. + * + * @param deleteReleaseOptions the {@link DeleteReleaseOptions} containing the options for the + * call + * @return a {@link ServiceCall} with a void result + */ + public ServiceCall deleteRelease(DeleteReleaseOptions deleteReleaseOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull( + deleteReleaseOptions, "deleteReleaseOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("assistant_id", deleteReleaseOptions.assistantId()); + pathParamsMap.put("release", deleteReleaseOptions.release()); + RequestBuilder builder = + RequestBuilder.delete( + RequestBuilder.resolveRequestUrl( + getServiceUrl(), + "/v2/assistants/{assistant_id}/releases/{release}", + pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("conversation", "v2", "deleteRelease"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + builder.query("version", String.valueOf(this.version)); + ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); + return createServiceCall(builder.build(), responseConverter); + } + /** * Deploy release. * *

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} @@ -644,4 +953,234 @@ public ServiceCall deployRelease(DeployReleaseOptions deployRelease new com.google.gson.reflect.TypeToken() {}.getType()); return createServiceCall(builder.build(), responseConverter); } + + /** + * Get skill. + * + *

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} + */ + public ServiceCall getSkill(GetSkillOptions getSkillOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull( + getSkillOptions, "getSkillOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("assistant_id", getSkillOptions.assistantId()); + pathParamsMap.put("skill_id", getSkillOptions.skillId()); + RequestBuilder builder = + RequestBuilder.get( + RequestBuilder.resolveRequestUrl( + getServiceUrl(), "/v2/assistants/{assistant_id}/skills/{skill_id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("conversation", "v2", "getSkill"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + builder.query("version", String.valueOf(this.version)); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue( + new com.google.gson.reflect.TypeToken() {}.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Update skill. + * + *

Update a skill with new or modified data. + * + *

**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} + */ + public ServiceCall updateSkill(UpdateSkillOptions updateSkillOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull( + updateSkillOptions, "updateSkillOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("assistant_id", updateSkillOptions.assistantId()); + pathParamsMap.put("skill_id", updateSkillOptions.skillId()); + RequestBuilder builder = + RequestBuilder.post( + RequestBuilder.resolveRequestUrl( + getServiceUrl(), "/v2/assistants/{assistant_id}/skills/{skill_id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("conversation", "v2", "updateSkill"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + builder.query("version", String.valueOf(this.version)); + final JsonObject contentJson = new JsonObject(); + if (updateSkillOptions.name() != null) { + contentJson.addProperty("name", updateSkillOptions.name()); + } + if (updateSkillOptions.description() != null) { + contentJson.addProperty("description", updateSkillOptions.description()); + } + if (updateSkillOptions.workspace() != null) { + contentJson.add( + "workspace", + com.ibm.cloud.sdk.core.util.GsonSingleton.getGson() + .toJsonTree(updateSkillOptions.workspace())); + } + if (updateSkillOptions.dialogSettings() != null) { + contentJson.add( + "dialog_settings", + com.ibm.cloud.sdk.core.util.GsonSingleton.getGson() + .toJsonTree(updateSkillOptions.dialogSettings())); + } + if (updateSkillOptions.searchSettings() != null) { + contentJson.add( + "search_settings", + com.ibm.cloud.sdk.core.util.GsonSingleton.getGson() + .toJsonTree(updateSkillOptions.searchSettings())); + } + builder.bodyJson(contentJson); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue( + new com.google.gson.reflect.TypeToken() {}.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Export skills. + * + *

Asynchronously export the action skill and dialog skill (if enabled) for the assistant. Use + * this method to save all skill data so that you can import it to a different assistant using the + * **Import skills** method. + * + *

A successful call to this method only initiates an asynchronous export. The exported JSON + * data is not available until processing completes. + * + *

After the initial request is submitted, you can poll the status of the operation by calling + * the same request again and checking the value of the **status** property. If an error occurs + * (indicated by a **status** value of `Failed`), the `status_description` property provides more + * information about the error, and the `status_errors` property contains an array of error + * messages that caused the failure. + * + *

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} + */ + public ServiceCall exportSkills(ExportSkillsOptions exportSkillsOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull( + exportSkillsOptions, "exportSkillsOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("assistant_id", exportSkillsOptions.assistantId()); + RequestBuilder builder = + RequestBuilder.get( + RequestBuilder.resolveRequestUrl( + getServiceUrl(), "/v2/assistants/{assistant_id}/skills_export", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("conversation", "v2", "exportSkills"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + builder.query("version", String.valueOf(this.version)); + if (exportSkillsOptions.includeAudit() != null) { + builder.query("include_audit", String.valueOf(exportSkillsOptions.includeAudit())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue( + new com.google.gson.reflect.TypeToken() {}.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Import skills. + * + *

Asynchronously import skills into an existing assistant from a previously exported file. + * + *

The request body for this method should contain the response data that was received from a + * previous call to the **Export skills** method, without modification. + * + *

A successful call to this method initiates an asynchronous import. The updated skills + * 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} + */ + public ServiceCall importSkills( + ImportSkillsOptions importSkillsOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull( + importSkillsOptions, "importSkillsOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("assistant_id", importSkillsOptions.assistantId()); + RequestBuilder builder = + RequestBuilder.post( + RequestBuilder.resolveRequestUrl( + getServiceUrl(), "/v2/assistants/{assistant_id}/skills_import", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("conversation", "v2", "importSkills"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + builder.query("version", String.valueOf(this.version)); + if (importSkillsOptions.includeAudit() != null) { + builder.query("include_audit", String.valueOf(importSkillsOptions.includeAudit())); + } + final JsonObject contentJson = new JsonObject(); + contentJson.add( + "assistant_skills", + com.ibm.cloud.sdk.core.util.GsonSingleton.getGson() + .toJsonTree(importSkillsOptions.assistantSkills())); + contentJson.add( + "assistant_state", + com.ibm.cloud.sdk.core.util.GsonSingleton.getGson() + .toJsonTree(importSkillsOptions.assistantState())); + builder.bodyJson(contentJson); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue( + new com.google.gson.reflect.TypeToken() {}.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Get status of skills import. + * + *

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} + */ + public ServiceCall importSkillsStatus( + ImportSkillsStatusOptions importSkillsStatusOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull( + importSkillsStatusOptions, "importSkillsStatusOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("assistant_id", importSkillsStatusOptions.assistantId()); + RequestBuilder builder = + RequestBuilder.get( + RequestBuilder.resolveRequestUrl( + getServiceUrl(), + "/v2/assistants/{assistant_id}/skills_import/status", + pathParamsMap)); + Map sdkHeaders = + SdkCommon.getSdkHeaders("conversation", "v2", "importSkillsStatus"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + builder.query("version", String.valueOf(this.version)); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue( + new com.google.gson.reflect.TypeToken() {}.getType()); + return createServiceCall(builder.build(), responseConverter); + } } diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/AgentAvailabilityMessage.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/AgentAvailabilityMessage.java index 5c4a9d2a5c6..e804a3f4427 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/AgentAvailabilityMessage.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/AgentAvailabilityMessage.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -19,6 +19,8 @@ public class AgentAvailabilityMessage extends GenericModel { protected String message; + protected AgentAvailabilityMessage() {} + /** * Gets the message. * diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/Assistant.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/Assistant.java new file mode 100644 index 00000000000..2166e07b741 --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/Assistant.java @@ -0,0 +1,192 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.watson.assistant.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; +import java.util.List; + +/** Assistant. */ +public class Assistant extends GenericModel { + + @SerializedName("assistant_id") + protected String assistantId; + + protected String name; + protected String description; + protected String language; + + @SerializedName("assistant_skills") + protected List assistantSkills; + + @SerializedName("assistant_environments") + protected List assistantEnvironments; + + /** Builder. */ + public static class Builder { + private String name; + private String description; + private String language; + + /** + * Instantiates a new Builder from an existing Assistant instance. + * + * @param assistant the instance to initialize the Builder with + */ + private Builder(Assistant assistant) { + this.name = assistant.name; + this.description = assistant.description; + this.language = assistant.language; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Instantiates a new builder with required properties. + * + * @param language the language + */ + public Builder(String language) { + this.language = language; + } + + /** + * Builds a Assistant. + * + * @return the new Assistant instance + */ + public Assistant build() { + return new Assistant(this); + } + + /** + * Set the name. + * + * @param name the name + * @return the Assistant builder + */ + public Builder name(String name) { + this.name = name; + return this; + } + + /** + * Set the description. + * + * @param description the description + * @return the Assistant builder + */ + public Builder description(String description) { + this.description = description; + return this; + } + + /** + * Set the language. + * + * @param language the language + * @return the Assistant builder + */ + public Builder language(String language) { + this.language = language; + return this; + } + } + + protected Assistant() {} + + protected Assistant(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.language, "language cannot be null"); + name = builder.name; + description = builder.description; + language = builder.language; + } + + /** + * New builder. + * + * @return a Assistant builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the assistantId. + * + *

The unique identifier of the assistant. + * + * @return the assistantId + */ + public String assistantId() { + return assistantId; + } + + /** + * Gets the name. + * + *

The name of the assistant. This string cannot contain carriage return, newline, or tab + * characters. + * + * @return the name + */ + public String name() { + return name; + } + + /** + * Gets the description. + * + *

The description of the assistant. This string cannot contain carriage return, newline, or + * tab characters. + * + * @return the description + */ + public String description() { + return description; + } + + /** + * Gets the language. + * + *

The language of the assistant. + * + * @return the language + */ + public String language() { + return language; + } + + /** + * Gets the assistantSkills. + * + *

An array of skill references identifying the skills associated with the assistant. + * + * @return the assistantSkills + */ + public List assistantSkills() { + return assistantSkills; + } + + /** + * Gets the assistantEnvironments. + * + *

An array of objects describing the environments defined for the assistant. + * + * @return the assistantEnvironments + */ + public List assistantEnvironments() { + return assistantEnvironments; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/AssistantCollection.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/AssistantCollection.java new file mode 100644 index 00000000000..fd5a139ce80 --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/AssistantCollection.java @@ -0,0 +1,48 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.watson.assistant.v2.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; +import java.util.List; + +/** AssistantCollection. */ +public class AssistantCollection extends GenericModel { + + protected List assistants; + protected Pagination pagination; + + protected AssistantCollection() {} + + /** + * Gets the assistants. + * + *

An array of objects describing the assistants associated with the instance. + * + * @return the assistants + */ + public List getAssistants() { + return assistants; + } + + /** + * Gets the pagination. + * + *

The pagination data for the returned objects. For more information about using pagination, + * see [Pagination](#pagination). + * + * @return the pagination + */ + public Pagination getPagination() { + return pagination; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/AssistantData.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/AssistantData.java new file mode 100644 index 00000000000..9ecad740d0f --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/AssistantData.java @@ -0,0 +1,192 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.watson.assistant.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; +import java.util.List; + +/** AssistantData. */ +public class AssistantData extends GenericModel { + + @SerializedName("assistant_id") + protected String assistantId; + + protected String name; + protected String description; + protected String language; + + @SerializedName("assistant_skills") + protected List assistantSkills; + + @SerializedName("assistant_environments") + protected List assistantEnvironments; + + /** Builder. */ + public static class Builder { + private String name; + private String description; + private String language; + + /** + * Instantiates a new Builder from an existing AssistantData instance. + * + * @param assistantData the instance to initialize the Builder with + */ + private Builder(AssistantData assistantData) { + this.name = assistantData.name; + this.description = assistantData.description; + this.language = assistantData.language; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Instantiates a new builder with required properties. + * + * @param language the language + */ + public Builder(String language) { + this.language = language; + } + + /** + * Builds a AssistantData. + * + * @return the new AssistantData instance + */ + public AssistantData build() { + return new AssistantData(this); + } + + /** + * Set the name. + * + * @param name the name + * @return the AssistantData builder + */ + public Builder name(String name) { + this.name = name; + return this; + } + + /** + * Set the description. + * + * @param description the description + * @return the AssistantData builder + */ + public Builder description(String description) { + this.description = description; + return this; + } + + /** + * Set the language. + * + * @param language the language + * @return the AssistantData builder + */ + public Builder language(String language) { + this.language = language; + return this; + } + } + + protected AssistantData() {} + + protected AssistantData(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.language, "language cannot be null"); + name = builder.name; + description = builder.description; + language = builder.language; + } + + /** + * New builder. + * + * @return a AssistantData builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the assistantId. + * + *

The unique identifier of the assistant. + * + * @return the assistantId + */ + public String assistantId() { + return assistantId; + } + + /** + * Gets the name. + * + *

The name of the assistant. This string cannot contain carriage return, newline, or tab + * characters. + * + * @return the name + */ + public String name() { + return name; + } + + /** + * Gets the description. + * + *

The description of the assistant. This string cannot contain carriage return, newline, or + * tab characters. + * + * @return the description + */ + public String description() { + return description; + } + + /** + * Gets the language. + * + *

The language of the assistant. + * + * @return the language + */ + public String language() { + return language; + } + + /** + * Gets the assistantSkills. + * + *

An array of skill references identifying the skills associated with the assistant. + * + * @return the assistantSkills + */ + public List assistantSkills() { + return assistantSkills; + } + + /** + * Gets the assistantEnvironments. + * + *

An array of objects describing the environments defined for the assistant. + * + * @return the assistantEnvironments + */ + public List assistantEnvironments() { + return assistantEnvironments; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/AssistantSkill.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/AssistantSkill.java new file mode 100644 index 00000000000..f44bf9a1f11 --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/AssistantSkill.java @@ -0,0 +1,133 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.watson.assistant.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** AssistantSkill. */ +public class AssistantSkill extends GenericModel { + + /** The type of the skill. */ + public interface Type { + /** dialog. */ + String DIALOG = "dialog"; + /** action. */ + String ACTION = "action"; + /** search. */ + String SEARCH = "search"; + } + + @SerializedName("skill_id") + protected String skillId; + + protected String type; + + /** Builder. */ + public static class Builder { + private String skillId; + private String type; + + /** + * Instantiates a new Builder from an existing AssistantSkill instance. + * + * @param assistantSkill the instance to initialize the Builder with + */ + private Builder(AssistantSkill assistantSkill) { + this.skillId = assistantSkill.skillId; + this.type = assistantSkill.type; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Instantiates a new builder with required properties. + * + * @param skillId the skillId + */ + public Builder(String skillId) { + this.skillId = skillId; + } + + /** + * Builds a AssistantSkill. + * + * @return the new AssistantSkill instance + */ + public AssistantSkill build() { + return new AssistantSkill(this); + } + + /** + * Set the skillId. + * + * @param skillId the skillId + * @return the AssistantSkill builder + */ + public Builder skillId(String skillId) { + this.skillId = skillId; + return this; + } + + /** + * Set the type. + * + * @param type the type + * @return the AssistantSkill builder + */ + public Builder type(String type) { + this.type = type; + return this; + } + } + + protected AssistantSkill() {} + + protected AssistantSkill(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.skillId, "skillId cannot be null"); + skillId = builder.skillId; + type = builder.type; + } + + /** + * New builder. + * + * @return a AssistantSkill builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the skillId. + * + *

The skill ID of the skill. + * + * @return the skillId + */ + public String skillId() { + return skillId; + } + + /** + * Gets the type. + * + *

The type of the skill. + * + * @return the type + */ + public String type() { + return type; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/AssistantState.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/AssistantState.java new file mode 100644 index 00000000000..5f5b8e07924 --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/AssistantState.java @@ -0,0 +1,132 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.watson.assistant.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * Status information about the skills for the assistant. Included in responses only if + * **status**=`Available`. + */ +public class AssistantState extends GenericModel { + + @SerializedName("action_disabled") + protected Boolean actionDisabled; + + @SerializedName("dialog_disabled") + protected Boolean dialogDisabled; + + /** Builder. */ + public static class Builder { + private Boolean actionDisabled; + private Boolean dialogDisabled; + + /** + * Instantiates a new Builder from an existing AssistantState instance. + * + * @param assistantState the instance to initialize the Builder with + */ + private Builder(AssistantState assistantState) { + this.actionDisabled = assistantState.actionDisabled; + this.dialogDisabled = assistantState.dialogDisabled; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Instantiates a new builder with required properties. + * + * @param actionDisabled the actionDisabled + * @param dialogDisabled the dialogDisabled + */ + public Builder(Boolean actionDisabled, Boolean dialogDisabled) { + this.actionDisabled = actionDisabled; + this.dialogDisabled = dialogDisabled; + } + + /** + * Builds a AssistantState. + * + * @return the new AssistantState instance + */ + public AssistantState build() { + return new AssistantState(this); + } + + /** + * Set the actionDisabled. + * + * @param actionDisabled the actionDisabled + * @return the AssistantState builder + */ + public Builder actionDisabled(Boolean actionDisabled) { + this.actionDisabled = actionDisabled; + return this; + } + + /** + * Set the dialogDisabled. + * + * @param dialogDisabled the dialogDisabled + * @return the AssistantState builder + */ + public Builder dialogDisabled(Boolean dialogDisabled) { + this.dialogDisabled = dialogDisabled; + return this; + } + } + + protected AssistantState() {} + + protected AssistantState(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull( + builder.actionDisabled, "actionDisabled cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull( + builder.dialogDisabled, "dialogDisabled cannot be null"); + actionDisabled = builder.actionDisabled; + dialogDisabled = builder.dialogDisabled; + } + + /** + * New builder. + * + * @return a AssistantState builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the actionDisabled. + * + *

Whether the action skill is disabled in the draft environment. + * + * @return the actionDisabled + */ + public Boolean actionDisabled() { + return actionDisabled; + } + + /** + * Gets the dialogDisabled. + * + *

Whether the dialog skill is disabled in the draft environment. + * + * @return the dialogDisabled + */ + public Boolean dialogDisabled() { + return dialogDisabled; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/BaseEnvironmentOrchestration.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/BaseEnvironmentOrchestration.java new file mode 100644 index 00000000000..bd82f09d7d4 --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/BaseEnvironmentOrchestration.java @@ -0,0 +1,88 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.watson.assistant.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** The search skill orchestration settings for the environment. */ +public class BaseEnvironmentOrchestration extends GenericModel { + + @SerializedName("search_skill_fallback") + protected Boolean searchSkillFallback; + + /** Builder. */ + public static class Builder { + private Boolean searchSkillFallback; + + /** + * Instantiates a new Builder from an existing BaseEnvironmentOrchestration instance. + * + * @param baseEnvironmentOrchestration the instance to initialize the Builder with + */ + private Builder(BaseEnvironmentOrchestration baseEnvironmentOrchestration) { + this.searchSkillFallback = baseEnvironmentOrchestration.searchSkillFallback; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Builds a BaseEnvironmentOrchestration. + * + * @return the new BaseEnvironmentOrchestration instance + */ + public BaseEnvironmentOrchestration build() { + return new BaseEnvironmentOrchestration(this); + } + + /** + * Set the searchSkillFallback. + * + * @param searchSkillFallback the searchSkillFallback + * @return the BaseEnvironmentOrchestration builder + */ + public Builder searchSkillFallback(Boolean searchSkillFallback) { + this.searchSkillFallback = searchSkillFallback; + return this; + } + } + + protected BaseEnvironmentOrchestration() {} + + protected BaseEnvironmentOrchestration(Builder builder) { + searchSkillFallback = builder.searchSkillFallback; + } + + /** + * New builder. + * + * @return a BaseEnvironmentOrchestration builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the searchSkillFallback. + * + *

Whether assistants deployed to the environment fall back to a search skill when responding + * to messages that do not match any intent. If no search skill is configured for the assistant, + * this property is ignored. + * + * @return the searchSkillFallback + */ + public Boolean searchSkillFallback() { + return searchSkillFallback; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/BaseEnvironmentReleaseReference.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/BaseEnvironmentReleaseReference.java new file mode 100644 index 00000000000..275437d5770 --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/BaseEnvironmentReleaseReference.java @@ -0,0 +1,84 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.watson.assistant.v2.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** An object describing the release that is currently deployed in the environment. */ +public class BaseEnvironmentReleaseReference extends GenericModel { + + protected String release; + + /** Builder. */ + public static class Builder { + private String release; + + /** + * Instantiates a new Builder from an existing BaseEnvironmentReleaseReference instance. + * + * @param baseEnvironmentReleaseReference the instance to initialize the Builder with + */ + private Builder(BaseEnvironmentReleaseReference baseEnvironmentReleaseReference) { + this.release = baseEnvironmentReleaseReference.release; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Builds a BaseEnvironmentReleaseReference. + * + * @return the new BaseEnvironmentReleaseReference instance + */ + public BaseEnvironmentReleaseReference build() { + return new BaseEnvironmentReleaseReference(this); + } + + /** + * Set the release. + * + * @param release the release + * @return the BaseEnvironmentReleaseReference builder + */ + public Builder release(String release) { + this.release = release; + return this; + } + } + + protected BaseEnvironmentReleaseReference() {} + + protected BaseEnvironmentReleaseReference(Builder builder) { + release = builder.release; + } + + /** + * New builder. + * + * @return a BaseEnvironmentReleaseReference builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the release. + * + *

The name of the deployed release. + * + * @return the release + */ + public String release() { + return release; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/BulkClassifyOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/BulkClassifyOptions.java index 1119c708694..78b9e5856ff 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/BulkClassifyOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/BulkClassifyOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020, 2022. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -27,6 +27,11 @@ public static class Builder { private String skillId; private List input; + /** + * Instantiates a new Builder from an existing BulkClassifyOptions instance. + * + * @param bulkClassifyOptions the instance to initialize the Builder with + */ private Builder(BulkClassifyOptions bulkClassifyOptions) { this.skillId = bulkClassifyOptions.skillId; this.input = bulkClassifyOptions.input; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/BulkClassifyOutput.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/BulkClassifyOutput.java index ea1cce98902..aacbb002655 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/BulkClassifyOutput.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/BulkClassifyOutput.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -22,6 +22,8 @@ public class BulkClassifyOutput extends GenericModel { protected List entities; protected List intents; + protected BulkClassifyOutput() {} + /** * Gets the input. * diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/BulkClassifyResponse.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/BulkClassifyResponse.java index 3decf640901..3ede1496bb6 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/BulkClassifyResponse.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/BulkClassifyResponse.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -20,6 +20,8 @@ public class BulkClassifyResponse extends GenericModel { protected List output; + protected BulkClassifyResponse() {} + /** * Gets the output. * diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/BulkClassifyUtterance.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/BulkClassifyUtterance.java index d9db9193f57..407fa94b830 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/BulkClassifyUtterance.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/BulkClassifyUtterance.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020, 2022. + * (C) Copyright IBM Corp. 2023. * * 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,11 @@ public class BulkClassifyUtterance extends GenericModel { public static class Builder { private String text; + /** + * Instantiates a new Builder from an existing BulkClassifyUtterance instance. + * + * @param bulkClassifyUtterance the instance to initialize the Builder with + */ private Builder(BulkClassifyUtterance bulkClassifyUtterance) { this.text = bulkClassifyUtterance.text; } diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/CaptureGroup.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/CaptureGroup.java index e3458ff320e..25944487911 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/CaptureGroup.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/CaptureGroup.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2022. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -27,6 +27,11 @@ public static class Builder { private String group; private List location; + /** + * Instantiates a new Builder from an existing CaptureGroup instance. + * + * @param captureGroup the instance to initialize the Builder with + */ private Builder(CaptureGroup captureGroup) { this.group = captureGroup.group; this.location = captureGroup.location; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ChannelTransferInfo.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ChannelTransferInfo.java index 245352faad2..41db6fa6930 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ChannelTransferInfo.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ChannelTransferInfo.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -19,6 +19,8 @@ public class ChannelTransferInfo extends GenericModel { protected ChannelTransferTarget target; + protected ChannelTransferInfo() {} + /** * Gets the target. * diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ChannelTransferTarget.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ChannelTransferTarget.java index d8783fd95fa..0502d3a1434 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ChannelTransferTarget.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ChannelTransferTarget.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2023. * * 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,8 @@ public class ChannelTransferTarget extends GenericModel { protected ChannelTransferTargetChat chat; + protected ChannelTransferTarget() {} + /** * Gets the chat. * diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ChannelTransferTargetChat.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ChannelTransferTargetChat.java index a71d05875d3..b326e27b1dc 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ChannelTransferTargetChat.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ChannelTransferTargetChat.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -19,6 +19,8 @@ public class ChannelTransferTargetChat extends GenericModel { protected String url; + protected ChannelTransferTargetChat() {} + /** * Gets the url. * diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/CreateAssistantOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/CreateAssistantOptions.java new file mode 100644 index 00000000000..e3858f4eb9f --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/CreateAssistantOptions.java @@ -0,0 +1,151 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.watson.assistant.v2.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** The createAssistant options. */ +public class CreateAssistantOptions extends GenericModel { + + protected String name; + protected String description; + protected String language; + + /** Builder. */ + public static class Builder { + private String name; + private String description; + private String language; + + /** + * Instantiates a new Builder from an existing CreateAssistantOptions instance. + * + * @param createAssistantOptions the instance to initialize the Builder with + */ + private Builder(CreateAssistantOptions createAssistantOptions) { + this.name = createAssistantOptions.name; + this.description = createAssistantOptions.description; + this.language = createAssistantOptions.language; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Builds a CreateAssistantOptions. + * + * @return the new CreateAssistantOptions instance + */ + public CreateAssistantOptions build() { + return new CreateAssistantOptions(this); + } + + /** + * Set the name. + * + * @param name the name + * @return the CreateAssistantOptions builder + */ + public Builder name(String name) { + this.name = name; + return this; + } + + /** + * Set the description. + * + * @param description the description + * @return the CreateAssistantOptions builder + */ + public Builder description(String description) { + this.description = description; + return this; + } + + /** + * Set the language. + * + * @param language the language + * @return the CreateAssistantOptions builder + */ + public Builder language(String language) { + this.language = language; + return this; + } + + /** + * Set the assistantData. + * + * @param assistantData the assistantData + * @return the CreateAssistantOptions builder + */ + public Builder assistantData(AssistantData assistantData) { + this.name = assistantData.name(); + this.description = assistantData.description(); + this.language = assistantData.language(); + return this; + } + } + + protected CreateAssistantOptions() {} + + protected CreateAssistantOptions(Builder builder) { + name = builder.name; + description = builder.description; + language = builder.language; + } + + /** + * New builder. + * + * @return a CreateAssistantOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the name. + * + *

The name of the assistant. This string cannot contain carriage return, newline, or tab + * characters. + * + * @return the name + */ + public String name() { + return name; + } + + /** + * Gets the description. + * + *

The description of the assistant. This string cannot contain carriage return, newline, or + * tab characters. + * + * @return the description + */ + public String description() { + return description; + } + + /** + * Gets the language. + * + *

The language of the assistant. + * + * @return the language + */ + public String language() { + return language; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/CreateReleaseOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/CreateReleaseOptions.java new file mode 100644 index 00000000000..a8d8e64c91c --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/CreateReleaseOptions.java @@ -0,0 +1,142 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.watson.assistant.v2.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** The createRelease options. */ +public class CreateReleaseOptions extends GenericModel { + + protected String assistantId; + protected String description; + + /** Builder. */ + public static class Builder { + private String assistantId; + private String description; + + /** + * Instantiates a new Builder from an existing CreateReleaseOptions instance. + * + * @param createReleaseOptions the instance to initialize the Builder with + */ + private Builder(CreateReleaseOptions createReleaseOptions) { + this.assistantId = createReleaseOptions.assistantId; + this.description = createReleaseOptions.description; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Instantiates a new builder with required properties. + * + * @param assistantId the assistantId + */ + public Builder(String assistantId) { + this.assistantId = assistantId; + } + + /** + * Builds a CreateReleaseOptions. + * + * @return the new CreateReleaseOptions instance + */ + public CreateReleaseOptions build() { + return new CreateReleaseOptions(this); + } + + /** + * Set the assistantId. + * + * @param assistantId the assistantId + * @return the CreateReleaseOptions builder + */ + public Builder assistantId(String assistantId) { + this.assistantId = assistantId; + return this; + } + + /** + * Set the description. + * + * @param description the description + * @return the CreateReleaseOptions builder + */ + public Builder description(String description) { + this.description = description; + return this; + } + + /** + * Set the release. + * + * @param release the release + * @return the CreateReleaseOptions builder + */ + public Builder release(Release release) { + this.description = release.description(); + return this; + } + } + + protected CreateReleaseOptions() {} + + protected CreateReleaseOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notEmpty( + builder.assistantId, "assistantId cannot be empty"); + assistantId = builder.assistantId; + description = builder.description; + } + + /** + * New builder. + * + * @return a CreateReleaseOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the assistantId. + * + *

The assistant ID or the environment ID of the environment where the assistant is deployed, + * depending on the type of request: - For message, session, and log requests, specify the + * 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 + * assistant settings and scroll to the **Environments** section. + * + *

**Note:** If you are using the classic Watson Assistant experience, always use the assistant + * ID. To find the assistant ID in the user interface, open the assistant settings and click API + * Details. + * + * @return the assistantId + */ + public String assistantId() { + return assistantId; + } + + /** + * Gets the description. + * + *

The description of the release. + * + * @return the description + */ + public String description() { + return description; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/CreateSessionOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/CreateSessionOptions.java index 5b55e5df4d3..8d14257ada0 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/CreateSessionOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/CreateSessionOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2022. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -18,13 +18,21 @@ public class CreateSessionOptions extends GenericModel { protected String assistantId; + protected RequestAnalytics analytics; /** Builder. */ public static class Builder { private String assistantId; + private RequestAnalytics analytics; + /** + * Instantiates a new Builder from an existing CreateSessionOptions instance. + * + * @param createSessionOptions the instance to initialize the Builder with + */ private Builder(CreateSessionOptions createSessionOptions) { this.assistantId = createSessionOptions.assistantId; + this.analytics = createSessionOptions.analytics; } /** Instantiates a new builder. */ @@ -58,6 +66,17 @@ public Builder assistantId(String assistantId) { this.assistantId = assistantId; return this; } + + /** + * Set the analytics. + * + * @param analytics the analytics + * @return the CreateSessionOptions builder + */ + public Builder analytics(RequestAnalytics analytics) { + this.analytics = analytics; + return this; + } } protected CreateSessionOptions() {} @@ -66,6 +85,7 @@ protected CreateSessionOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty( builder.assistantId, "assistantId cannot be empty"); assistantId = builder.assistantId; + analytics = builder.analytics; } /** @@ -80,16 +100,33 @@ public Builder newBuilder() { /** * Gets the assistantId. * - *

Unique identifier of the assistant. To find the assistant ID in the Watson Assistant user - * interface, open the assistant settings and click **API Details**. For information about - * creating assistants, see the - * [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-assistant-add#assistant-add-task). + *

The assistant ID or the environment ID of the environment where the assistant is deployed, + * depending on the type of request: - For message, session, and log requests, specify the + * 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 + * assistant settings and scroll to the **Environments** section. * - *

**Note:** Currently, the v2 API does not support creating assistants. + *

**Note:** If you are using the classic Watson Assistant experience, always use the assistant + * ID. To find the assistant ID in the user interface, open the assistant settings and click API + * Details. * * @return the assistantId */ public String assistantId() { return assistantId; } + + /** + * Gets the analytics. + * + *

An optional object containing analytics data. Currently, this data is used only for events + * sent to the Segment extension. + * + * @return the analytics + */ + public RequestAnalytics analytics() { + return analytics; + } } diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DeleteAssistantOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DeleteAssistantOptions.java new file mode 100644 index 00000000000..d5565751668 --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DeleteAssistantOptions.java @@ -0,0 +1,105 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.watson.assistant.v2.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** The deleteAssistant options. */ +public class DeleteAssistantOptions extends GenericModel { + + protected String assistantId; + + /** Builder. */ + public static class Builder { + private String assistantId; + + /** + * Instantiates a new Builder from an existing DeleteAssistantOptions instance. + * + * @param deleteAssistantOptions the instance to initialize the Builder with + */ + private Builder(DeleteAssistantOptions deleteAssistantOptions) { + this.assistantId = deleteAssistantOptions.assistantId; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Instantiates a new builder with required properties. + * + * @param assistantId the assistantId + */ + public Builder(String assistantId) { + this.assistantId = assistantId; + } + + /** + * Builds a DeleteAssistantOptions. + * + * @return the new DeleteAssistantOptions instance + */ + public DeleteAssistantOptions build() { + return new DeleteAssistantOptions(this); + } + + /** + * Set the assistantId. + * + * @param assistantId the assistantId + * @return the DeleteAssistantOptions builder + */ + public Builder assistantId(String assistantId) { + this.assistantId = assistantId; + return this; + } + } + + protected DeleteAssistantOptions() {} + + protected DeleteAssistantOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notEmpty( + builder.assistantId, "assistantId cannot be empty"); + assistantId = builder.assistantId; + } + + /** + * New builder. + * + * @return a DeleteAssistantOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the assistantId. + * + *

The assistant ID or the environment ID of the environment where the assistant is deployed, + * depending on the type of request: - For message, session, and log requests, specify the + * 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 + * assistant settings and scroll to the **Environments** section. + * + *

**Note:** If you are using the classic Watson Assistant experience, always use the assistant + * ID. To find the assistant ID in the user interface, open the assistant settings and click API + * Details. + * + * @return the assistantId + */ + public String assistantId() { + return assistantId; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DeleteReleaseOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DeleteReleaseOptions.java new file mode 100644 index 00000000000..1c17a8d0ae7 --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DeleteReleaseOptions.java @@ -0,0 +1,134 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.watson.assistant.v2.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** The deleteRelease options. */ +public class DeleteReleaseOptions extends GenericModel { + + protected String assistantId; + protected String release; + + /** Builder. */ + public static class Builder { + private String assistantId; + private String release; + + /** + * Instantiates a new Builder from an existing DeleteReleaseOptions instance. + * + * @param deleteReleaseOptions the instance to initialize the Builder with + */ + private Builder(DeleteReleaseOptions deleteReleaseOptions) { + this.assistantId = deleteReleaseOptions.assistantId; + this.release = deleteReleaseOptions.release; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Instantiates a new builder with required properties. + * + * @param assistantId the assistantId + * @param release the release + */ + public Builder(String assistantId, String release) { + this.assistantId = assistantId; + this.release = release; + } + + /** + * Builds a DeleteReleaseOptions. + * + * @return the new DeleteReleaseOptions instance + */ + public DeleteReleaseOptions build() { + return new DeleteReleaseOptions(this); + } + + /** + * Set the assistantId. + * + * @param assistantId the assistantId + * @return the DeleteReleaseOptions builder + */ + public Builder assistantId(String assistantId) { + this.assistantId = assistantId; + return this; + } + + /** + * Set the release. + * + * @param release the release + * @return the DeleteReleaseOptions builder + */ + public Builder release(String release) { + this.release = release; + return this; + } + } + + protected DeleteReleaseOptions() {} + + protected DeleteReleaseOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notEmpty( + builder.assistantId, "assistantId cannot be empty"); + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.release, "release cannot be empty"); + assistantId = builder.assistantId; + release = builder.release; + } + + /** + * New builder. + * + * @return a DeleteReleaseOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the assistantId. + * + *

The assistant ID or the environment ID of the environment where the assistant is deployed, + * depending on the type of request: - For message, session, and log requests, specify the + * 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 + * assistant settings and scroll to the **Environments** section. + * + *

**Note:** If you are using the classic Watson Assistant experience, always use the assistant + * ID. To find the assistant ID in the user interface, open the assistant settings and click API + * Details. + * + * @return the assistantId + */ + public String assistantId() { + return assistantId; + } + + /** + * Gets the release. + * + *

Unique identifier of the release. + * + * @return the release + */ + public String release() { + return release; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DeleteSessionOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DeleteSessionOptions.java index 8584d7e0ee2..4f82d5946fc 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DeleteSessionOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DeleteSessionOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2022. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -25,6 +25,11 @@ public static class Builder { private String assistantId; private String sessionId; + /** + * Instantiates a new Builder from an existing DeleteSessionOptions instance. + * + * @param deleteSessionOptions the instance to initialize the Builder with + */ private Builder(DeleteSessionOptions deleteSessionOptions) { this.assistantId = deleteSessionOptions.assistantId; this.sessionId = deleteSessionOptions.sessionId; @@ -98,12 +103,17 @@ public Builder newBuilder() { /** * Gets the assistantId. * - *

Unique identifier of the assistant. To find the assistant ID in the Watson Assistant user - * interface, open the assistant settings and click **API Details**. For information about - * creating assistants, see the - * [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-assistant-add#assistant-add-task). + *

The assistant ID or the environment ID of the environment where the assistant is deployed, + * depending on the type of request: - For message, session, and log requests, specify the + * 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 + * assistant settings and scroll to the **Environments** section. * - *

**Note:** Currently, the v2 API does not support creating assistants. + *

**Note:** If you are using the classic Watson Assistant experience, always use the assistant + * ID. To find the assistant ID in the user interface, open the assistant settings and click API + * Details. * * @return the assistantId */ diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DeleteUserDataOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DeleteUserDataOptions.java index b01fddd4604..01302d512bf 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DeleteUserDataOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DeleteUserDataOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2022. + * (C) Copyright IBM Corp. 2023. * * 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,11 @@ public class DeleteUserDataOptions extends GenericModel { public static class Builder { private String customerId; + /** + * Instantiates a new Builder from an existing DeleteUserDataOptions instance. + * + * @param deleteUserDataOptions the instance to initialize the Builder with + */ private Builder(DeleteUserDataOptions deleteUserDataOptions) { this.customerId = deleteUserDataOptions.customerId; } diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DeployReleaseOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DeployReleaseOptions.java index 195c9c4c53d..34e9502db6e 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DeployReleaseOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DeployReleaseOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -29,6 +29,11 @@ public static class Builder { private String environmentId; private Boolean includeAudit; + /** + * Instantiates a new Builder from an existing DeployReleaseOptions instance. + * + * @param deployReleaseOptions the instance to initialize the Builder with + */ private Builder(DeployReleaseOptions deployReleaseOptions) { this.assistantId = deployReleaseOptions.assistantId; this.release = deployReleaseOptions.release; @@ -132,12 +137,17 @@ public Builder newBuilder() { /** * Gets the assistantId. * - *

Unique identifier of the assistant. To find the assistant ID in the Watson Assistant user - * interface, open the assistant settings and click **API Details**. For information about - * creating assistants, see the - * [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-assistant-add#assistant-add-task). + *

The assistant ID or the environment ID of the environment where the assistant is deployed, + * depending on the type of request: - For message, session, and log requests, specify the + * 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 + * assistant settings and scroll to the **Environments** section. * - *

**Note:** Currently, the v2 API does not support creating assistants. + *

**Note:** If you are using the classic Watson Assistant experience, always use the assistant + * ID. To find the assistant ID in the user interface, open the assistant settings and click API + * Details. * * @return the assistantId */ diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DialogLogMessage.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DialogLogMessage.java index a629616c882..3560918cdfa 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DialogLogMessage.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DialogLogMessage.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2021. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -32,6 +32,8 @@ public interface Level { protected String code; protected LogMessageSource source; + protected DialogLogMessage() {} + /** * Gets the level. * diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DialogNodeAction.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DialogNodeAction.java index d4e115d7206..9c263848d5f 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DialogNodeAction.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DialogNodeAction.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2020. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -40,6 +40,8 @@ public interface Type { protected String credentials; + protected DialogNodeAction() {} + /** * Gets the name. * diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DialogNodeOutputConnectToAgentTransferInfo.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DialogNodeOutputConnectToAgentTransferInfo.java index 26dcb6e4f2e..079316be648 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DialogNodeOutputConnectToAgentTransferInfo.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DialogNodeOutputConnectToAgentTransferInfo.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -20,6 +20,8 @@ public class DialogNodeOutputConnectToAgentTransferInfo extends GenericModel { protected Map> target; + protected DialogNodeOutputConnectToAgentTransferInfo() {} + /** * Gets the target. * diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DialogNodeOutputOptionsElement.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DialogNodeOutputOptionsElement.java index 41ace3fecca..fad3b79703a 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DialogNodeOutputOptionsElement.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DialogNodeOutputOptionsElement.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2020. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -20,6 +20,8 @@ public class DialogNodeOutputOptionsElement extends GenericModel { protected String label; protected DialogNodeOutputOptionsElementValue value; + protected DialogNodeOutputOptionsElement() {} + /** * Gets the label. * diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DialogNodeOutputOptionsElementValue.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DialogNodeOutputOptionsElementValue.java index 2dc3e0e7c46..70df4f1c074 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DialogNodeOutputOptionsElementValue.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DialogNodeOutputOptionsElementValue.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2020. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -22,6 +22,8 @@ public class DialogNodeOutputOptionsElementValue extends GenericModel { protected MessageInput input; + protected DialogNodeOutputOptionsElementValue() {} + /** * Gets the input. * diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DialogNodeVisited.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DialogNodeVisited.java index 96889c8ae3d..301e638ba14 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DialogNodeVisited.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DialogNodeVisited.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -27,6 +27,8 @@ public class DialogNodeVisited extends GenericModel { protected String title; protected String conditions; + protected DialogNodeVisited() {} + /** * Gets the dialogNode. * diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DialogSuggestion.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DialogSuggestion.java index e175fde2b79..7c3664ecd67 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DialogSuggestion.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DialogSuggestion.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2020. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -22,6 +22,8 @@ public class DialogSuggestion extends GenericModel { protected DialogSuggestionValue value; protected Map output; + protected DialogSuggestion() {} + /** * Gets the label. * @@ -41,6 +43,9 @@ public String getLabel() { *

An object defining the message input to be sent to the assistant if the user selects the * corresponding disambiguation option. * + *

**Note:** This entire message input object must be included in the request body of the next + * message sent to the assistant. Do not modify or remove any of the included properties. + * * @return the value */ public DialogSuggestionValue getValue() { diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DialogSuggestionValue.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DialogSuggestionValue.java index 7525c1355fd..3b6185cb49b 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DialogSuggestionValue.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DialogSuggestionValue.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2020. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -17,11 +17,16 @@ /** * An object defining the message input to be sent to the assistant if the user selects the * corresponding disambiguation option. + * + *

**Note:** This entire message input object must be included in the request body of the next + * message sent to the assistant. Do not modify or remove any of the included properties. */ public class DialogSuggestionValue extends GenericModel { protected MessageInput input; + protected DialogSuggestionValue() {} + /** * Gets the input. * diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/Environment.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/Environment.java index 603c78791eb..9852a5aadaf 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/Environment.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/Environment.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -22,7 +22,6 @@ public class Environment extends GenericModel { protected String name; protected String description; - protected String language; @SerializedName("assistant_id") protected String assistantId; @@ -33,9 +32,9 @@ public class Environment extends GenericModel { protected String environment; @SerializedName("release_reference") - protected EnvironmentReleaseReference releaseReference; + protected BaseEnvironmentReleaseReference releaseReference; - protected EnvironmentOrchestration orchestration; + protected BaseEnvironmentOrchestration orchestration; @SerializedName("session_timeout") protected Long sessionTimeout; @@ -44,11 +43,13 @@ public class Environment extends GenericModel { protected List integrationReferences; @SerializedName("skill_references") - protected List skillReferences; + protected List skillReferences; protected Date created; protected Date updated; + protected Environment() {} + /** * Gets the name. * @@ -71,18 +72,6 @@ public String getDescription() { return description; } - /** - * Gets the language. - * - *

The language of the environment. An environment is always created with the same language as - * the assistant it is associated with. - * - * @return the language - */ - public String getLanguage() { - return language; - } - /** * Gets the assistantId. * @@ -124,7 +113,7 @@ public String getEnvironment() { * * @return the releaseReference */ - public EnvironmentReleaseReference getReleaseReference() { + public BaseEnvironmentReleaseReference getReleaseReference() { return releaseReference; } @@ -135,14 +124,14 @@ public EnvironmentReleaseReference getReleaseReference() { * * @return the orchestration */ - public EnvironmentOrchestration getOrchestration() { + public BaseEnvironmentOrchestration getOrchestration() { return orchestration; } /** * Gets the sessionTimeout. * - *

The session inactivity timeout setting for the environment. + *

The session inactivity timeout setting for the environment (in seconds). * * @return the sessionTimeout */ @@ -164,12 +153,12 @@ public List getIntegrationReferences() { /** * Gets the skillReferences. * - *

An array of objects describing the skills (such as actions and dialog) that exist in the + *

An array of objects identifying the skills (such as action and dialog) that exist in the * environment. * * @return the skillReferences */ - public List getSkillReferences() { + public List getSkillReferences() { return skillReferences; } diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/EnvironmentCollection.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/EnvironmentCollection.java index 2f5ec9a17e9..0aaebf93b15 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/EnvironmentCollection.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/EnvironmentCollection.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022. + * (C) Copyright IBM Corp. 2023. * * 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,8 @@ public class EnvironmentCollection extends GenericModel { protected List environments; protected Pagination pagination; + protected EnvironmentCollection() {} + /** * Gets the environments. * @@ -35,7 +37,8 @@ public List getEnvironments() { /** * Gets the pagination. * - *

The pagination data for the returned objects. + *

The pagination data for the returned objects. For more information about using pagination, + * see [Pagination](#pagination). * * @return the pagination */ diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/EnvironmentReference.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/EnvironmentReference.java index f64c5000a11..2e9caddb0eb 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/EnvironmentReference.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/EnvironmentReference.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -19,8 +19,8 @@ public class EnvironmentReference extends GenericModel { /** - * The type of the deployed environment. All environments other than the draft and live - * environments have the type `staging`. + * The type of the environment. All environments other than the draft and live environments have + * the type `staging`. */ public interface Environment { /** draft. */ @@ -38,37 +38,89 @@ public interface Environment { protected String environment; + /** Builder. */ + public static class Builder { + private String name; + + /** + * Instantiates a new Builder from an existing EnvironmentReference instance. + * + * @param environmentReference the instance to initialize the Builder with + */ + private Builder(EnvironmentReference environmentReference) { + this.name = environmentReference.name; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Builds a EnvironmentReference. + * + * @return the new EnvironmentReference instance + */ + public EnvironmentReference build() { + return new EnvironmentReference(this); + } + + /** + * Set the name. + * + * @param name the name + * @return the EnvironmentReference builder + */ + public Builder name(String name) { + this.name = name; + return this; + } + } + + protected EnvironmentReference() {} + + protected EnvironmentReference(Builder builder) { + name = builder.name; + } + + /** + * New builder. + * + * @return a EnvironmentReference builder + */ + public Builder newBuilder() { + return new Builder(this); + } + /** * Gets the name. * - *

The name of the deployed environment. + *

The name of the environment. * * @return the name */ - public String getName() { + public String name() { return name; } /** * Gets the environmentId. * - *

The environment ID of the deployed environment. + *

The unique identifier of the environment. * * @return the environmentId */ - public String getEnvironmentId() { + public String environmentId() { return environmentId; } /** * Gets the environment. * - *

The type of the deployed environment. All environments other than the draft and live - * environments have the type `staging`. + *

The type of the environment. All environments other than the draft and live environments + * have the type `staging`. * * @return the environment */ - public String getEnvironment() { + public String environment() { return environment; } } diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/EnvironmentSkill.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/EnvironmentSkill.java new file mode 100644 index 00000000000..5bb781a2e52 --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/EnvironmentSkill.java @@ -0,0 +1,216 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.watson.assistant.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** EnvironmentSkill. */ +public class EnvironmentSkill extends GenericModel { + + /** The type of the skill. */ + public interface Type { + /** dialog. */ + String DIALOG = "dialog"; + /** action. */ + String ACTION = "action"; + /** search. */ + String SEARCH = "search"; + } + + @SerializedName("skill_id") + protected String skillId; + + protected String type; + protected Boolean disabled; + protected String snapshot; + + @SerializedName("skill_reference") + protected String skillReference; + + /** Builder. */ + public static class Builder { + private String skillId; + private String type; + private Boolean disabled; + private String snapshot; + private String skillReference; + + /** + * Instantiates a new Builder from an existing EnvironmentSkill instance. + * + * @param environmentSkill the instance to initialize the Builder with + */ + private Builder(EnvironmentSkill environmentSkill) { + this.skillId = environmentSkill.skillId; + this.type = environmentSkill.type; + this.disabled = environmentSkill.disabled; + this.snapshot = environmentSkill.snapshot; + this.skillReference = environmentSkill.skillReference; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Instantiates a new builder with required properties. + * + * @param skillId the skillId + */ + public Builder(String skillId) { + this.skillId = skillId; + } + + /** + * Builds a EnvironmentSkill. + * + * @return the new EnvironmentSkill instance + */ + public EnvironmentSkill build() { + return new EnvironmentSkill(this); + } + + /** + * Set the skillId. + * + * @param skillId the skillId + * @return the EnvironmentSkill builder + */ + public Builder skillId(String skillId) { + this.skillId = skillId; + return this; + } + + /** + * Set the type. + * + * @param type the type + * @return the EnvironmentSkill builder + */ + public Builder type(String type) { + this.type = type; + return this; + } + + /** + * Set the disabled. + * + * @param disabled the disabled + * @return the EnvironmentSkill builder + */ + public Builder disabled(Boolean disabled) { + this.disabled = disabled; + return this; + } + + /** + * Set the snapshot. + * + * @param snapshot the snapshot + * @return the EnvironmentSkill builder + */ + public Builder snapshot(String snapshot) { + this.snapshot = snapshot; + return this; + } + + /** + * Set the skillReference. + * + * @param skillReference the skillReference + * @return the EnvironmentSkill builder + */ + public Builder skillReference(String skillReference) { + this.skillReference = skillReference; + return this; + } + } + + protected EnvironmentSkill() {} + + protected EnvironmentSkill(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.skillId, "skillId cannot be null"); + skillId = builder.skillId; + type = builder.type; + disabled = builder.disabled; + snapshot = builder.snapshot; + skillReference = builder.skillReference; + } + + /** + * New builder. + * + * @return a EnvironmentSkill builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the skillId. + * + *

The skill ID of the skill. + * + * @return the skillId + */ + public String skillId() { + return skillId; + } + + /** + * Gets the type. + * + *

The type of the skill. + * + * @return the type + */ + public String type() { + return type; + } + + /** + * Gets the disabled. + * + *

Whether the skill is disabled. A disabled skill in the draft environment does not handle any + * messages at run time, and it is not included in saved releases. + * + * @return the disabled + */ + public Boolean disabled() { + return disabled; + } + + /** + * Gets the snapshot. + * + *

The name of the skill snapshot that is deployed to the environment (for example, `draft` or + * `1`). + * + * @return the snapshot + */ + public String snapshot() { + return snapshot; + } + + /** + * Gets the skillReference. + * + *

The type of skill identified by the skill reference. The possible values are `main skill` + * (for a dialog skill), `actions skill`, and `search skill`. + * + * @return the skillReference + */ + public String skillReference() { + return skillReference; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ExportSkillsOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ExportSkillsOptions.java new file mode 100644 index 00000000000..0f043c62962 --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ExportSkillsOptions.java @@ -0,0 +1,132 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.watson.assistant.v2.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** The exportSkills options. */ +public class ExportSkillsOptions extends GenericModel { + + protected String assistantId; + protected Boolean includeAudit; + + /** Builder. */ + public static class Builder { + private String assistantId; + private Boolean includeAudit; + + /** + * Instantiates a new Builder from an existing ExportSkillsOptions instance. + * + * @param exportSkillsOptions the instance to initialize the Builder with + */ + private Builder(ExportSkillsOptions exportSkillsOptions) { + this.assistantId = exportSkillsOptions.assistantId; + this.includeAudit = exportSkillsOptions.includeAudit; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Instantiates a new builder with required properties. + * + * @param assistantId the assistantId + */ + public Builder(String assistantId) { + this.assistantId = assistantId; + } + + /** + * Builds a ExportSkillsOptions. + * + * @return the new ExportSkillsOptions instance + */ + public ExportSkillsOptions build() { + return new ExportSkillsOptions(this); + } + + /** + * Set the assistantId. + * + * @param assistantId the assistantId + * @return the ExportSkillsOptions builder + */ + public Builder assistantId(String assistantId) { + this.assistantId = assistantId; + return this; + } + + /** + * Set the includeAudit. + * + * @param includeAudit the includeAudit + * @return the ExportSkillsOptions builder + */ + public Builder includeAudit(Boolean includeAudit) { + this.includeAudit = includeAudit; + return this; + } + } + + protected ExportSkillsOptions() {} + + protected ExportSkillsOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notEmpty( + builder.assistantId, "assistantId cannot be empty"); + assistantId = builder.assistantId; + includeAudit = builder.includeAudit; + } + + /** + * New builder. + * + * @return a ExportSkillsOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the assistantId. + * + *

The assistant ID or the environment ID of the environment where the assistant is deployed, + * depending on the type of request: - For message, session, and log requests, specify the + * 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 + * assistant settings and scroll to the **Environments** section. + * + *

**Note:** If you are using the classic Watson Assistant experience, always use the assistant + * ID. To find the assistant ID in the user interface, open the assistant settings and click API + * Details. + * + * @return the assistantId + */ + public String assistantId() { + return assistantId; + } + + /** + * Gets the includeAudit. + * + *

Whether to include the audit properties (`created` and `updated` timestamps) in the + * response. + * + * @return the includeAudit + */ + public Boolean includeAudit() { + return includeAudit; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/GetEnvironmentOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/GetEnvironmentOptions.java index 0f56d48f132..3f866a11000 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/GetEnvironmentOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/GetEnvironmentOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -27,6 +27,11 @@ public static class Builder { private String environmentId; private Boolean includeAudit; + /** + * Instantiates a new Builder from an existing GetEnvironmentOptions instance. + * + * @param getEnvironmentOptions the instance to initialize the Builder with + */ private Builder(GetEnvironmentOptions getEnvironmentOptions) { this.assistantId = getEnvironmentOptions.assistantId; this.environmentId = getEnvironmentOptions.environmentId; @@ -114,12 +119,17 @@ public Builder newBuilder() { /** * Gets the assistantId. * - *

Unique identifier of the assistant. To find the assistant ID in the Watson Assistant user - * interface, open the assistant settings and click **API Details**. For information about - * creating assistants, see the - * [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-assistant-add#assistant-add-task). + *

The assistant ID or the environment ID of the environment where the assistant is deployed, + * depending on the type of request: - For message, session, and log requests, specify the + * 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 + * assistant settings and scroll to the **Environments** section. * - *

**Note:** Currently, the v2 API does not support creating assistants. + *

**Note:** If you are using the classic Watson Assistant experience, always use the assistant + * ID. To find the assistant ID in the user interface, open the assistant settings and click API + * Details. * * @return the assistantId */ diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/GetReleaseOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/GetReleaseOptions.java index fbbfcdebb6f..1cec760a85d 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/GetReleaseOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/GetReleaseOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -27,6 +27,11 @@ public static class Builder { private String release; private Boolean includeAudit; + /** + * Instantiates a new Builder from an existing GetReleaseOptions instance. + * + * @param getReleaseOptions the instance to initialize the Builder with + */ private Builder(GetReleaseOptions getReleaseOptions) { this.assistantId = getReleaseOptions.assistantId; this.release = getReleaseOptions.release; @@ -113,12 +118,17 @@ public Builder newBuilder() { /** * Gets the assistantId. * - *

Unique identifier of the assistant. To find the assistant ID in the Watson Assistant user - * interface, open the assistant settings and click **API Details**. For information about - * creating assistants, see the - * [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-assistant-add#assistant-add-task). + *

The assistant ID or the environment ID of the environment where the assistant is deployed, + * depending on the type of request: - For message, session, and log requests, specify the + * 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 + * assistant settings and scroll to the **Environments** section. * - *

**Note:** Currently, the v2 API does not support creating assistants. + *

**Note:** If you are using the classic Watson Assistant experience, always use the assistant + * ID. To find the assistant ID in the user interface, open the assistant settings and click API + * Details. * * @return the assistantId */ diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/GetSkillOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/GetSkillOptions.java new file mode 100644 index 00000000000..1b0a800c5a2 --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/GetSkillOptions.java @@ -0,0 +1,135 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.watson.assistant.v2.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** The getSkill options. */ +public class GetSkillOptions extends GenericModel { + + protected String assistantId; + protected String skillId; + + /** Builder. */ + public static class Builder { + private String assistantId; + private String skillId; + + /** + * Instantiates a new Builder from an existing GetSkillOptions instance. + * + * @param getSkillOptions the instance to initialize the Builder with + */ + private Builder(GetSkillOptions getSkillOptions) { + this.assistantId = getSkillOptions.assistantId; + this.skillId = getSkillOptions.skillId; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Instantiates a new builder with required properties. + * + * @param assistantId the assistantId + * @param skillId the skillId + */ + public Builder(String assistantId, String skillId) { + this.assistantId = assistantId; + this.skillId = skillId; + } + + /** + * Builds a GetSkillOptions. + * + * @return the new GetSkillOptions instance + */ + public GetSkillOptions build() { + return new GetSkillOptions(this); + } + + /** + * Set the assistantId. + * + * @param assistantId the assistantId + * @return the GetSkillOptions builder + */ + public Builder assistantId(String assistantId) { + this.assistantId = assistantId; + return this; + } + + /** + * Set the skillId. + * + * @param skillId the skillId + * @return the GetSkillOptions builder + */ + public Builder skillId(String skillId) { + this.skillId = skillId; + return this; + } + } + + protected GetSkillOptions() {} + + protected GetSkillOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notEmpty( + builder.assistantId, "assistantId cannot be empty"); + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.skillId, "skillId cannot be empty"); + assistantId = builder.assistantId; + skillId = builder.skillId; + } + + /** + * New builder. + * + * @return a GetSkillOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the assistantId. + * + *

The assistant ID or the environment ID of the environment where the assistant is deployed, + * depending on the type of request: - For message, session, and log requests, specify the + * 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 + * assistant settings and scroll to the **Environments** section. + * + *

**Note:** If you are using the classic Watson Assistant experience, always use the assistant + * ID. To find the assistant ID in the user interface, open the assistant settings and click API + * Details. + * + * @return the assistantId + */ + public String assistantId() { + return assistantId; + } + + /** + * Gets the skillId. + * + *

Unique identifier of the skill. To find the skill ID in the Watson Assistant user interface, + * open the skill settings and click **API Details**. + * + * @return the skillId + */ + public String skillId() { + return skillId; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ImportSkillsOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ImportSkillsOptions.java new file mode 100644 index 00000000000..fdfb6bcac2e --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ImportSkillsOptions.java @@ -0,0 +1,213 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.watson.assistant.v2.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; +import java.util.ArrayList; +import java.util.List; + +/** The importSkills options. */ +public class ImportSkillsOptions extends GenericModel { + + protected String assistantId; + protected List assistantSkills; + protected AssistantState assistantState; + protected Boolean includeAudit; + + /** Builder. */ + public static class Builder { + private String assistantId; + private List assistantSkills; + private AssistantState assistantState; + private Boolean includeAudit; + + /** + * Instantiates a new Builder from an existing ImportSkillsOptions instance. + * + * @param importSkillsOptions the instance to initialize the Builder with + */ + private Builder(ImportSkillsOptions importSkillsOptions) { + this.assistantId = importSkillsOptions.assistantId; + this.assistantSkills = importSkillsOptions.assistantSkills; + this.assistantState = importSkillsOptions.assistantState; + this.includeAudit = importSkillsOptions.includeAudit; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Instantiates a new builder with required properties. + * + * @param assistantId the assistantId + * @param assistantSkills the assistantSkills + * @param assistantState the assistantState + */ + public Builder( + String assistantId, List assistantSkills, AssistantState assistantState) { + this.assistantId = assistantId; + this.assistantSkills = assistantSkills; + this.assistantState = assistantState; + } + + /** + * Builds a ImportSkillsOptions. + * + * @return the new ImportSkillsOptions instance + */ + public ImportSkillsOptions build() { + return new ImportSkillsOptions(this); + } + + /** + * Adds an assistantSkills to assistantSkills. + * + * @param assistantSkills the new assistantSkills + * @return the ImportSkillsOptions builder + */ + public Builder addAssistantSkills(SkillImport assistantSkills) { + com.ibm.cloud.sdk.core.util.Validator.notNull( + assistantSkills, "assistantSkills cannot be null"); + if (this.assistantSkills == null) { + this.assistantSkills = new ArrayList(); + } + this.assistantSkills.add(assistantSkills); + return this; + } + + /** + * Set the assistantId. + * + * @param assistantId the assistantId + * @return the ImportSkillsOptions builder + */ + public Builder assistantId(String assistantId) { + this.assistantId = assistantId; + return this; + } + + /** + * Set the assistantSkills. Existing assistantSkills will be replaced. + * + * @param assistantSkills the assistantSkills + * @return the ImportSkillsOptions builder + */ + public Builder assistantSkills(List assistantSkills) { + this.assistantSkills = assistantSkills; + return this; + } + + /** + * Set the assistantState. + * + * @param assistantState the assistantState + * @return the ImportSkillsOptions builder + */ + public Builder assistantState(AssistantState assistantState) { + this.assistantState = assistantState; + return this; + } + + /** + * Set the includeAudit. + * + * @param includeAudit the includeAudit + * @return the ImportSkillsOptions builder + */ + public Builder includeAudit(Boolean includeAudit) { + this.includeAudit = includeAudit; + return this; + } + } + + protected ImportSkillsOptions() {} + + protected ImportSkillsOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notEmpty( + builder.assistantId, "assistantId cannot be empty"); + com.ibm.cloud.sdk.core.util.Validator.notNull( + builder.assistantSkills, "assistantSkills cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull( + builder.assistantState, "assistantState cannot be null"); + assistantId = builder.assistantId; + assistantSkills = builder.assistantSkills; + assistantState = builder.assistantState; + includeAudit = builder.includeAudit; + } + + /** + * New builder. + * + * @return a ImportSkillsOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the assistantId. + * + *

The assistant ID or the environment ID of the environment where the assistant is deployed, + * depending on the type of request: - For message, session, and log requests, specify the + * 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 + * assistant settings and scroll to the **Environments** section. + * + *

**Note:** If you are using the classic Watson Assistant experience, always use the assistant + * ID. To find the assistant ID in the user interface, open the assistant settings and click API + * Details. + * + * @return the assistantId + */ + public String assistantId() { + return assistantId; + } + + /** + * Gets the assistantSkills. + * + *

An array of objects describing the skills for the assistant. Included in responses only if + * **status**=`Available`. + * + * @return the assistantSkills + */ + public List assistantSkills() { + return assistantSkills; + } + + /** + * Gets the assistantState. + * + *

Status information about the skills for the assistant. Included in responses only if + * **status**=`Available`. + * + * @return the assistantState + */ + public AssistantState assistantState() { + return assistantState; + } + + /** + * Gets the includeAudit. + * + *

Whether to include the audit properties (`created` and `updated` timestamps) in the + * response. + * + * @return the includeAudit + */ + public Boolean includeAudit() { + return includeAudit; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ImportSkillsStatusOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ImportSkillsStatusOptions.java new file mode 100644 index 00000000000..b86b797a7f8 --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ImportSkillsStatusOptions.java @@ -0,0 +1,105 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.watson.assistant.v2.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** The importSkillsStatus options. */ +public class ImportSkillsStatusOptions extends GenericModel { + + protected String assistantId; + + /** Builder. */ + public static class Builder { + private String assistantId; + + /** + * Instantiates a new Builder from an existing ImportSkillsStatusOptions instance. + * + * @param importSkillsStatusOptions the instance to initialize the Builder with + */ + private Builder(ImportSkillsStatusOptions importSkillsStatusOptions) { + this.assistantId = importSkillsStatusOptions.assistantId; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Instantiates a new builder with required properties. + * + * @param assistantId the assistantId + */ + public Builder(String assistantId) { + this.assistantId = assistantId; + } + + /** + * Builds a ImportSkillsStatusOptions. + * + * @return the new ImportSkillsStatusOptions instance + */ + public ImportSkillsStatusOptions build() { + return new ImportSkillsStatusOptions(this); + } + + /** + * Set the assistantId. + * + * @param assistantId the assistantId + * @return the ImportSkillsStatusOptions builder + */ + public Builder assistantId(String assistantId) { + this.assistantId = assistantId; + return this; + } + } + + protected ImportSkillsStatusOptions() {} + + protected ImportSkillsStatusOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notEmpty( + builder.assistantId, "assistantId cannot be empty"); + assistantId = builder.assistantId; + } + + /** + * New builder. + * + * @return a ImportSkillsStatusOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the assistantId. + * + *

The assistant ID or the environment ID of the environment where the assistant is deployed, + * depending on the type of request: - For message, session, and log requests, specify the + * 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 + * assistant settings and scroll to the **Environments** section. + * + *

**Note:** If you are using the classic Watson Assistant experience, always use the assistant + * ID. To find the assistant ID in the user interface, open the assistant settings and click API + * Details. + * + * @return the assistantId + */ + public String assistantId() { + return assistantId; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/IntegrationReference.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/IntegrationReference.java index db529b3d46e..f373877aac9 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/IntegrationReference.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/IntegrationReference.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022. + * (C) Copyright IBM Corp. 2023. * * 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,72 @@ public class IntegrationReference extends GenericModel { protected String type; + /** Builder. */ + public static class Builder { + private String integrationId; + private String type; + + /** + * Instantiates a new Builder from an existing IntegrationReference instance. + * + * @param integrationReference the instance to initialize the Builder with + */ + private Builder(IntegrationReference integrationReference) { + this.integrationId = integrationReference.integrationId; + this.type = integrationReference.type; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Builds a IntegrationReference. + * + * @return the new IntegrationReference instance + */ + public IntegrationReference build() { + return new IntegrationReference(this); + } + + /** + * Set the integrationId. + * + * @param integrationId the integrationId + * @return the IntegrationReference builder + */ + public Builder integrationId(String integrationId) { + this.integrationId = integrationId; + return this; + } + + /** + * Set the type. + * + * @param type the type + * @return the IntegrationReference builder + */ + public Builder type(String type) { + this.type = type; + return this; + } + } + + protected IntegrationReference() {} + + protected IntegrationReference(Builder builder) { + integrationId = builder.integrationId; + type = builder.type; + } + + /** + * New builder. + * + * @return a IntegrationReference builder + */ + public Builder newBuilder() { + return new Builder(this); + } + /** * Gets the integrationId. * @@ -30,7 +96,7 @@ public class IntegrationReference extends GenericModel { * * @return the integrationId */ - public String getIntegrationId() { + public String integrationId() { return integrationId; } @@ -41,7 +107,7 @@ public String getIntegrationId() { * * @return the type */ - public String getType() { + public String type() { return type; } } diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ListAssistantsOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ListAssistantsOptions.java new file mode 100644 index 00000000000..7afdf0280a0 --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ListAssistantsOptions.java @@ -0,0 +1,203 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.watson.assistant.v2.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** The listAssistants options. */ +public class ListAssistantsOptions extends GenericModel { + + /** + * The attribute by which returned assistants will be sorted. To reverse the sort order, prefix + * the value with a minus sign (`-`). + */ + public interface Sort { + /** name. */ + String NAME = "name"; + /** updated. */ + String UPDATED = "updated"; + } + + protected Long pageLimit; + protected Boolean includeCount; + protected String sort; + protected String cursor; + protected Boolean includeAudit; + + /** Builder. */ + public static class Builder { + private Long pageLimit; + private Boolean includeCount; + private String sort; + private String cursor; + private Boolean includeAudit; + + /** + * Instantiates a new Builder from an existing ListAssistantsOptions instance. + * + * @param listAssistantsOptions the instance to initialize the Builder with + */ + private Builder(ListAssistantsOptions listAssistantsOptions) { + this.pageLimit = listAssistantsOptions.pageLimit; + this.includeCount = listAssistantsOptions.includeCount; + this.sort = listAssistantsOptions.sort; + this.cursor = listAssistantsOptions.cursor; + this.includeAudit = listAssistantsOptions.includeAudit; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Builds a ListAssistantsOptions. + * + * @return the new ListAssistantsOptions instance + */ + public ListAssistantsOptions build() { + return new ListAssistantsOptions(this); + } + + /** + * Set the pageLimit. + * + * @param pageLimit the pageLimit + * @return the ListAssistantsOptions builder + */ + public Builder pageLimit(long pageLimit) { + this.pageLimit = pageLimit; + return this; + } + + /** + * Set the includeCount. + * + * @param includeCount the includeCount + * @return the ListAssistantsOptions builder + */ + public Builder includeCount(Boolean includeCount) { + this.includeCount = includeCount; + return this; + } + + /** + * Set the sort. + * + * @param sort the sort + * @return the ListAssistantsOptions builder + */ + public Builder sort(String sort) { + this.sort = sort; + return this; + } + + /** + * Set the cursor. + * + * @param cursor the cursor + * @return the ListAssistantsOptions builder + */ + public Builder cursor(String cursor) { + this.cursor = cursor; + return this; + } + + /** + * Set the includeAudit. + * + * @param includeAudit the includeAudit + * @return the ListAssistantsOptions builder + */ + public Builder includeAudit(Boolean includeAudit) { + this.includeAudit = includeAudit; + return this; + } + } + + protected ListAssistantsOptions() {} + + protected ListAssistantsOptions(Builder builder) { + pageLimit = builder.pageLimit; + includeCount = builder.includeCount; + sort = builder.sort; + cursor = builder.cursor; + includeAudit = builder.includeAudit; + } + + /** + * New builder. + * + * @return a ListAssistantsOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the pageLimit. + * + *

The number of records to return in each page of results. + * + * @return the pageLimit + */ + public Long pageLimit() { + return pageLimit; + } + + /** + * Gets the includeCount. + * + *

Whether to include information about the number of records that satisfy the request, + * regardless of the page limit. If this parameter is `true`, the `pagination` object in the + * response includes the `total` property. + * + * @return the includeCount + */ + public Boolean includeCount() { + return includeCount; + } + + /** + * Gets the sort. + * + *

The attribute by which returned assistants will be sorted. To reverse the sort order, prefix + * the value with a minus sign (`-`). + * + * @return the sort + */ + public String sort() { + return sort; + } + + /** + * Gets the cursor. + * + *

A token identifying the page of results to retrieve. + * + * @return the cursor + */ + public String cursor() { + return cursor; + } + + /** + * Gets the includeAudit. + * + *

Whether to include the audit properties (`created` and `updated` timestamps) in the + * response. + * + * @return the includeAudit + */ + public Boolean includeAudit() { + return includeAudit; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ListEnvironmentsOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ListEnvironmentsOptions.java index 95838c86260..18a8a54e413 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ListEnvironmentsOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ListEnvironmentsOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -44,6 +44,11 @@ public static class Builder { private String cursor; private Boolean includeAudit; + /** + * Instantiates a new Builder from an existing ListEnvironmentsOptions instance. + * + * @param listEnvironmentsOptions the instance to initialize the Builder with + */ private Builder(ListEnvironmentsOptions listEnvironmentsOptions) { this.assistantId = listEnvironmentsOptions.assistantId; this.pageLimit = listEnvironmentsOptions.pageLimit; @@ -166,12 +171,17 @@ public Builder newBuilder() { /** * Gets the assistantId. * - *

Unique identifier of the assistant. To find the assistant ID in the Watson Assistant user - * interface, open the assistant settings and click **API Details**. For information about - * creating assistants, see the - * [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-assistant-add#assistant-add-task). + *

The assistant ID or the environment ID of the environment where the assistant is deployed, + * depending on the type of request: - For message, session, and log requests, specify the + * 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 + * assistant settings and scroll to the **Environments** section. * - *

**Note:** Currently, the v2 API does not support creating assistants. + *

**Note:** If you are using the classic Watson Assistant experience, always use the assistant + * ID. To find the assistant ID in the user interface, open the assistant settings and click API + * Details. * * @return the assistantId */ diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ListLogsOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ListLogsOptions.java index 33cc74ba8df..4c804e32e89 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ListLogsOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ListLogsOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020, 2022. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -31,6 +31,11 @@ public static class Builder { private Long pageLimit; private String cursor; + /** + * Instantiates a new Builder from an existing ListLogsOptions instance. + * + * @param listLogsOptions the instance to initialize the Builder with + */ private Builder(ListLogsOptions listLogsOptions) { this.assistantId = listLogsOptions.assistantId; this.sort = listLogsOptions.sort; @@ -140,12 +145,17 @@ public Builder newBuilder() { /** * Gets the assistantId. * - *

Unique identifier of the assistant. To find the assistant ID in the Watson Assistant user - * interface, open the assistant settings and click **API Details**. For information about - * creating assistants, see the - * [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-assistant-add#assistant-add-task). + *

The assistant ID or the environment ID of the environment where the assistant is deployed, + * depending on the type of request: - For message, session, and log requests, specify the + * 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 + * assistant settings and scroll to the **Environments** section. * - *

**Note:** Currently, the v2 API does not support creating assistants. + *

**Note:** If you are using the classic Watson Assistant experience, always use the assistant + * ID. To find the assistant ID in the user interface, open the assistant settings and click API + * Details. * * @return the assistantId */ diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ListReleasesOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ListReleasesOptions.java index 0af6d0ec554..23e20b97354 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ListReleasesOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ListReleasesOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -44,6 +44,11 @@ public static class Builder { private String cursor; private Boolean includeAudit; + /** + * Instantiates a new Builder from an existing ListReleasesOptions instance. + * + * @param listReleasesOptions the instance to initialize the Builder with + */ private Builder(ListReleasesOptions listReleasesOptions) { this.assistantId = listReleasesOptions.assistantId; this.pageLimit = listReleasesOptions.pageLimit; @@ -166,12 +171,17 @@ public Builder newBuilder() { /** * Gets the assistantId. * - *

Unique identifier of the assistant. To find the assistant ID in the Watson Assistant user - * interface, open the assistant settings and click **API Details**. For information about - * creating assistants, see the - * [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-assistant-add#assistant-add-task). + *

The assistant ID or the environment ID of the environment where the assistant is deployed, + * depending on the type of request: - For message, session, and log requests, specify the + * 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 + * assistant settings and scroll to the **Environments** section. * - *

**Note:** Currently, the v2 API does not support creating assistants. + *

**Note:** If you are using the classic Watson Assistant experience, always use the assistant + * ID. To find the assistant ID in the user interface, open the assistant settings and click API + * Details. * * @return the assistantId */ diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/Log.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/Log.java index 11e7f03c207..cbb40ac1464 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/Log.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/Log.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -46,6 +46,8 @@ public class Log extends GenericModel { @SerializedName("customer_id") protected String customerId; + protected Log() {} + /** * Gets the logId. * diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/LogCollection.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/LogCollection.java index b331207d4fc..03a63277512 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/LogCollection.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/LogCollection.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2023. * * 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,8 @@ public class LogCollection extends GenericModel { protected List logs; protected LogPagination pagination; + protected LogCollection() {} + /** * Gets the logs. * @@ -35,7 +37,8 @@ public List getLogs() { /** * Gets the pagination. * - *

The pagination data for the returned objects. + *

The pagination data for the returned objects. For more information about using pagination, + * see [Pagination](#pagination). * * @return the pagination */ diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/LogMessageSourceAction.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/LogMessageSourceAction.java index 9cabc376c6a..23ed094889a 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/LogMessageSourceAction.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/LogMessageSourceAction.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -13,4 +13,7 @@ package com.ibm.watson.assistant.v2.model; /** An object that identifies the dialog element that generated the error message. */ -public class LogMessageSourceAction extends LogMessageSource {} +public class LogMessageSourceAction extends LogMessageSource { + + protected LogMessageSourceAction() {} +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/LogMessageSourceDialogNode.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/LogMessageSourceDialogNode.java index a6a1e3421af..0e91c8105ef 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/LogMessageSourceDialogNode.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/LogMessageSourceDialogNode.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -13,4 +13,7 @@ package com.ibm.watson.assistant.v2.model; /** An object that identifies the dialog element that generated the error message. */ -public class LogMessageSourceDialogNode extends LogMessageSource {} +public class LogMessageSourceDialogNode extends LogMessageSource { + + protected LogMessageSourceDialogNode() {} +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/LogMessageSourceHandler.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/LogMessageSourceHandler.java index ce3468410b7..5c3a92726a5 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/LogMessageSourceHandler.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/LogMessageSourceHandler.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -13,4 +13,7 @@ package com.ibm.watson.assistant.v2.model; /** An object that identifies the dialog element that generated the error message. */ -public class LogMessageSourceHandler extends LogMessageSource {} +public class LogMessageSourceHandler extends LogMessageSource { + + protected LogMessageSourceHandler() {} +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/LogMessageSourceStep.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/LogMessageSourceStep.java index 74663779a47..bc28052fea9 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/LogMessageSourceStep.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/LogMessageSourceStep.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -13,4 +13,7 @@ package com.ibm.watson.assistant.v2.model; /** An object that identifies the dialog element that generated the error message. */ -public class LogMessageSourceStep extends LogMessageSource {} +public class LogMessageSourceStep extends LogMessageSource { + + protected LogMessageSourceStep() {} +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/LogPagination.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/LogPagination.java index 00a9dbcd0ac..7085181a329 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/LogPagination.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/LogPagination.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -15,7 +15,10 @@ import com.google.gson.annotations.SerializedName; import com.ibm.cloud.sdk.core.service.model.GenericModel; -/** The pagination data for the returned objects. */ +/** + * The pagination data for the returned objects. For more information about using pagination, see + * [Pagination](#pagination). + */ public class LogPagination extends GenericModel { @SerializedName("next_url") @@ -26,6 +29,8 @@ public class LogPagination extends GenericModel { @SerializedName("next_cursor") protected String nextCursor; + protected LogPagination() {} + /** * Gets the nextUrl. * diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageContext.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageContext.java index aaeb239ef68..a23d31e57ce 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageContext.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageContext.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2022. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -19,15 +19,20 @@ public class MessageContext extends GenericModel { protected MessageContextGlobal global; - protected Map skills; + protected MessageContextSkills skills; protected Map integrations; /** Builder. */ public static class Builder { private MessageContextGlobal global; - private Map skills; + private MessageContextSkills skills; private Map integrations; + /** + * Instantiates a new Builder from an existing MessageContext instance. + * + * @param messageContext the instance to initialize the Builder with + */ private Builder(MessageContext messageContext) { this.global = messageContext.global; this.skills = messageContext.skills; @@ -63,7 +68,7 @@ public Builder global(MessageContextGlobal global) { * @param skills the skills * @return the MessageContext builder */ - public Builder skills(Map skills) { + public Builder skills(MessageContextSkills skills) { this.skills = skills; return this; } @@ -111,11 +116,11 @@ public MessageContextGlobal global() { /** * Gets the skills. * - *

Information specific to particular skills used by the assistant. + *

Context data specific to particular skills used by the assistant. * * @return the skills */ - public Map skills() { + public MessageContextSkills skills() { return skills; } diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageContextGlobal.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageContextGlobal.java index 005cf9f0d41..cf9e19edfe2 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageContextGlobal.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageContextGlobal.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2022. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -27,6 +27,11 @@ public class MessageContextGlobal extends GenericModel { public static class Builder { private MessageContextGlobalSystem system; + /** + * Instantiates a new Builder from an existing MessageContextGlobal instance. + * + * @param messageContextGlobal the instance to initialize the Builder with + */ private Builder(MessageContextGlobal messageContextGlobal) { this.system = messageContextGlobal.system; } diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageContextGlobalStateless.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageContextGlobalStateless.java index eccba45db06..cfe09d3a9fa 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageContextGlobalStateless.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageContextGlobalStateless.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020, 2022. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -28,6 +28,11 @@ public static class Builder { private MessageContextGlobalSystem system; private String sessionId; + /** + * Instantiates a new Builder from an existing MessageContextGlobalStateless instance. + * + * @param messageContextGlobalStateless the instance to initialize the Builder with + */ private Builder(MessageContextGlobalStateless messageContextGlobalStateless) { this.system = messageContextGlobalStateless.system; this.sessionId = messageContextGlobalStateless.sessionId; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageContextGlobalSystem.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageContextGlobalSystem.java index 84d709cad69..d47c3545453 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageContextGlobalSystem.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageContextGlobalSystem.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2022. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -91,6 +91,11 @@ public static class Builder { private String state; private Boolean skipUserInput; + /** + * Instantiates a new Builder from an existing MessageContextGlobalSystem instance. + * + * @param messageContextGlobalSystem the instance to initialize the Builder with + */ private Builder(MessageContextGlobalSystem messageContextGlobalSystem) { this.timezone = messageContextGlobalSystem.timezone; this.userId = messageContextGlobalSystem.userId; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageContextSkillAction.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageContextSkillAction.java new file mode 100644 index 00000000000..199bebea720 --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageContextSkillAction.java @@ -0,0 +1,174 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.watson.assistant.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; +import java.util.Map; + +/** Context variables that are used by the action skill. */ +public class MessageContextSkillAction extends GenericModel { + + @SerializedName("user_defined") + protected Map userDefined; + + protected MessageContextSkillSystem system; + + @SerializedName("action_variables") + protected Map actionVariables; + + @SerializedName("skill_variables") + protected Map skillVariables; + + /** Builder. */ + public static class Builder { + private Map userDefined; + private MessageContextSkillSystem system; + private Map actionVariables; + private Map skillVariables; + + /** + * Instantiates a new Builder from an existing MessageContextSkillAction instance. + * + * @param messageContextSkillAction the instance to initialize the Builder with + */ + private Builder(MessageContextSkillAction messageContextSkillAction) { + this.userDefined = messageContextSkillAction.userDefined; + this.system = messageContextSkillAction.system; + this.actionVariables = messageContextSkillAction.actionVariables; + this.skillVariables = messageContextSkillAction.skillVariables; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Builds a MessageContextSkillAction. + * + * @return the new MessageContextSkillAction instance + */ + public MessageContextSkillAction build() { + return new MessageContextSkillAction(this); + } + + /** + * Set the userDefined. + * + * @param userDefined the userDefined + * @return the MessageContextSkillAction builder + */ + public Builder userDefined(Map userDefined) { + this.userDefined = userDefined; + return this; + } + + /** + * Set the system. + * + * @param system the system + * @return the MessageContextSkillAction builder + */ + public Builder system(MessageContextSkillSystem system) { + this.system = system; + return this; + } + + /** + * Set the actionVariables. + * + * @param actionVariables the actionVariables + * @return the MessageContextSkillAction builder + */ + public Builder actionVariables(Map actionVariables) { + this.actionVariables = actionVariables; + return this; + } + + /** + * Set the skillVariables. + * + * @param skillVariables the skillVariables + * @return the MessageContextSkillAction builder + */ + public Builder skillVariables(Map skillVariables) { + this.skillVariables = skillVariables; + return this; + } + } + + protected MessageContextSkillAction() {} + + protected MessageContextSkillAction(Builder builder) { + userDefined = builder.userDefined; + system = builder.system; + actionVariables = builder.actionVariables; + skillVariables = builder.skillVariables; + } + + /** + * New builder. + * + * @return a MessageContextSkillAction builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the userDefined. + * + *

An object containing any arbitrary variables that can be read and written by a particular + * skill. + * + * @return the userDefined + */ + public Map userDefined() { + return userDefined; + } + + /** + * Gets the system. + * + *

System context data used by the skill. + * + * @return the system + */ + public MessageContextSkillSystem system() { + return system; + } + + /** + * Gets the actionVariables. + * + *

An object containing action variables. Action variables can be accessed only by steps in the + * same action, and do not persist after the action ends. + * + * @return the actionVariables + */ + public Map actionVariables() { + return actionVariables; + } + + /** + * Gets the skillVariables. + * + *

An object containing skill variables. (In the Watson Assistant user interface, skill + * variables are called _session variables_.) Skill variables can be accessed by any action and + * persist for the duration of the session. + * + * @return the skillVariables + */ + public Map skillVariables() { + return skillVariables; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageContextSkillDialog.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageContextSkillDialog.java new file mode 100644 index 00000000000..8cc5e41fb47 --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageContextSkillDialog.java @@ -0,0 +1,115 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.watson.assistant.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; +import java.util.Map; + +/** Context variables that are used by the dialog skill. */ +public class MessageContextSkillDialog extends GenericModel { + + @SerializedName("user_defined") + protected Map userDefined; + + protected MessageContextSkillSystem system; + + /** Builder. */ + public static class Builder { + private Map userDefined; + private MessageContextSkillSystem system; + + /** + * Instantiates a new Builder from an existing MessageContextSkillDialog instance. + * + * @param messageContextSkillDialog the instance to initialize the Builder with + */ + private Builder(MessageContextSkillDialog messageContextSkillDialog) { + this.userDefined = messageContextSkillDialog.userDefined; + this.system = messageContextSkillDialog.system; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Builds a MessageContextSkillDialog. + * + * @return the new MessageContextSkillDialog instance + */ + public MessageContextSkillDialog build() { + return new MessageContextSkillDialog(this); + } + + /** + * Set the userDefined. + * + * @param userDefined the userDefined + * @return the MessageContextSkillDialog builder + */ + public Builder userDefined(Map userDefined) { + this.userDefined = userDefined; + return this; + } + + /** + * Set the system. + * + * @param system the system + * @return the MessageContextSkillDialog builder + */ + public Builder system(MessageContextSkillSystem system) { + this.system = system; + return this; + } + } + + protected MessageContextSkillDialog() {} + + protected MessageContextSkillDialog(Builder builder) { + userDefined = builder.userDefined; + system = builder.system; + } + + /** + * New builder. + * + * @return a MessageContextSkillDialog builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the userDefined. + * + *

An object containing any arbitrary variables that can be read and written by a particular + * skill. + * + * @return the userDefined + */ + public Map userDefined() { + return userDefined; + } + + /** + * Gets the system. + * + *

System context data used by the skill. + * + * @return the system + */ + public MessageContextSkillSystem system() { + return system; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageContextSkillSystem.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageContextSkillSystem.java index de1651228ec..b52ae597f2b 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageContextSkillSystem.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageContextSkillSystem.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2023. * * 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,11 @@ public static class Builder { private String state; private Map dynamicProperties; + /** + * Instantiates a new Builder from an existing MessageContextSkillSystem instance. + * + * @param messageContextSkillSystem the instance to initialize the Builder with + */ private Builder(MessageContextSkillSystem messageContextSkillSystem) { this.state = messageContextSkillSystem.state; this.dynamicProperties = messageContextSkillSystem.getProperties(); diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageContextSkills.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageContextSkills.java new file mode 100644 index 00000000000..d931ab8130f --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageContextSkills.java @@ -0,0 +1,114 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.watson.assistant.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** Context data specific to particular skills used by the assistant. */ +public class MessageContextSkills extends GenericModel { + + @SerializedName("main skill") + protected MessageContextSkillDialog mainSkill; + + @SerializedName("actions skill") + protected MessageContextSkillAction actionsSkill; + + /** Builder. */ + public static class Builder { + private MessageContextSkillDialog mainSkill; + private MessageContextSkillAction actionsSkill; + + /** + * Instantiates a new Builder from an existing MessageContextSkills instance. + * + * @param messageContextSkills the instance to initialize the Builder with + */ + private Builder(MessageContextSkills messageContextSkills) { + this.mainSkill = messageContextSkills.mainSkill; + this.actionsSkill = messageContextSkills.actionsSkill; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Builds a MessageContextSkills. + * + * @return the new MessageContextSkills instance + */ + public MessageContextSkills build() { + return new MessageContextSkills(this); + } + + /** + * Set the mainSkill. + * + * @param mainSkill the mainSkill + * @return the MessageContextSkills builder + */ + public Builder mainSkill(MessageContextSkillDialog mainSkill) { + this.mainSkill = mainSkill; + return this; + } + + /** + * Set the actionsSkill. + * + * @param actionsSkill the actionsSkill + * @return the MessageContextSkills builder + */ + public Builder actionsSkill(MessageContextSkillAction actionsSkill) { + this.actionsSkill = actionsSkill; + return this; + } + } + + protected MessageContextSkills() {} + + protected MessageContextSkills(Builder builder) { + mainSkill = builder.mainSkill; + actionsSkill = builder.actionsSkill; + } + + /** + * New builder. + * + * @return a MessageContextSkills builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the mainSkill. + * + *

Context variables that are used by the dialog skill. + * + * @return the mainSkill + */ + public MessageContextSkillDialog mainSkill() { + return mainSkill; + } + + /** + * Gets the actionsSkill. + * + *

Context variables that are used by the action skill. + * + * @return the actionsSkill + */ + public MessageContextSkillAction actionsSkill() { + return actionsSkill; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageContextStateless.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageContextStateless.java index b8259c9ce36..0bf45d3263f 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageContextStateless.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageContextStateless.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020, 2022. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -19,15 +19,20 @@ public class MessageContextStateless extends GenericModel { protected MessageContextGlobalStateless global; - protected Map skills; + protected MessageContextSkills skills; protected Map integrations; /** Builder. */ public static class Builder { private MessageContextGlobalStateless global; - private Map skills; + private MessageContextSkills skills; private Map integrations; + /** + * Instantiates a new Builder from an existing MessageContextStateless instance. + * + * @param messageContextStateless the instance to initialize the Builder with + */ private Builder(MessageContextStateless messageContextStateless) { this.global = messageContextStateless.global; this.skills = messageContextStateless.skills; @@ -63,7 +68,7 @@ public Builder global(MessageContextGlobalStateless global) { * @param skills the skills * @return the MessageContextStateless builder */ - public Builder skills(Map skills) { + public Builder skills(MessageContextSkills skills) { this.skills = skills; return this; } @@ -111,11 +116,11 @@ public MessageContextGlobalStateless global() { /** * Gets the skills. * - *

Information specific to particular skills used by the assistant. + *

Context data specific to particular skills used by the assistant. * * @return the skills */ - public Map skills() { + public MessageContextSkills skills() { return skills; } diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageInput.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageInput.java index 0889034cf8c..daaaf082c03 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageInput.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageInput.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2022. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -24,7 +24,7 @@ public class MessageInput extends GenericModel { * The type of the message: * *

- `text`: The user input is processed normally by the assistant. - `search`: Only search - * results are returned. (Any dialog or actions skill is bypassed.) + * results are returned. (Any dialog or action skill is bypassed.) * *

**Note:** A `search` message results in an error if no search skill is configured for the * assistant. @@ -47,6 +47,7 @@ public interface MessageType { protected String suggestionId; protected List attachments; + protected RequestAnalytics analytics; protected MessageInputOptions options; /** Builder. */ @@ -57,8 +58,14 @@ public static class Builder { private List entities; private String suggestionId; private List attachments; + private RequestAnalytics analytics; private MessageInputOptions options; + /** + * Instantiates a new Builder from an existing MessageInput instance. + * + * @param messageInput the instance to initialize the Builder with + */ private Builder(MessageInput messageInput) { this.messageType = messageInput.messageType; this.text = messageInput.text; @@ -66,6 +73,7 @@ private Builder(MessageInput messageInput) { this.entities = messageInput.entities; this.suggestionId = messageInput.suggestionId; this.attachments = messageInput.attachments; + this.analytics = messageInput.analytics; this.options = messageInput.options; } @@ -192,6 +200,17 @@ public Builder attachments(List attachments) { return this; } + /** + * Set the analytics. + * + * @param analytics the analytics + * @return the MessageInput builder + */ + public Builder analytics(RequestAnalytics analytics) { + this.analytics = analytics; + return this; + } + /** * Set the options. * @@ -213,6 +232,7 @@ protected MessageInput(Builder builder) { entities = builder.entities; suggestionId = builder.suggestionId; attachments = builder.attachments; + analytics = builder.analytics; options = builder.options; } @@ -231,7 +251,7 @@ public Builder newBuilder() { *

The type of the message: * *

- `text`: The user input is processed normally by the assistant. - `search`: Only search - * results are returned. (Any dialog or actions skill is bypassed.) + * results are returned. (Any dialog or action skill is bypassed.) * *

**Note:** A `search` message results in an error if no search skill is configured for the * assistant. @@ -292,10 +312,10 @@ public String suggestionId() { /** * Gets the attachments. * - *

An array of multimedia attachments to be sent with the message. + *

An array of multimedia attachments to be sent with the message. Attachments are not + * processed by the assistant itself, but can be sent to external services by webhooks. * - *

**Note:** Attachments are not processed by the assistant itself, but can be sent to external - * services by webhooks. + *

**Note:** Attachments are not supported on IBM Cloud Pak for Data. * * @return the attachments */ @@ -303,6 +323,18 @@ public List attachments() { return attachments; } + /** + * Gets the analytics. + * + *

An optional object containing analytics data. Currently, this data is used only for events + * sent to the Segment extension. + * + * @return the analytics + */ + public RequestAnalytics analytics() { + return analytics; + } + /** * Gets the options. * diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageInputAttachment.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageInputAttachment.java index 06c9c1dfc3b..f4dd7298548 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageInputAttachment.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageInputAttachment.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -28,6 +28,11 @@ public static class Builder { private String url; private String mediaType; + /** + * Instantiates a new Builder from an existing MessageInputAttachment instance. + * + * @param messageInputAttachment the instance to initialize the Builder with + */ private Builder(MessageInputAttachment messageInputAttachment) { this.url = messageInputAttachment.url; this.mediaType = messageInputAttachment.mediaType; 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 5259f73dd1d..f8eb6d88724 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, 2022. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -40,6 +40,11 @@ public static class Builder { private Boolean returnContext; private Boolean export; + /** + * Instantiates a new Builder from an existing MessageInputOptions instance. + * + * @param messageInputOptions the instance to initialize the Builder with + */ private Builder(MessageInputOptions messageInputOptions) { this.restart = messageInputOptions.restart; this.alternateIntents = messageInputOptions.alternateIntents; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageInputOptionsSpelling.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageInputOptionsSpelling.java index 9aaa8cd052c..25f52d3ae5b 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageInputOptionsSpelling.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageInputOptionsSpelling.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020, 2022. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -31,6 +31,11 @@ public static class Builder { private Boolean suggestions; private Boolean autoCorrect; + /** + * Instantiates a new Builder from an existing MessageInputOptionsSpelling instance. + * + * @param messageInputOptionsSpelling the instance to initialize the Builder with + */ private Builder(MessageInputOptionsSpelling messageInputOptionsSpelling) { this.suggestions = messageInputOptionsSpelling.suggestions; this.autoCorrect = messageInputOptionsSpelling.autoCorrect; 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 b7814f4f1f6..efde5e8f959 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 @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020, 2022. + * (C) Copyright IBM Corp. 2023. * * 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,11 @@ public static class Builder { private MessageInputOptionsSpelling spelling; private Boolean debug; + /** + * Instantiates a new Builder from an existing MessageInputOptionsStateless instance. + * + * @param messageInputOptionsStateless the instance to initialize the Builder with + */ private Builder(MessageInputOptionsStateless messageInputOptionsStateless) { this.restart = messageInputOptionsStateless.restart; this.alternateIntents = messageInputOptionsStateless.alternateIntents; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageInputStateless.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageInputStateless.java index 14e75b5a425..bbd6012c21f 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageInputStateless.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageInputStateless.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020, 2022. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -24,7 +24,7 @@ public class MessageInputStateless extends GenericModel { * The type of the message: * *

- `text`: The user input is processed normally by the assistant. - `search`: Only search - * results are returned. (Any dialog or actions skill is bypassed.) + * results are returned. (Any dialog or action skill is bypassed.) * *

**Note:** A `search` message results in an error if no search skill is configured for the * assistant. @@ -47,6 +47,7 @@ public interface MessageType { protected String suggestionId; protected List attachments; + protected RequestAnalytics analytics; protected MessageInputOptionsStateless options; /** Builder. */ @@ -57,8 +58,14 @@ public static class Builder { private List entities; private String suggestionId; private List attachments; + private RequestAnalytics analytics; private MessageInputOptionsStateless options; + /** + * Instantiates a new Builder from an existing MessageInputStateless instance. + * + * @param messageInputStateless the instance to initialize the Builder with + */ private Builder(MessageInputStateless messageInputStateless) { this.messageType = messageInputStateless.messageType; this.text = messageInputStateless.text; @@ -66,6 +73,7 @@ private Builder(MessageInputStateless messageInputStateless) { this.entities = messageInputStateless.entities; this.suggestionId = messageInputStateless.suggestionId; this.attachments = messageInputStateless.attachments; + this.analytics = messageInputStateless.analytics; this.options = messageInputStateless.options; } @@ -192,6 +200,17 @@ public Builder attachments(List attachments) { return this; } + /** + * Set the analytics. + * + * @param analytics the analytics + * @return the MessageInputStateless builder + */ + public Builder analytics(RequestAnalytics analytics) { + this.analytics = analytics; + return this; + } + /** * Set the options. * @@ -213,6 +232,7 @@ protected MessageInputStateless(Builder builder) { entities = builder.entities; suggestionId = builder.suggestionId; attachments = builder.attachments; + analytics = builder.analytics; options = builder.options; } @@ -231,7 +251,7 @@ public Builder newBuilder() { *

The type of the message: * *

- `text`: The user input is processed normally by the assistant. - `search`: Only search - * results are returned. (Any dialog or actions skill is bypassed.) + * results are returned. (Any dialog or action skill is bypassed.) * *

**Note:** A `search` message results in an error if no search skill is configured for the * assistant. @@ -292,10 +312,10 @@ public String suggestionId() { /** * Gets the attachments. * - *

An array of multimedia attachments to be sent with the message. + *

An array of multimedia attachments to be sent with the message. Attachments are not + * processed by the assistant itself, but can be sent to external services by webhooks. * - *

**Note:** Attachments are not processed by the assistant itself, but can be sent to external - * services by webhooks. + *

**Note:** Attachments are not supported on IBM Cloud Pak for Data. * * @return the attachments */ @@ -303,6 +323,18 @@ public List attachments() { return attachments; } + /** + * Gets the analytics. + * + *

An optional object containing analytics data. Currently, this data is used only for events + * sent to the Segment extension. + * + * @return the analytics + */ + public RequestAnalytics analytics() { + return analytics; + } + /** * Gets the options. * diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOptions.java index 4987a3ca4cb..042df7ddf42 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2022. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -31,6 +31,11 @@ public static class Builder { private MessageContext context; private String userId; + /** + * Instantiates a new Builder from an existing MessageOptions instance. + * + * @param messageOptions the instance to initialize the Builder with + */ private Builder(MessageOptions messageOptions) { this.assistantId = messageOptions.assistantId; this.sessionId = messageOptions.sessionId; @@ -156,12 +161,17 @@ public Builder newBuilder() { /** * Gets the assistantId. * - *

Unique identifier of the assistant. To find the assistant ID in the Watson Assistant user - * interface, open the assistant settings and click **API Details**. For information about - * creating assistants, see the - * [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-assistant-add#assistant-add-task). + *

The assistant ID or the environment ID of the environment where the assistant is deployed, + * depending on the type of request: - For message, session, and log requests, specify the + * 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 + * assistant settings and scroll to the **Environments** section. * - *

**Note:** Currently, the v2 API does not support creating assistants. + *

**Note:** If you are using the classic Watson Assistant experience, always use the assistant + * ID. To find the assistant ID in the user interface, open the assistant settings and click API + * Details. * * @return the assistantId */ diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutput.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutput.java index a1c7e17842d..3bade25da81 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutput.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutput.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2020. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -31,6 +31,8 @@ public class MessageOutput extends GenericModel { protected MessageOutputSpelling spelling; + protected MessageOutput() {} + /** * Gets the generic. * diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebug.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebug.java index 83ed5cd6746..bfab465090c 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebug.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebug.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2022. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -45,6 +45,8 @@ public interface BranchExitedReason { @SerializedName("turn_events") protected List turnEvents; + protected MessageOutputDebug() {} + /** * Gets the nodesVisited. * @@ -97,7 +99,7 @@ public String getBranchExitedReason() { *

An array of objects containing detailed diagnostic information about dialog nodes and * actions that were visited during processing of the input message. * - *

This property is present only if the assistant has an actions skill. + *

This property is present only if the assistant has an action skill. * * @return the turnEvents */ diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEvent.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEvent.java index 3e6714d242b..e53405266e3 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEvent.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEvent.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -81,6 +81,7 @@ public interface Reason { } protected String event; + protected TurnEventActionSource source; @SerializedName("action_start_time") protected String actionStartTime; @@ -90,6 +91,9 @@ public interface Reason { protected String reason; + @SerializedName("result_variable") + protected String resultVariable; + @SerializedName("action_variables") protected Map actionVariables; @@ -98,6 +102,7 @@ public interface Reason { protected Boolean prompted; protected TurnEventCalloutCallout callout; + protected TurnEventCalloutError error; protected MessageOutputDebugTurnEvent() {} @@ -112,6 +117,15 @@ public String getEvent() { return event; } + /** + * Gets the source. + * + * @return the source + */ + public TurnEventActionSource getSource() { + return source; + } + /** * Gets the actionStartTime. * @@ -145,6 +159,18 @@ public String getReason() { return reason; } + /** + * Gets the resultVariable. + * + *

The variable where the result of the call to the action is stored. Included only if + * **reason**=`subaction_return`. + * + * @return the resultVariable + */ + public String getResultVariable() { + return resultVariable; + } + /** * Gets the actionVariables. * @@ -187,4 +213,13 @@ public Boolean isPrompted() { public TurnEventCalloutCallout getCallout() { return callout; } + + /** + * Gets the error. + * + * @return the error + */ + public TurnEventCalloutError getError() { + return error; + } } diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEventTurnEventActionFinished.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEventTurnEventActionFinished.java index 6152b71ebbf..73128159f31 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEventTurnEventActionFinished.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEventTurnEventActionFinished.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -16,8 +16,6 @@ public class MessageOutputDebugTurnEventTurnEventActionFinished extends MessageOutputDebugTurnEvent { - private TurnEventActionSource source; - /** The type of condition (if any) that is defined for the action. */ public interface ConditionType { /** user_defined. */ @@ -44,12 +42,5 @@ public interface Reason { String FALLBACK = "fallback"; } - /** - * Gets the source. - * - * @return the source - */ - public TurnEventActionSource getSource() { - return source; - } + protected MessageOutputDebugTurnEventTurnEventActionFinished() {} } diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEventTurnEventActionVisited.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEventTurnEventActionVisited.java index 0121e734ddd..906e6d468b3 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEventTurnEventActionVisited.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEventTurnEventActionVisited.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -15,8 +15,6 @@ /** MessageOutputDebugTurnEventTurnEventActionVisited. */ public class MessageOutputDebugTurnEventTurnEventActionVisited extends MessageOutputDebugTurnEvent { - private TurnEventActionSource source; - /** The type of condition (if any) that is defined for the action. */ public interface ConditionType { /** user_defined. */ @@ -49,12 +47,5 @@ public interface Reason { String NO_ACTION_MATCHES = "no_action_matches"; } - /** - * Gets the source. - * - * @return the source - */ - public TurnEventActionSource getSource() { - return source; - } + protected MessageOutputDebugTurnEventTurnEventActionVisited() {} } diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEventTurnEventCallout.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEventTurnEventCallout.java index aff421d32ce..be67906999f 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEventTurnEventCallout.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEventTurnEventCallout.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -15,24 +15,5 @@ /** MessageOutputDebugTurnEventTurnEventCallout. */ public class MessageOutputDebugTurnEventTurnEventCallout extends MessageOutputDebugTurnEvent { - private TurnEventActionSource source; - private TurnEventCalloutError error; - - /** - * Gets the source. - * - * @return the source - */ - public TurnEventActionSource getSource() { - return source; - } - - /** - * Gets the error. - * - * @return the error - */ - public TurnEventCalloutError getError() { - return error; - } + protected MessageOutputDebugTurnEventTurnEventCallout() {} } diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEventTurnEventHandlerVisited.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEventTurnEventHandlerVisited.java index 0f5b5c6d84b..830c56d55dd 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEventTurnEventHandlerVisited.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEventTurnEventHandlerVisited.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -16,14 +16,5 @@ public class MessageOutputDebugTurnEventTurnEventHandlerVisited extends MessageOutputDebugTurnEvent { - private TurnEventActionSource source; - - /** - * Gets the source. - * - * @return the source - */ - public TurnEventActionSource getSource() { - return source; - } + protected MessageOutputDebugTurnEventTurnEventHandlerVisited() {} } diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEventTurnEventNodeVisited.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEventTurnEventNodeVisited.java index 674972c27c7..60ffb02183b 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEventTurnEventNodeVisited.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEventTurnEventNodeVisited.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -15,8 +15,6 @@ /** MessageOutputDebugTurnEventTurnEventNodeVisited. */ public class MessageOutputDebugTurnEventTurnEventNodeVisited extends MessageOutputDebugTurnEvent { - private TurnEventNodeSource source; - /** The reason the dialog node was visited. */ public interface Reason { /** welcome. */ @@ -33,12 +31,5 @@ public interface Reason { String JUMP = "jump"; } - /** - * Gets the source. - * - * @return the source - */ - public TurnEventNodeSource getSource() { - return source; - } + protected MessageOutputDebugTurnEventTurnEventNodeVisited() {} } diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEventTurnEventSearch.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEventTurnEventSearch.java index a52143e1352..394f0a2fdbe 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEventTurnEventSearch.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEventTurnEventSearch.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -15,24 +15,5 @@ /** MessageOutputDebugTurnEventTurnEventSearch. */ public class MessageOutputDebugTurnEventTurnEventSearch extends MessageOutputDebugTurnEvent { - private TurnEventActionSource source; - private TurnEventSearchError error; - - /** - * Gets the source. - * - * @return the source - */ - public TurnEventActionSource getSource() { - return source; - } - - /** - * Gets the error. - * - * @return the error - */ - public TurnEventSearchError getError() { - return error; - } + protected MessageOutputDebugTurnEventTurnEventSearch() {} } diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEventTurnEventStepAnswered.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEventTurnEventStepAnswered.java index be00fc5144d..0d91ea6f347 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEventTurnEventStepAnswered.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEventTurnEventStepAnswered.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -15,7 +15,6 @@ /** MessageOutputDebugTurnEventTurnEventStepAnswered. */ public class MessageOutputDebugTurnEventTurnEventStepAnswered extends MessageOutputDebugTurnEvent { - private TurnEventActionSource source; /** The type of condition (if any) that is defined for the action. */ public interface ConditionType { /** user_defined. */ @@ -26,12 +25,5 @@ public interface ConditionType { String ANYTHING_ELSE = "anything_else"; } - /** - * Gets the source. - * - * @return the source - */ - public TurnEventActionSource getSource() { - return source; - } + protected MessageOutputDebugTurnEventTurnEventStepAnswered() {} } diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEventTurnEventStepVisited.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEventTurnEventStepVisited.java index 43e937dc39d..c04e7ee6211 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEventTurnEventStepVisited.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEventTurnEventStepVisited.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -15,8 +15,6 @@ /** MessageOutputDebugTurnEventTurnEventStepVisited. */ public class MessageOutputDebugTurnEventTurnEventStepVisited extends MessageOutputDebugTurnEvent { - private TurnEventActionSource source; - /** The type of condition (if any) that is defined for the action. */ public interface ConditionType { /** user_defined. */ @@ -27,12 +25,5 @@ public interface ConditionType { String ANYTHING_ELSE = "anything_else"; } - /** - * Gets the source. - * - * @return the source - */ - public TurnEventActionSource getSource() { - return source; - } + protected MessageOutputDebugTurnEventTurnEventStepVisited() {} } diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputSpelling.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputSpelling.java index bd582fe12c4..fe6fba22cf9 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputSpelling.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputSpelling.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -26,6 +26,8 @@ public class MessageOutputSpelling extends GenericModel { @SerializedName("suggested_text") protected String suggestedText; + protected MessageOutputSpelling() {} + /** * Gets the text. * diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageRequest.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageRequest.java index c6418da5824..6959e3c0849 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageRequest.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageRequest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020, 2022. + * (C) Copyright IBM Corp. 2023. * * 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,11 @@ public static class Builder { private MessageContext context; private String userId; + /** + * Instantiates a new Builder from an existing MessageRequest instance. + * + * @param messageRequest the instance to initialize the Builder with + */ private Builder(MessageRequest messageRequest) { this.input = messageRequest.input; this.context = messageRequest.context; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageResponse.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageResponse.java index ba03d6b5aab..89df4e682bb 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageResponse.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageResponse.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2021. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -24,6 +24,8 @@ public class MessageResponse extends GenericModel { @SerializedName("user_id") protected String userId; + protected MessageResponse() {} + /** * Gets the output. * diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageResponseStateless.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageResponseStateless.java index a15a9ca70c0..496ff98466a 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageResponseStateless.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageResponseStateless.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020, 2021. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -24,6 +24,8 @@ public class MessageResponseStateless extends GenericModel { @SerializedName("user_id") protected String userId; + protected MessageResponseStateless() {} + /** * Gets the output. * diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageStatelessOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageStatelessOptions.java index d0b78df9155..566dbcd0950 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageStatelessOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageStatelessOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020, 2022. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -29,6 +29,11 @@ public static class Builder { private MessageContextStateless context; private String userId; + /** + * Instantiates a new Builder from an existing MessageStatelessOptions instance. + * + * @param messageStatelessOptions the instance to initialize the Builder with + */ private Builder(MessageStatelessOptions messageStatelessOptions) { this.assistantId = messageStatelessOptions.assistantId; this.input = messageStatelessOptions.input; @@ -125,12 +130,17 @@ public Builder newBuilder() { /** * Gets the assistantId. * - *

Unique identifier of the assistant. To find the assistant ID in the Watson Assistant user - * interface, open the assistant settings and click **API Details**. For information about - * creating assistants, see the - * [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-assistant-add#assistant-add-task). + *

The assistant ID or the environment ID of the environment where the assistant is deployed, + * depending on the type of request: - For message, session, and log requests, specify the + * 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 + * assistant settings and scroll to the **Environments** section. * - *

**Note:** Currently, the v2 API does not support creating assistants. + *

**Note:** If you are using the classic Watson Assistant experience, always use the assistant + * ID. To find the assistant ID in the user interface, open the assistant settings and click API + * Details. * * @return the assistantId */ diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/Pagination.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/Pagination.java index 95590c3b9fa..238b3c0c873 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/Pagination.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/Pagination.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2022. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -15,7 +15,10 @@ import com.google.gson.annotations.SerializedName; import com.ibm.cloud.sdk.core.service.model.GenericModel; -/** The pagination data for the returned objects. */ +/** + * The pagination data for the returned objects. For more information about using pagination, see + * [Pagination](#pagination). + */ public class Pagination extends GenericModel { @SerializedName("refresh_url") @@ -33,6 +36,8 @@ public class Pagination extends GenericModel { @SerializedName("next_cursor") protected String nextCursor; + protected Pagination() {} + /** * Gets the refreshUrl. * diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/Release.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/Release.java index 691b352d9ff..3a78d92aeae 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/Release.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/Release.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -45,6 +45,58 @@ public interface Status { protected Date created; protected Date updated; + /** Builder. */ + public static class Builder { + private String description; + + /** + * Instantiates a new Builder from an existing Release instance. + * + * @param release the instance to initialize the Builder with + */ + private Builder(Release release) { + this.description = release.description; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Builds a Release. + * + * @return the new Release instance + */ + public Release build() { + return new Release(this); + } + + /** + * Set the description. + * + * @param description the description + * @return the Release builder + */ + public Builder description(String description) { + this.description = description; + return this; + } + } + + protected Release() {} + + protected Release(Builder builder) { + description = builder.description; + } + + /** + * New builder. + * + * @return a Release builder + */ + public Builder newBuilder() { + return new Builder(this); + } + /** * Gets the release. * @@ -52,7 +104,7 @@ public interface Status { * * @return the release */ - public String getRelease() { + public String release() { return release; } @@ -63,7 +115,7 @@ public String getRelease() { * * @return the description */ - public String getDescription() { + public String description() { return description; } @@ -74,19 +126,19 @@ public String getDescription() { * * @return the environmentReferences */ - public List getEnvironmentReferences() { + public List environmentReferences() { return environmentReferences; } /** * Gets the content. * - *

An object describing the versionable content objects (such as skill snapshots) that are + *

An object identifying the versionable content objects (such as skill snapshots) that are * included in the release. * * @return the content */ - public ReleaseContent getContent() { + public ReleaseContent content() { return content; } @@ -99,7 +151,7 @@ public ReleaseContent getContent() { * * @return the status */ - public String getStatus() { + public String status() { return status; } @@ -110,7 +162,7 @@ public String getStatus() { * * @return the created */ - public Date getCreated() { + public Date created() { return created; } @@ -121,7 +173,7 @@ public Date getCreated() { * * @return the updated */ - public Date getUpdated() { + public Date updated() { return updated; } } diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ReleaseCollection.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ReleaseCollection.java index be8b1ed9b9a..9a8a7c91816 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ReleaseCollection.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ReleaseCollection.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022. + * (C) Copyright IBM Corp. 2023. * * 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,8 @@ public class ReleaseCollection extends GenericModel { protected List releases; protected Pagination pagination; + protected ReleaseCollection() {} + /** * Gets the releases. * @@ -35,7 +37,8 @@ public List getReleases() { /** * Gets the pagination. * - *

The pagination data for the returned objects. + *

The pagination data for the returned objects. For more information about using pagination, + * see [Pagination](#pagination). * * @return the pagination */ diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ReleaseContent.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ReleaseContent.java index 081c9a9f58d..0541a3c51ff 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ReleaseContent.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ReleaseContent.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -16,12 +16,48 @@ import java.util.List; /** - * An object describing the versionable content objects (such as skill snapshots) that are included + * An object identifying the versionable content objects (such as skill snapshots) that are included * in the release. */ public class ReleaseContent extends GenericModel { - protected List skills; + protected List skills; + + /** Builder. */ + public static class Builder { + + /** + * Instantiates a new Builder from an existing ReleaseContent instance. + * + * @param releaseContent the instance to initialize the Builder with + */ + private Builder(ReleaseContent releaseContent) {} + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Builds a ReleaseContent. + * + * @return the new ReleaseContent instance + */ + public ReleaseContent build() { + return new ReleaseContent(this); + } + } + + protected ReleaseContent() {} + + protected ReleaseContent(Builder builder) {} + + /** + * New builder. + * + * @return a ReleaseContent builder + */ + public Builder newBuilder() { + return new Builder(this); + } /** * Gets the skills. @@ -30,7 +66,7 @@ public class ReleaseContent extends GenericModel { * * @return the skills */ - public List getSkills() { + public List skills() { return skills; } } diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ReleaseSkill.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ReleaseSkill.java new file mode 100644 index 00000000000..065408f99ce --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ReleaseSkill.java @@ -0,0 +1,160 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.watson.assistant.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** ReleaseSkill. */ +public class ReleaseSkill extends GenericModel { + + /** The type of the skill. */ + public interface Type { + /** dialog. */ + String DIALOG = "dialog"; + /** action. */ + String ACTION = "action"; + /** search. */ + String SEARCH = "search"; + } + + @SerializedName("skill_id") + protected String skillId; + + protected String type; + protected String snapshot; + + /** Builder. */ + public static class Builder { + private String skillId; + private String type; + private String snapshot; + + /** + * Instantiates a new Builder from an existing ReleaseSkill instance. + * + * @param releaseSkill the instance to initialize the Builder with + */ + private Builder(ReleaseSkill releaseSkill) { + this.skillId = releaseSkill.skillId; + this.type = releaseSkill.type; + this.snapshot = releaseSkill.snapshot; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Instantiates a new builder with required properties. + * + * @param skillId the skillId + */ + public Builder(String skillId) { + this.skillId = skillId; + } + + /** + * Builds a ReleaseSkill. + * + * @return the new ReleaseSkill instance + */ + public ReleaseSkill build() { + return new ReleaseSkill(this); + } + + /** + * Set the skillId. + * + * @param skillId the skillId + * @return the ReleaseSkill builder + */ + public Builder skillId(String skillId) { + this.skillId = skillId; + return this; + } + + /** + * Set the type. + * + * @param type the type + * @return the ReleaseSkill builder + */ + public Builder type(String type) { + this.type = type; + return this; + } + + /** + * Set the snapshot. + * + * @param snapshot the snapshot + * @return the ReleaseSkill builder + */ + public Builder snapshot(String snapshot) { + this.snapshot = snapshot; + return this; + } + } + + protected ReleaseSkill() {} + + protected ReleaseSkill(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.skillId, "skillId cannot be null"); + skillId = builder.skillId; + type = builder.type; + snapshot = builder.snapshot; + } + + /** + * New builder. + * + * @return a ReleaseSkill builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the skillId. + * + *

The skill ID of the skill. + * + * @return the skillId + */ + public String skillId() { + return skillId; + } + + /** + * Gets the type. + * + *

The type of the skill. + * + * @return the type + */ + public String type() { + return type; + } + + /** + * Gets the snapshot. + * + *

The name of the skill snapshot that is saved as part of the release (for example, `draft` or + * `1`). + * + * @return the snapshot + */ + public String snapshot() { + return snapshot; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RequestAnalytics.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RequestAnalytics.java new file mode 100644 index 00000000000..9b9f4cfbe98 --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RequestAnalytics.java @@ -0,0 +1,139 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.watson.assistant.v2.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * An optional object containing analytics data. Currently, this data is used only for events sent + * to the Segment extension. + */ +public class RequestAnalytics extends GenericModel { + + protected String browser; + protected String device; + protected String pageUrl; + + /** Builder. */ + public static class Builder { + private String browser; + private String device; + private String pageUrl; + + /** + * Instantiates a new Builder from an existing RequestAnalytics instance. + * + * @param requestAnalytics the instance to initialize the Builder with + */ + private Builder(RequestAnalytics requestAnalytics) { + this.browser = requestAnalytics.browser; + this.device = requestAnalytics.device; + this.pageUrl = requestAnalytics.pageUrl; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Builds a RequestAnalytics. + * + * @return the new RequestAnalytics instance + */ + public RequestAnalytics build() { + return new RequestAnalytics(this); + } + + /** + * Set the browser. + * + * @param browser the browser + * @return the RequestAnalytics builder + */ + public Builder browser(String browser) { + this.browser = browser; + return this; + } + + /** + * Set the device. + * + * @param device the device + * @return the RequestAnalytics builder + */ + public Builder device(String device) { + this.device = device; + return this; + } + + /** + * Set the pageUrl. + * + * @param pageUrl the pageUrl + * @return the RequestAnalytics builder + */ + public Builder pageUrl(String pageUrl) { + this.pageUrl = pageUrl; + return this; + } + } + + protected RequestAnalytics() {} + + protected RequestAnalytics(Builder builder) { + browser = builder.browser; + device = builder.device; + pageUrl = builder.pageUrl; + } + + /** + * New builder. + * + * @return a RequestAnalytics builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the browser. + * + *

The browser that was used to send the message that triggered the event. + * + * @return the browser + */ + public String browser() { + return browser; + } + + /** + * Gets the device. + * + *

The type of device that was used to send the message that triggered the event. + * + * @return the device + */ + public String device() { + return device; + } + + /** + * Gets the pageUrl. + * + *

The URL of the web page that was used to send the message that triggered the event. + * + * @return the pageUrl + */ + public String pageUrl() { + return pageUrl; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ResponseGenericChannel.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ResponseGenericChannel.java index 152ea900cb6..dad460844ef 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ResponseGenericChannel.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ResponseGenericChannel.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -19,6 +19,8 @@ public class ResponseGenericChannel extends GenericModel { protected String channel; + protected ResponseGenericChannel() {} + /** * Gets the channel. * diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeEntity.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeEntity.java index 74297b181b9..c7b87706125 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeEntity.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeEntity.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2022. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -41,6 +41,11 @@ public static class Builder { private RuntimeEntityRole role; private String skill; + /** + * Instantiates a new Builder from an existing RuntimeEntity instance. + * + * @param runtimeEntity the instance to initialize the Builder with + */ private Builder(RuntimeEntity runtimeEntity) { this.entity = runtimeEntity.entity; this.location = runtimeEntity.location; @@ -349,9 +354,9 @@ public RuntimeEntityRole role() { * Gets the skill. * *

The skill that recognized the entity value. Currently, the only possible values are `main - * skill` for the dialog skill (if enabled) and `actions skill` for the actions skill. + * skill` for the dialog skill (if enabled) and `actions skill` for the action skill. * - *

This property is present only if the assistant has both a dialog skill and an actions skill. + *

This property is present only if the assistant has both a dialog skill and an action skill. * * @return the skill */ diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeEntityAlternative.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeEntityAlternative.java index 078d9afa3cd..df924833539 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeEntityAlternative.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeEntityAlternative.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020, 2022. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -25,6 +25,11 @@ public static class Builder { private String value; private Double confidence; + /** + * Instantiates a new Builder from an existing RuntimeEntityAlternative instance. + * + * @param runtimeEntityAlternative the instance to initialize the Builder with + */ private Builder(RuntimeEntityAlternative runtimeEntityAlternative) { this.value = runtimeEntityAlternative.value; this.confidence = runtimeEntityAlternative.confidence; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeEntityInterpretation.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeEntityInterpretation.java index 89ffed3ade1..f5e5552ef54 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeEntityInterpretation.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeEntityInterpretation.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020, 2022. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -149,6 +149,11 @@ public static class Builder { private Double specificSecond; private String timezone; + /** + * Instantiates a new Builder from an existing RuntimeEntityInterpretation instance. + * + * @param runtimeEntityInterpretation the instance to initialize the Builder with + */ private Builder(RuntimeEntityInterpretation runtimeEntityInterpretation) { this.calendarType = runtimeEntityInterpretation.calendarType; this.datetimeLink = runtimeEntityInterpretation.datetimeLink; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeEntityRole.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeEntityRole.java index 5e90e3516f7..5223e5e118e 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeEntityRole.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeEntityRole.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020, 2022. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -43,6 +43,11 @@ public interface Type { public static class Builder { private String type; + /** + * Instantiates a new Builder from an existing RuntimeEntityRole instance. + * + * @param runtimeEntityRole the instance to initialize the Builder with + */ private Builder(RuntimeEntityRole runtimeEntityRole) { this.type = runtimeEntityRole.type; } diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeIntent.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeIntent.java index 3dbec7b6306..10c67cdb8eb 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeIntent.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeIntent.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2022. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -27,6 +27,11 @@ public static class Builder { private Double confidence; private String skill; + /** + * Instantiates a new Builder from an existing RuntimeIntent instance. + * + * @param runtimeIntent the instance to initialize the Builder with + */ private Builder(RuntimeIntent runtimeIntent) { this.intent = runtimeIntent.intent; this.confidence = runtimeIntent.confidence; @@ -134,9 +139,9 @@ public Double confidence() { * Gets the skill. * *

The skill that identified the intent. Currently, the only possible values are `main skill` - * for the dialog skill (if enabled) and `actions skill` for the actions skill. + * for the dialog skill (if enabled) and `actions skill` for the action skill. * - *

This property is present only if the assistant has both a dialog skill and an actions skill. + *

This property is present only if the assistant has both a dialog skill and an action skill. * * @return the skill */ diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGeneric.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGeneric.java index a8ccfb4ebd2..965d30bcc42 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGeneric.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGeneric.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2022. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -92,6 +92,9 @@ public interface Preference { @SerializedName("agent_unavailable") protected AgentAvailabilityMessage agentUnavailable; + @SerializedName("transfer_info") + protected DialogNodeOutputConnectToAgentTransferInfo transferInfo; + protected String topic; protected List suggestions; @@ -277,6 +280,17 @@ public AgentAvailabilityMessage agentUnavailable() { return agentUnavailable; } + /** + * Gets the transferInfo. + * + *

Routing or other contextual information to be used by target service desk systems. + * + * @return the transferInfo + */ + public DialogNodeOutputConnectToAgentTransferInfo transferInfo() { + return transferInfo; + } + /** * Gets the topic. * diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeAudio.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeAudio.java index 4010b6dbba2..7d6e3b9b4c3 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeAudio.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeAudio.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -13,4 +13,7 @@ package com.ibm.watson.assistant.v2.model; /** RuntimeResponseGenericRuntimeResponseTypeAudio. */ -public class RuntimeResponseGenericRuntimeResponseTypeAudio extends RuntimeResponseGeneric {} +public class RuntimeResponseGenericRuntimeResponseTypeAudio extends RuntimeResponseGeneric { + + protected RuntimeResponseGenericRuntimeResponseTypeAudio() {} +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeChannelTransfer.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeChannelTransfer.java index 0d7438510dd..bde10fb05a2 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeChannelTransfer.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeChannelTransfer.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2023. * * 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,23 +12,9 @@ */ package com.ibm.watson.assistant.v2.model; -import com.google.gson.annotations.SerializedName; - /** RuntimeResponseGenericRuntimeResponseTypeChannelTransfer. */ public class RuntimeResponseGenericRuntimeResponseTypeChannelTransfer extends RuntimeResponseGeneric { - @SerializedName("transfer_info") - protected ChannelTransferInfo transferInfo; - - /** - * Gets the transferInfo. - * - *

Routing or other contextual information to be used by target service desk systems. - * - * @return the transferInfo - */ - public ChannelTransferInfo transferInfo() { - return transferInfo; - } + protected RuntimeResponseGenericRuntimeResponseTypeChannelTransfer() {} } diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeConnectToAgent.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeConnectToAgent.java index e447cb8e8ba..52e94138ae4 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeConnectToAgent.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeConnectToAgent.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020, 2021. + * (C) Copyright IBM Corp. 2023. * * 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,23 +12,9 @@ */ package com.ibm.watson.assistant.v2.model; -import com.google.gson.annotations.SerializedName; - /** RuntimeResponseGenericRuntimeResponseTypeConnectToAgent. */ public class RuntimeResponseGenericRuntimeResponseTypeConnectToAgent extends RuntimeResponseGeneric { - @SerializedName("transfer_info") - protected DialogNodeOutputConnectToAgentTransferInfo transferInfo; - - /** - * Gets the transferInfo. - * - *

Routing or other contextual information to be used by target service desk systems. - * - * @return the transferInfo - */ - public DialogNodeOutputConnectToAgentTransferInfo transferInfo() { - return transferInfo; - } + protected RuntimeResponseGenericRuntimeResponseTypeConnectToAgent() {} } diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeDate.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeDate.java index bdc41b8082d..d7397b6494e 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeDate.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeDate.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -13,4 +13,7 @@ package com.ibm.watson.assistant.v2.model; /** RuntimeResponseGenericRuntimeResponseTypeDate. */ -public class RuntimeResponseGenericRuntimeResponseTypeDate extends RuntimeResponseGeneric {} +public class RuntimeResponseGenericRuntimeResponseTypeDate extends RuntimeResponseGeneric { + + protected RuntimeResponseGenericRuntimeResponseTypeDate() {} +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeIframe.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeIframe.java index 57eaa1cf02d..b0e6b883941 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeIframe.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeIframe.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -13,4 +13,7 @@ package com.ibm.watson.assistant.v2.model; /** RuntimeResponseGenericRuntimeResponseTypeIframe. */ -public class RuntimeResponseGenericRuntimeResponseTypeIframe extends RuntimeResponseGeneric {} +public class RuntimeResponseGenericRuntimeResponseTypeIframe extends RuntimeResponseGeneric { + + protected RuntimeResponseGenericRuntimeResponseTypeIframe() {} +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeImage.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeImage.java index 895c837f872..2e50d1925ef 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeImage.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeImage.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020, 2021. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -13,4 +13,7 @@ package com.ibm.watson.assistant.v2.model; /** RuntimeResponseGenericRuntimeResponseTypeImage. */ -public class RuntimeResponseGenericRuntimeResponseTypeImage extends RuntimeResponseGeneric {} +public class RuntimeResponseGenericRuntimeResponseTypeImage extends RuntimeResponseGeneric { + + protected RuntimeResponseGenericRuntimeResponseTypeImage() {} +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeOption.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeOption.java index bc569fa9d66..e09c91e5801 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeOption.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeOption.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020, 2021. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -22,4 +22,6 @@ public interface Preference { /** button. */ String BUTTON = "button"; } + + protected RuntimeResponseGenericRuntimeResponseTypeOption() {} } diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypePause.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypePause.java index d0bf32811dc..e3ff42739ee 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypePause.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypePause.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020, 2021. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -13,4 +13,7 @@ package com.ibm.watson.assistant.v2.model; /** RuntimeResponseGenericRuntimeResponseTypePause. */ -public class RuntimeResponseGenericRuntimeResponseTypePause extends RuntimeResponseGeneric {} +public class RuntimeResponseGenericRuntimeResponseTypePause extends RuntimeResponseGeneric { + + protected RuntimeResponseGenericRuntimeResponseTypePause() {} +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeSearch.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeSearch.java index 2e5adc83ebc..c307c2834c2 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeSearch.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeSearch.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020, 2021. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -13,4 +13,7 @@ package com.ibm.watson.assistant.v2.model; /** RuntimeResponseGenericRuntimeResponseTypeSearch. */ -public class RuntimeResponseGenericRuntimeResponseTypeSearch extends RuntimeResponseGeneric {} +public class RuntimeResponseGenericRuntimeResponseTypeSearch extends RuntimeResponseGeneric { + + protected RuntimeResponseGenericRuntimeResponseTypeSearch() {} +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeSuggestion.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeSuggestion.java index 6c86add564f..64007c834c5 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeSuggestion.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeSuggestion.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020, 2021. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -13,4 +13,7 @@ package com.ibm.watson.assistant.v2.model; /** RuntimeResponseGenericRuntimeResponseTypeSuggestion. */ -public class RuntimeResponseGenericRuntimeResponseTypeSuggestion extends RuntimeResponseGeneric {} +public class RuntimeResponseGenericRuntimeResponseTypeSuggestion extends RuntimeResponseGeneric { + + protected RuntimeResponseGenericRuntimeResponseTypeSuggestion() {} +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeText.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeText.java index 7a8964ce6fd..8d43a584293 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeText.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeText.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020, 2021. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -13,4 +13,7 @@ package com.ibm.watson.assistant.v2.model; /** RuntimeResponseGenericRuntimeResponseTypeText. */ -public class RuntimeResponseGenericRuntimeResponseTypeText extends RuntimeResponseGeneric {} +public class RuntimeResponseGenericRuntimeResponseTypeText extends RuntimeResponseGeneric { + + protected RuntimeResponseGenericRuntimeResponseTypeText() {} +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeUserDefined.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeUserDefined.java index f8401523431..8ff6953e64e 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeUserDefined.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeUserDefined.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -13,4 +13,7 @@ package com.ibm.watson.assistant.v2.model; /** RuntimeResponseGenericRuntimeResponseTypeUserDefined. */ -public class RuntimeResponseGenericRuntimeResponseTypeUserDefined extends RuntimeResponseGeneric {} +public class RuntimeResponseGenericRuntimeResponseTypeUserDefined extends RuntimeResponseGeneric { + + protected RuntimeResponseGenericRuntimeResponseTypeUserDefined() {} +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeVideo.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeVideo.java index 1b1c0e964a2..188ebf46850 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeVideo.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeVideo.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -13,4 +13,7 @@ package com.ibm.watson.assistant.v2.model; /** RuntimeResponseGenericRuntimeResponseTypeVideo. */ -public class RuntimeResponseGenericRuntimeResponseTypeVideo extends RuntimeResponseGeneric {} +public class RuntimeResponseGenericRuntimeResponseTypeVideo extends RuntimeResponseGeneric { + + protected RuntimeResponseGenericRuntimeResponseTypeVideo() {} +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchResult.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchResult.java index b784d651f86..a30164843d9 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchResult.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchResult.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2021. + * (C) Copyright IBM Corp. 2023. * * 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,8 @@ public class SearchResult extends GenericModel { protected SearchResultHighlight highlight; protected List answers; + protected SearchResult() {} + /** * Gets the id. * @@ -109,8 +111,8 @@ public SearchResultHighlight getHighlight() { * answers to the search query. Currently, only the single answer with the highest confidence (if * any) is returned. * - *

**Note:** This property uses the answer finding beta feature, and is available only if the - * search skill is connected to a Discovery v2 service instance. + *

**Notes:** - Answer finding is available only if the search skill is connected to a + * Discovery v2 service instance. - Answer finding is not supported on IBM Cloud Pak for Data. * * @return the answers */ diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchResultAnswer.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchResultAnswer.java index 510a9edb8b9..764605525c6 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchResultAnswer.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchResultAnswer.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -22,6 +22,8 @@ public class SearchResultAnswer extends GenericModel { protected String text; protected Double confidence; + protected SearchResultAnswer() {} + /** * Gets the text. * diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchResultMetadata.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchResultMetadata.java index 07b3680b083..816275227d8 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchResultMetadata.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchResultMetadata.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2021. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -20,6 +20,8 @@ public class SearchResultMetadata extends GenericModel { protected Double confidence; protected Double score; + protected SearchResultMetadata() {} + /** * Gets the confidence. * diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchSettings.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchSettings.java new file mode 100644 index 00000000000..a39bcbf24d0 --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchSettings.java @@ -0,0 +1,161 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.watson.assistant.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** An object describing the search skill configuration. */ +public class SearchSettings extends GenericModel { + + protected SearchSettingsDiscovery discovery; + protected SearchSettingsMessages messages; + + @SerializedName("schema_mapping") + protected SearchSettingsSchemaMapping schemaMapping; + + /** Builder. */ + public static class Builder { + private SearchSettingsDiscovery discovery; + private SearchSettingsMessages messages; + private SearchSettingsSchemaMapping schemaMapping; + + /** + * Instantiates a new Builder from an existing SearchSettings instance. + * + * @param searchSettings the instance to initialize the Builder with + */ + private Builder(SearchSettings searchSettings) { + this.discovery = searchSettings.discovery; + this.messages = searchSettings.messages; + this.schemaMapping = searchSettings.schemaMapping; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Instantiates a new builder with required properties. + * + * @param discovery the discovery + * @param messages the messages + * @param schemaMapping the schemaMapping + */ + public Builder( + SearchSettingsDiscovery discovery, + SearchSettingsMessages messages, + SearchSettingsSchemaMapping schemaMapping) { + this.discovery = discovery; + this.messages = messages; + this.schemaMapping = schemaMapping; + } + + /** + * Builds a SearchSettings. + * + * @return the new SearchSettings instance + */ + public SearchSettings build() { + return new SearchSettings(this); + } + + /** + * Set the discovery. + * + * @param discovery the discovery + * @return the SearchSettings builder + */ + public Builder discovery(SearchSettingsDiscovery discovery) { + this.discovery = discovery; + return this; + } + + /** + * Set the messages. + * + * @param messages the messages + * @return the SearchSettings builder + */ + public Builder messages(SearchSettingsMessages messages) { + this.messages = messages; + return this; + } + + /** + * Set the schemaMapping. + * + * @param schemaMapping the schemaMapping + * @return the SearchSettings builder + */ + public Builder schemaMapping(SearchSettingsSchemaMapping schemaMapping) { + this.schemaMapping = schemaMapping; + return this; + } + } + + protected SearchSettings() {} + + protected SearchSettings(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.discovery, "discovery cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.messages, "messages cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull( + builder.schemaMapping, "schemaMapping cannot be null"); + discovery = builder.discovery; + messages = builder.messages; + schemaMapping = builder.schemaMapping; + } + + /** + * New builder. + * + * @return a SearchSettings builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the discovery. + * + *

Configuration settings for the Watson Discovery service instance used by the search + * integration. + * + * @return the discovery + */ + public SearchSettingsDiscovery discovery() { + return discovery; + } + + /** + * Gets the messages. + * + *

The messages included with responses from the search integration. + * + * @return the messages + */ + public SearchSettingsMessages messages() { + return messages; + } + + /** + * Gets the schemaMapping. + * + *

The mapping between fields in the Watson Discovery collection and properties in the search + * response. + * + * @return the schemaMapping + */ + public SearchSettingsSchemaMapping schemaMapping() { + return schemaMapping; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchSettingsDiscovery.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchSettingsDiscovery.java new file mode 100644 index 00000000000..4a76f2fddd4 --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchSettingsDiscovery.java @@ -0,0 +1,342 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.watson.assistant.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * Configuration settings for the Watson Discovery service instance used by the search integration. + */ +public class SearchSettingsDiscovery extends GenericModel { + + @SerializedName("instance_id") + protected String instanceId; + + @SerializedName("project_id") + protected String projectId; + + protected String url; + + @SerializedName("max_primary_results") + protected Long maxPrimaryResults; + + @SerializedName("max_total_results") + protected Long maxTotalResults; + + @SerializedName("confidence_threshold") + protected Double confidenceThreshold; + + protected Boolean highlight; + + @SerializedName("find_answers") + protected Boolean findAnswers; + + protected SearchSettingsDiscoveryAuthentication authentication; + + /** Builder. */ + public static class Builder { + private String instanceId; + private String projectId; + private String url; + private Long maxPrimaryResults; + private Long maxTotalResults; + private Double confidenceThreshold; + private Boolean highlight; + private Boolean findAnswers; + private SearchSettingsDiscoveryAuthentication authentication; + + /** + * Instantiates a new Builder from an existing SearchSettingsDiscovery instance. + * + * @param searchSettingsDiscovery the instance to initialize the Builder with + */ + private Builder(SearchSettingsDiscovery searchSettingsDiscovery) { + this.instanceId = searchSettingsDiscovery.instanceId; + this.projectId = searchSettingsDiscovery.projectId; + this.url = searchSettingsDiscovery.url; + this.maxPrimaryResults = searchSettingsDiscovery.maxPrimaryResults; + this.maxTotalResults = searchSettingsDiscovery.maxTotalResults; + this.confidenceThreshold = searchSettingsDiscovery.confidenceThreshold; + this.highlight = searchSettingsDiscovery.highlight; + this.findAnswers = searchSettingsDiscovery.findAnswers; + this.authentication = searchSettingsDiscovery.authentication; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Instantiates a new builder with required properties. + * + * @param instanceId the instanceId + * @param projectId the projectId + * @param url the url + * @param authentication the authentication + */ + public Builder( + String instanceId, + String projectId, + String url, + SearchSettingsDiscoveryAuthentication authentication) { + this.instanceId = instanceId; + this.projectId = projectId; + this.url = url; + this.authentication = authentication; + } + + /** + * Builds a SearchSettingsDiscovery. + * + * @return the new SearchSettingsDiscovery instance + */ + public SearchSettingsDiscovery build() { + return new SearchSettingsDiscovery(this); + } + + /** + * Set the instanceId. + * + * @param instanceId the instanceId + * @return the SearchSettingsDiscovery builder + */ + public Builder instanceId(String instanceId) { + this.instanceId = instanceId; + return this; + } + + /** + * Set the projectId. + * + * @param projectId the projectId + * @return the SearchSettingsDiscovery builder + */ + public Builder projectId(String projectId) { + this.projectId = projectId; + return this; + } + + /** + * Set the url. + * + * @param url the url + * @return the SearchSettingsDiscovery builder + */ + public Builder url(String url) { + this.url = url; + return this; + } + + /** + * Set the maxPrimaryResults. + * + * @param maxPrimaryResults the maxPrimaryResults + * @return the SearchSettingsDiscovery builder + */ + public Builder maxPrimaryResults(long maxPrimaryResults) { + this.maxPrimaryResults = maxPrimaryResults; + return this; + } + + /** + * Set the maxTotalResults. + * + * @param maxTotalResults the maxTotalResults + * @return the SearchSettingsDiscovery builder + */ + public Builder maxTotalResults(long maxTotalResults) { + this.maxTotalResults = maxTotalResults; + return this; + } + + /** + * Set the confidenceThreshold. + * + * @param confidenceThreshold the confidenceThreshold + * @return the SearchSettingsDiscovery builder + */ + public Builder confidenceThreshold(Double confidenceThreshold) { + this.confidenceThreshold = confidenceThreshold; + return this; + } + + /** + * Set the highlight. + * + * @param highlight the highlight + * @return the SearchSettingsDiscovery builder + */ + public Builder highlight(Boolean highlight) { + this.highlight = highlight; + return this; + } + + /** + * Set the findAnswers. + * + * @param findAnswers the findAnswers + * @return the SearchSettingsDiscovery builder + */ + public Builder findAnswers(Boolean findAnswers) { + this.findAnswers = findAnswers; + return this; + } + + /** + * Set the authentication. + * + * @param authentication the authentication + * @return the SearchSettingsDiscovery builder + */ + public Builder authentication(SearchSettingsDiscoveryAuthentication authentication) { + this.authentication = authentication; + return this; + } + } + + protected SearchSettingsDiscovery() {} + + protected SearchSettingsDiscovery(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.instanceId, "instanceId cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.projectId, "projectId cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.url, "url cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull( + builder.authentication, "authentication cannot be null"); + instanceId = builder.instanceId; + projectId = builder.projectId; + url = builder.url; + maxPrimaryResults = builder.maxPrimaryResults; + maxTotalResults = builder.maxTotalResults; + confidenceThreshold = builder.confidenceThreshold; + highlight = builder.highlight; + findAnswers = builder.findAnswers; + authentication = builder.authentication; + } + + /** + * New builder. + * + * @return a SearchSettingsDiscovery builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the instanceId. + * + *

The ID for the Watson Discovery service instance. + * + * @return the instanceId + */ + public String instanceId() { + return instanceId; + } + + /** + * Gets the projectId. + * + *

The ID for the Watson Discovery project. + * + * @return the projectId + */ + public String projectId() { + return projectId; + } + + /** + * Gets the url. + * + *

The URL for the Watson Discovery service instance. + * + * @return the url + */ + public String url() { + return url; + } + + /** + * Gets the maxPrimaryResults. + * + *

The maximum number of primary results to include in the response. + * + * @return the maxPrimaryResults + */ + public Long maxPrimaryResults() { + return maxPrimaryResults; + } + + /** + * Gets the maxTotalResults. + * + *

The maximum total number of primary and additional results to include in the response. + * + * @return the maxTotalResults + */ + public Long maxTotalResults() { + return maxTotalResults; + } + + /** + * Gets the confidenceThreshold. + * + *

The minimum confidence threshold for included results. Any results with a confidence below + * this threshold will be discarded. + * + * @return the confidenceThreshold + */ + public Double confidenceThreshold() { + return confidenceThreshold; + } + + /** + * Gets the highlight. + * + *

Whether to include the most relevant passages of text in the **highlight** property of each + * result. + * + * @return the highlight + */ + public Boolean highlight() { + return highlight; + } + + /** + * Gets the findAnswers. + * + *

Whether to use the answer finding feature to emphasize answers within highlighted passages. + * This property is ignored if **highlight**=`false`. + * + *

**Notes:** - Answer finding is available only if the search skill is connected to a + * Discovery v2 service instance. - Answer finding is not supported on IBM Cloud Pak for Data. + * + * @return the findAnswers + */ + public Boolean findAnswers() { + return findAnswers; + } + + /** + * Gets the authentication. + * + *

Authentication information for the Watson Discovery service. For more information, see the + * [Watson Discovery documentation](https://cloud.ibm.com/apidocs/discovery-data#authentication). + * + *

**Note:** You must specify either **basic** or **bearer**, but not both. + * + * @return the authentication + */ + public SearchSettingsDiscoveryAuthentication authentication() { + return authentication; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchSettingsDiscoveryAuthentication.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchSettingsDiscoveryAuthentication.java new file mode 100644 index 00000000000..f1de10d32bd --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchSettingsDiscoveryAuthentication.java @@ -0,0 +1,116 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.watson.assistant.v2.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * Authentication information for the Watson Discovery service. For more information, see the + * [Watson Discovery documentation](https://cloud.ibm.com/apidocs/discovery-data#authentication). + * + *

**Note:** You must specify either **basic** or **bearer**, but not both. + */ +public class SearchSettingsDiscoveryAuthentication extends GenericModel { + + protected String basic; + protected String bearer; + + /** Builder. */ + public static class Builder { + private String basic; + private String bearer; + + /** + * Instantiates a new Builder from an existing SearchSettingsDiscoveryAuthentication instance. + * + * @param searchSettingsDiscoveryAuthentication the instance to initialize the Builder with + */ + private Builder(SearchSettingsDiscoveryAuthentication searchSettingsDiscoveryAuthentication) { + this.basic = searchSettingsDiscoveryAuthentication.basic; + this.bearer = searchSettingsDiscoveryAuthentication.bearer; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Builds a SearchSettingsDiscoveryAuthentication. + * + * @return the new SearchSettingsDiscoveryAuthentication instance + */ + public SearchSettingsDiscoveryAuthentication build() { + return new SearchSettingsDiscoveryAuthentication(this); + } + + /** + * Set the basic. + * + * @param basic the basic + * @return the SearchSettingsDiscoveryAuthentication builder + */ + public Builder basic(String basic) { + this.basic = basic; + return this; + } + + /** + * Set the bearer. + * + * @param bearer the bearer + * @return the SearchSettingsDiscoveryAuthentication builder + */ + public Builder bearer(String bearer) { + this.bearer = bearer; + return this; + } + } + + protected SearchSettingsDiscoveryAuthentication() {} + + protected SearchSettingsDiscoveryAuthentication(Builder builder) { + basic = builder.basic; + bearer = builder.bearer; + } + + /** + * New builder. + * + * @return a SearchSettingsDiscoveryAuthentication builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the basic. + * + *

The HTTP basic authentication credentials for Watson Discovery. Specify your Watson + * Discovery API key in the format `apikey:{apikey}`. + * + * @return the basic + */ + public String basic() { + return basic; + } + + /** + * Gets the bearer. + * + *

The authentication bearer token for Watson Discovery. + * + * @return the bearer + */ + public String bearer() { + return bearer; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchSettingsMessages.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchSettingsMessages.java new file mode 100644 index 00000000000..00f8b83c230 --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchSettingsMessages.java @@ -0,0 +1,155 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.watson.assistant.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** The messages included with responses from the search integration. */ +public class SearchSettingsMessages extends GenericModel { + + protected String success; + protected String error; + + @SerializedName("no_result") + protected String noResult; + + /** Builder. */ + public static class Builder { + private String success; + private String error; + private String noResult; + + /** + * Instantiates a new Builder from an existing SearchSettingsMessages instance. + * + * @param searchSettingsMessages the instance to initialize the Builder with + */ + private Builder(SearchSettingsMessages searchSettingsMessages) { + this.success = searchSettingsMessages.success; + this.error = searchSettingsMessages.error; + this.noResult = searchSettingsMessages.noResult; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Instantiates a new builder with required properties. + * + * @param success the success + * @param error the error + * @param noResult the noResult + */ + public Builder(String success, String error, String noResult) { + this.success = success; + this.error = error; + this.noResult = noResult; + } + + /** + * Builds a SearchSettingsMessages. + * + * @return the new SearchSettingsMessages instance + */ + public SearchSettingsMessages build() { + return new SearchSettingsMessages(this); + } + + /** + * Set the success. + * + * @param success the success + * @return the SearchSettingsMessages builder + */ + public Builder success(String success) { + this.success = success; + return this; + } + + /** + * Set the error. + * + * @param error the error + * @return the SearchSettingsMessages builder + */ + public Builder error(String error) { + this.error = error; + return this; + } + + /** + * Set the noResult. + * + * @param noResult the noResult + * @return the SearchSettingsMessages builder + */ + public Builder noResult(String noResult) { + this.noResult = noResult; + return this; + } + } + + protected SearchSettingsMessages() {} + + protected SearchSettingsMessages(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.success, "success cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.error, "error cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.noResult, "noResult cannot be null"); + success = builder.success; + error = builder.error; + noResult = builder.noResult; + } + + /** + * New builder. + * + * @return a SearchSettingsMessages builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the success. + * + *

The message to include in the response to a successful query. + * + * @return the success + */ + public String success() { + return success; + } + + /** + * Gets the error. + * + *

The message to include in the response when the query encounters an error. + * + * @return the error + */ + public String error() { + return error; + } + + /** + * Gets the noResult. + * + *

The message to include in the response when there is no result from the query. + * + * @return the noResult + */ + public String noResult() { + return noResult; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchSettingsSchemaMapping.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchSettingsSchemaMapping.java new file mode 100644 index 00000000000..7a78437bb47 --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchSettingsSchemaMapping.java @@ -0,0 +1,155 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.watson.assistant.v2.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The mapping between fields in the Watson Discovery collection and properties in the search + * response. + */ +public class SearchSettingsSchemaMapping extends GenericModel { + + protected String url; + protected String body; + protected String title; + + /** Builder. */ + public static class Builder { + private String url; + private String body; + private String title; + + /** + * Instantiates a new Builder from an existing SearchSettingsSchemaMapping instance. + * + * @param searchSettingsSchemaMapping the instance to initialize the Builder with + */ + private Builder(SearchSettingsSchemaMapping searchSettingsSchemaMapping) { + this.url = searchSettingsSchemaMapping.url; + this.body = searchSettingsSchemaMapping.body; + this.title = searchSettingsSchemaMapping.title; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Instantiates a new builder with required properties. + * + * @param url the url + * @param body the body + * @param title the title + */ + public Builder(String url, String body, String title) { + this.url = url; + this.body = body; + this.title = title; + } + + /** + * Builds a SearchSettingsSchemaMapping. + * + * @return the new SearchSettingsSchemaMapping instance + */ + public SearchSettingsSchemaMapping build() { + return new SearchSettingsSchemaMapping(this); + } + + /** + * Set the url. + * + * @param url the url + * @return the SearchSettingsSchemaMapping builder + */ + public Builder url(String url) { + this.url = url; + return this; + } + + /** + * Set the body. + * + * @param body the body + * @return the SearchSettingsSchemaMapping builder + */ + public Builder body(String body) { + this.body = body; + return this; + } + + /** + * Set the title. + * + * @param title the title + * @return the SearchSettingsSchemaMapping builder + */ + public Builder title(String title) { + this.title = title; + return this; + } + } + + protected SearchSettingsSchemaMapping() {} + + protected SearchSettingsSchemaMapping(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.url, "url cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.body, "body cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.title, "title cannot be null"); + url = builder.url; + body = builder.body; + title = builder.title; + } + + /** + * New builder. + * + * @return a SearchSettingsSchemaMapping builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the url. + * + *

The field in the collection to map to the **url** property of the response. + * + * @return the url + */ + public String url() { + return url; + } + + /** + * Gets the body. + * + *

The field in the collection to map to the **body** property in the response. + * + * @return the body + */ + public String body() { + return body; + } + + /** + * Gets the title. + * + *

The field in the collection to map to the **title** property for the schema. + * + * @return the title + */ + public String title() { + return title; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchSkillWarning.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchSkillWarning.java new file mode 100644 index 00000000000..8f01d72f236 --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchSkillWarning.java @@ -0,0 +1,136 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.watson.assistant.v2.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** A warning describing an error in the search skill configuration. */ +public class SearchSkillWarning extends GenericModel { + + protected String code; + protected String path; + protected String message; + + /** Builder. */ + public static class Builder { + private String code; + private String path; + private String message; + + /** + * Instantiates a new Builder from an existing SearchSkillWarning instance. + * + * @param searchSkillWarning the instance to initialize the Builder with + */ + private Builder(SearchSkillWarning searchSkillWarning) { + this.code = searchSkillWarning.code; + this.path = searchSkillWarning.path; + this.message = searchSkillWarning.message; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Builds a SearchSkillWarning. + * + * @return the new SearchSkillWarning instance + */ + public SearchSkillWarning build() { + return new SearchSkillWarning(this); + } + + /** + * Set the code. + * + * @param code the code + * @return the SearchSkillWarning builder + */ + public Builder code(String code) { + this.code = code; + return this; + } + + /** + * Set the path. + * + * @param path the path + * @return the SearchSkillWarning builder + */ + public Builder path(String path) { + this.path = path; + return this; + } + + /** + * Set the message. + * + * @param message the message + * @return the SearchSkillWarning builder + */ + public Builder message(String message) { + this.message = message; + return this; + } + } + + protected SearchSkillWarning() {} + + protected SearchSkillWarning(Builder builder) { + code = builder.code; + path = builder.path; + message = builder.message; + } + + /** + * New builder. + * + * @return a SearchSkillWarning builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the code. + * + *

The error code. + * + * @return the code + */ + public String code() { + return code; + } + + /** + * Gets the path. + * + *

The location of the error in the search skill configuration object. + * + * @return the path + */ + public String path() { + return path; + } + + /** + * Gets the message. + * + *

The error message. + * + * @return the message + */ + public String message() { + return message; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SessionResponse.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SessionResponse.java index 07e07f2686c..83c58747e5c 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SessionResponse.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SessionResponse.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2020. + * (C) Copyright IBM Corp. 2023. * * 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,8 @@ public class SessionResponse extends GenericModel { @SerializedName("session_id") protected String sessionId; + protected SessionResponse() {} + /** * Gets the sessionId. * diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/Skill.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/Skill.java new file mode 100644 index 00000000000..900884a686b --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/Skill.java @@ -0,0 +1,293 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.watson.assistant.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; +import java.util.List; +import java.util.Map; + +/** Skill. */ +public class Skill extends GenericModel { + + /** + * The current status of the skill: - **Available**: The skill is available and ready to process + * messages. - **Failed**: An asynchronous operation has failed. See the **status_errors** + * property for more information about the cause of the failure. - **Non Existent**: The skill + * does not exist. - **Processing**: An asynchronous operation has not yet completed. - + * **Training**: The skill is training based on new data. + */ + public interface Status { + /** Available. */ + String AVAILABLE = "Available"; + /** Failed. */ + String FAILED = "Failed"; + /** Non Existent. */ + String NON_EXISTENT = "Non Existent"; + /** Processing. */ + String PROCESSING = "Processing"; + /** Training. */ + String TRAINING = "Training"; + /** Unavailable. */ + String UNAVAILABLE = "Unavailable"; + } + + /** The type of skill. */ + public interface Type { + /** action. */ + String ACTION = "action"; + /** dialog. */ + String DIALOG = "dialog"; + /** search. */ + String SEARCH = "search"; + } + + protected String name; + protected String description; + protected Map workspace; + + @SerializedName("skill_id") + protected String skillId; + + protected String status; + + @SerializedName("status_errors") + protected List statusErrors; + + @SerializedName("status_description") + protected String statusDescription; + + @SerializedName("dialog_settings") + protected Map dialogSettings; + + @SerializedName("assistant_id") + protected String assistantId; + + @SerializedName("workspace_id") + protected String workspaceId; + + @SerializedName("environment_id") + protected String environmentId; + + protected Boolean valid; + + @SerializedName("next_snapshot_version") + protected String nextSnapshotVersion; + + @SerializedName("search_settings") + protected SearchSettings searchSettings; + + protected List warnings; + protected String language; + protected String type; + + protected Skill() {} + + /** + * Gets the name. + * + *

The name of the skill. This string cannot contain carriage return, newline, or tab + * characters. + * + * @return the name + */ + public String getName() { + return name; + } + + /** + * Gets the description. + * + *

The description of the skill. This string cannot contain carriage return, newline, or tab + * characters. + * + * @return the description + */ + public String getDescription() { + return description; + } + + /** + * Gets the workspace. + * + *

An object containing the conversational content of an action or dialog skill. + * + * @return the workspace + */ + public Map getWorkspace() { + return workspace; + } + + /** + * Gets the skillId. + * + *

The skill ID of the skill. + * + * @return the skillId + */ + public String getSkillId() { + return skillId; + } + + /** + * Gets the status. + * + *

The current status of the skill: - **Available**: The skill is available and ready to + * process messages. - **Failed**: An asynchronous operation has failed. See the **status_errors** + * property for more information about the cause of the failure. - **Non Existent**: The skill + * does not exist. - **Processing**: An asynchronous operation has not yet completed. - + * **Training**: The skill is training based on new data. + * + * @return the status + */ + public String getStatus() { + return status; + } + + /** + * Gets the statusErrors. + * + *

An array of messages about errors that caused an asynchronous operation to fail. Included + * only if **status**=`Failed`. + * + * @return the statusErrors + */ + public List getStatusErrors() { + return statusErrors; + } + + /** + * Gets the statusDescription. + * + *

The description of the failed asynchronous operation. Included only if **status**=`Failed`. + * + * @return the statusDescription + */ + public String getStatusDescription() { + return statusDescription; + } + + /** + * Gets the dialogSettings. + * + *

For internal use only. + * + * @return the dialogSettings + */ + public Map getDialogSettings() { + return dialogSettings; + } + + /** + * Gets the assistantId. + * + *

The unique identifier of the assistant the skill is associated with. + * + * @return the assistantId + */ + public String getAssistantId() { + return assistantId; + } + + /** + * Gets the workspaceId. + * + *

The unique identifier of the workspace that contains the skill content. Included only for + * action and dialog skills. + * + * @return the workspaceId + */ + public String getWorkspaceId() { + return workspaceId; + } + + /** + * Gets the environmentId. + * + *

The unique identifier of the environment where the skill is defined. For action and dialog + * skills, this is always the draft environment. + * + * @return the environmentId + */ + public String getEnvironmentId() { + return environmentId; + } + + /** + * Gets the valid. + * + *

Whether the skill is structurally valid. + * + * @return the valid + */ + public Boolean isValid() { + return valid; + } + + /** + * Gets the nextSnapshotVersion. + * + *

The name that will be given to the next snapshot that is created for the skill. A snapshot + * of each versionable skill is saved for each new release of an assistant. + * + * @return the nextSnapshotVersion + */ + public String getNextSnapshotVersion() { + return nextSnapshotVersion; + } + + /** + * Gets the searchSettings. + * + *

An object describing the search skill configuration. + * + * @return the searchSettings + */ + public SearchSettings getSearchSettings() { + return searchSettings; + } + + /** + * Gets the warnings. + * + *

An array of warnings describing errors with the search skill configuration. Included only + * for search skills. + * + * @return the warnings + */ + public List getWarnings() { + return warnings; + } + + /** + * Gets the language. + * + *

The language of the skill. + * + * @return the language + */ + public String getLanguage() { + return language; + } + + /** + * Gets the type. + * + *

The type of skill. + * + * @return the type + */ + public String getType() { + return type; + } +} 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 new file mode 100644 index 00000000000..1ce9aa493d4 --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SkillImport.java @@ -0,0 +1,440 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.watson.assistant.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; +import java.util.List; +import java.util.Map; + +/** SkillImport. */ +public class SkillImport extends GenericModel { + + /** + * The current status of the skill: - **Available**: The skill is available and ready to process + * messages. - **Failed**: An asynchronous operation has failed. See the **status_errors** + * property for more information about the cause of the failure. - **Non Existent**: The skill + * does not exist. - **Processing**: An asynchronous operation has not yet completed. - + * **Training**: The skill is training based on new data. + */ + public interface Status { + /** Available. */ + String AVAILABLE = "Available"; + /** Failed. */ + String FAILED = "Failed"; + /** Non Existent. */ + String NON_EXISTENT = "Non Existent"; + /** Processing. */ + String PROCESSING = "Processing"; + /** Training. */ + String TRAINING = "Training"; + /** Unavailable. */ + String UNAVAILABLE = "Unavailable"; + } + + /** The type of skill. */ + public interface Type { + /** action. */ + String ACTION = "action"; + /** dialog. */ + String DIALOG = "dialog"; + /** search. */ + String SEARCH = "search"; + } + + protected String name; + protected String description; + protected Map workspace; + + @SerializedName("skill_id") + protected String skillId; + + protected String status; + + @SerializedName("status_errors") + protected List statusErrors; + + @SerializedName("status_description") + protected String statusDescription; + + @SerializedName("dialog_settings") + protected Map dialogSettings; + + @SerializedName("assistant_id") + protected String assistantId; + + @SerializedName("workspace_id") + protected String workspaceId; + + @SerializedName("environment_id") + protected String environmentId; + + protected Boolean valid; + + @SerializedName("next_snapshot_version") + protected String nextSnapshotVersion; + + @SerializedName("search_settings") + protected SearchSettings searchSettings; + + protected List warnings; + protected String language; + protected String type; + + /** Builder. */ + public static class Builder { + private String name; + private String description; + private Map workspace; + private Map dialogSettings; + private SearchSettings searchSettings; + private String language; + private String type; + + /** + * Instantiates a new Builder from an existing SkillImport instance. + * + * @param skillImport the instance to initialize the Builder with + */ + private Builder(SkillImport skillImport) { + this.name = skillImport.name; + this.description = skillImport.description; + this.workspace = skillImport.workspace; + this.dialogSettings = skillImport.dialogSettings; + this.searchSettings = skillImport.searchSettings; + this.language = skillImport.language; + this.type = skillImport.type; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Instantiates a new builder with required properties. + * + * @param language the language + * @param type the type + */ + public Builder(String language, String type) { + this.language = language; + this.type = type; + } + + /** + * Builds a SkillImport. + * + * @return the new SkillImport instance + */ + public SkillImport build() { + return new SkillImport(this); + } + + /** + * Set the name. + * + * @param name the name + * @return the SkillImport builder + */ + public Builder name(String name) { + this.name = name; + return this; + } + + /** + * Set the description. + * + * @param description the description + * @return the SkillImport builder + */ + public Builder description(String description) { + this.description = description; + return this; + } + + /** + * Set the workspace. + * + * @param workspace the workspace + * @return the SkillImport builder + */ + public Builder workspace(Map workspace) { + this.workspace = workspace; + return this; + } + + /** + * Set the dialogSettings. + * + * @param dialogSettings the dialogSettings + * @return the SkillImport builder + */ + public Builder dialogSettings(Map dialogSettings) { + this.dialogSettings = dialogSettings; + return this; + } + + /** + * Set the searchSettings. + * + * @param searchSettings the searchSettings + * @return the SkillImport builder + */ + public Builder searchSettings(SearchSettings searchSettings) { + this.searchSettings = searchSettings; + return this; + } + + /** + * Set the language. + * + * @param language the language + * @return the SkillImport builder + */ + public Builder language(String language) { + this.language = language; + return this; + } + + /** + * Set the type. + * + * @param type the type + * @return the SkillImport builder + */ + public Builder type(String type) { + this.type = type; + return this; + } + } + + protected SkillImport() {} + + protected SkillImport(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.language, "language cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.type, "type cannot be null"); + name = builder.name; + description = builder.description; + workspace = builder.workspace; + dialogSettings = builder.dialogSettings; + searchSettings = builder.searchSettings; + language = builder.language; + type = builder.type; + } + + /** + * New builder. + * + * @return a SkillImport builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the name. + * + *

The name of the skill. This string cannot contain carriage return, newline, or tab + * characters. + * + * @return the name + */ + public String name() { + return name; + } + + /** + * Gets the description. + * + *

The description of the skill. This string cannot contain carriage return, newline, or tab + * characters. + * + * @return the description + */ + public String description() { + return description; + } + + /** + * Gets the workspace. + * + *

An object containing the conversational content of an action or dialog skill. + * + * @return the workspace + */ + public Map workspace() { + return workspace; + } + + /** + * Gets the skillId. + * + *

The skill ID of the skill. + * + * @return the skillId + */ + public String skillId() { + return skillId; + } + + /** + * Gets the status. + * + *

The current status of the skill: - **Available**: The skill is available and ready to + * process messages. - **Failed**: An asynchronous operation has failed. See the **status_errors** + * property for more information about the cause of the failure. - **Non Existent**: The skill + * does not exist. - **Processing**: An asynchronous operation has not yet completed. - + * **Training**: The skill is training based on new data. + * + * @return the status + */ + public String status() { + return status; + } + + /** + * Gets the statusErrors. + * + *

An array of messages about errors that caused an asynchronous operation to fail. Included + * only if **status**=`Failed`. + * + * @return the statusErrors + */ + public List statusErrors() { + return statusErrors; + } + + /** + * Gets the statusDescription. + * + *

The description of the failed asynchronous operation. Included only if **status**=`Failed`. + * + * @return the statusDescription + */ + public String statusDescription() { + return statusDescription; + } + + /** + * Gets the dialogSettings. + * + *

For internal use only. + * + * @return the dialogSettings + */ + public Map dialogSettings() { + return dialogSettings; + } + + /** + * Gets the assistantId. + * + *

The unique identifier of the assistant the skill is associated with. + * + * @return the assistantId + */ + public String assistantId() { + return assistantId; + } + + /** + * Gets the workspaceId. + * + *

The unique identifier of the workspace that contains the skill content. Included only for + * action and dialog skills. + * + * @return the workspaceId + */ + public String workspaceId() { + return workspaceId; + } + + /** + * Gets the environmentId. + * + *

The unique identifier of the environment where the skill is defined. For action and dialog + * skills, this is always the draft environment. + * + * @return the environmentId + */ + public String environmentId() { + return environmentId; + } + + /** + * Gets the valid. + * + *

Whether the skill is structurally valid. + * + * @return the valid + */ + public Boolean valid() { + return valid; + } + + /** + * Gets the nextSnapshotVersion. + * + *

The name that will be given to the next snapshot that is created for the skill. A snapshot + * of each versionable skill is saved for each new release of an assistant. + * + * @return the nextSnapshotVersion + */ + public String nextSnapshotVersion() { + return nextSnapshotVersion; + } + + /** + * Gets the searchSettings. + * + *

An object describing the search skill configuration. + * + * @return the searchSettings + */ + public SearchSettings searchSettings() { + return searchSettings; + } + + /** + * Gets the warnings. + * + *

An array of warnings describing errors with the search skill configuration. Included only + * for search skills. + * + * @return the warnings + */ + public List warnings() { + return warnings; + } + + /** + * Gets the language. + * + *

The language of the skill. + * + * @return the language + */ + public String language() { + return language; + } + + /** + * Gets the type. + * + *

The type of skill. + * + * @return the type + */ + public String type() { + return type; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SkillsAsyncRequestStatus.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SkillsAsyncRequestStatus.java new file mode 100644 index 00000000000..900ef99b8cc --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SkillsAsyncRequestStatus.java @@ -0,0 +1,101 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.watson.assistant.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; +import java.util.List; + +/** SkillsAsyncRequestStatus. */ +public class SkillsAsyncRequestStatus extends GenericModel { + + /** + * The current status of the asynchronous operation: - `Available`: An asynchronous export is + * available. - `Completed`: An asynchronous import operation has completed successfully. - + * `Failed`: An asynchronous operation has failed. See the **status_errors** property for more + * information about the cause of the failure. - `Processing`: An asynchronous operation has not + * yet completed. + */ + public interface Status { + /** Available. */ + String AVAILABLE = "Available"; + /** Completed. */ + String COMPLETED = "Completed"; + /** Failed. */ + String FAILED = "Failed"; + /** Processing. */ + String PROCESSING = "Processing"; + } + + @SerializedName("assistant_id") + protected String assistantId; + + protected String status; + + @SerializedName("status_description") + protected String statusDescription; + + @SerializedName("status_errors") + protected List statusErrors; + + protected SkillsAsyncRequestStatus() {} + + /** + * Gets the assistantId. + * + *

The assistant ID of the assistant. + * + * @return the assistantId + */ + public String getAssistantId() { + return assistantId; + } + + /** + * Gets the status. + * + *

The current status of the asynchronous operation: - `Available`: An asynchronous export is + * available. - `Completed`: An asynchronous import operation has completed successfully. - + * `Failed`: An asynchronous operation has failed. See the **status_errors** property for more + * information about the cause of the failure. - `Processing`: An asynchronous operation has not + * yet completed. + * + * @return the status + */ + public String getStatus() { + return status; + } + + /** + * Gets the statusDescription. + * + *

The description of the failed asynchronous operation. Included only if **status**=`Failed`. + * + * @return the statusDescription + */ + public String getStatusDescription() { + return statusDescription; + } + + /** + * Gets the statusErrors. + * + *

An array of messages about errors that caused an asynchronous operation to fail. Included + * only if **status**=`Failed`. + * + * @return the statusErrors + */ + public List getStatusErrors() { + return statusErrors; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SkillsExport.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SkillsExport.java new file mode 100644 index 00000000000..5f0c59d204c --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SkillsExport.java @@ -0,0 +1,53 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.watson.assistant.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; +import java.util.List; + +/** SkillsExport. */ +public class SkillsExport extends GenericModel { + + @SerializedName("assistant_skills") + protected List assistantSkills; + + @SerializedName("assistant_state") + protected AssistantState assistantState; + + protected SkillsExport() {} + + /** + * Gets the assistantSkills. + * + *

An array of objects describing the skills for the assistant. Included in responses only if + * **status**=`Available`. + * + * @return the assistantSkills + */ + public List getAssistantSkills() { + return assistantSkills; + } + + /** + * Gets the assistantState. + * + *

Status information about the skills for the assistant. Included in responses only if + * **status**=`Available`. + * + * @return the assistantState + */ + public AssistantState getAssistantState() { + return assistantState; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/StatusError.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/StatusError.java new file mode 100644 index 00000000000..692a516882a --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/StatusError.java @@ -0,0 +1,84 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.watson.assistant.v2.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** An object describing an error that occurred during processing of an asynchronous operation. */ +public class StatusError extends GenericModel { + + protected String message; + + /** Builder. */ + public static class Builder { + private String message; + + /** + * Instantiates a new Builder from an existing StatusError instance. + * + * @param statusError the instance to initialize the Builder with + */ + private Builder(StatusError statusError) { + this.message = statusError.message; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Builds a StatusError. + * + * @return the new StatusError instance + */ + public StatusError build() { + return new StatusError(this); + } + + /** + * Set the message. + * + * @param message the message + * @return the StatusError builder + */ + public Builder message(String message) { + this.message = message; + return this; + } + } + + protected StatusError() {} + + protected StatusError(Builder builder) { + message = builder.message; + } + + /** + * New builder. + * + * @return a StatusError builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the message. + * + *

The text of the error message. + * + * @return the message + */ + public String message() { + return message; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/TurnEventActionSource.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/TurnEventActionSource.java index 68dd4bd2549..a8663eb0270 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/TurnEventActionSource.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/TurnEventActionSource.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -32,6 +32,8 @@ public interface Type { protected String condition; + protected TurnEventActionSource() {} + /** * Gets the type. * diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/TurnEventCalloutCallout.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/TurnEventCalloutCallout.java index b82699f92a4..e08806706d4 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/TurnEventCalloutCallout.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/TurnEventCalloutCallout.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022. + * (C) Copyright IBM Corp. 2023. * * 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,13 +12,17 @@ */ package com.ibm.watson.assistant.v2.model; +import com.google.gson.annotations.SerializedName; import com.ibm.cloud.sdk.core.service.model.GenericModel; import java.util.Map; /** TurnEventCalloutCallout. */ public class TurnEventCalloutCallout extends GenericModel { - /** callout type. */ + /** + * The type of callout. Currently, the only supported value is `integration_interaction` (for + * calls to extensions). + */ public interface Type { /** integration_interaction. */ String INTEGRATION_INTERACTION = "integration_interaction"; @@ -27,10 +31,16 @@ public interface Type { protected String type; protected Map internal; + @SerializedName("result_variable") + protected String resultVariable; + + protected TurnEventCalloutCallout() {} + /** * Gets the type. * - *

callout type. + *

The type of callout. Currently, the only supported value is `integration_interaction` (for + * calls to extensions). * * @return the type */ @@ -48,4 +58,15 @@ public String getType() { public Map getInternal() { return internal; } + + /** + * Gets the resultVariable. + * + *

The name of the variable where the callout result is stored. + * + * @return the resultVariable + */ + public String getResultVariable() { + return resultVariable; + } } diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/TurnEventCalloutError.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/TurnEventCalloutError.java index f9213734534..a63c3c9a795 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/TurnEventCalloutError.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/TurnEventCalloutError.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -19,6 +19,8 @@ public class TurnEventCalloutError extends GenericModel { protected String message; + protected TurnEventCalloutError() {} + /** * Gets the message. * diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/TurnEventNodeSource.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/TurnEventNodeSource.java index 047f9ae91bd..ef164d2fd70 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/TurnEventNodeSource.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/TurnEventNodeSource.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -32,6 +32,8 @@ public interface Type { protected String title; protected String condition; + protected TurnEventNodeSource() {} + /** * Gets the type. * diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/TurnEventSearchError.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/TurnEventSearchError.java index e36adc1ad32..af8836a0754 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/TurnEventSearchError.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/TurnEventSearchError.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022. + * (C) Copyright IBM Corp. 2023. * * 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 @@ -19,6 +19,8 @@ public class TurnEventSearchError extends GenericModel { protected String message; + protected TurnEventSearchError() {} + /** * Gets the message. * 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 new file mode 100644 index 00000000000..d741c4a432c --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/UpdateEnvironmentOptions.java @@ -0,0 +1,260 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.watson.assistant.v2.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; +import java.util.ArrayList; +import java.util.List; + +/** The updateEnvironment options. */ +public class UpdateEnvironmentOptions extends GenericModel { + + protected String assistantId; + protected String environmentId; + protected String name; + protected String description; + protected Long sessionTimeout; + protected List skillReferences; + + /** Builder. */ + public static class Builder { + private String assistantId; + private String environmentId; + private String name; + private String description; + private Long sessionTimeout; + private List skillReferences; + + /** + * Instantiates a new Builder from an existing UpdateEnvironmentOptions instance. + * + * @param updateEnvironmentOptions the instance to initialize the Builder with + */ + private Builder(UpdateEnvironmentOptions updateEnvironmentOptions) { + this.assistantId = updateEnvironmentOptions.assistantId; + this.environmentId = updateEnvironmentOptions.environmentId; + this.name = updateEnvironmentOptions.name; + this.description = updateEnvironmentOptions.description; + this.sessionTimeout = updateEnvironmentOptions.sessionTimeout; + this.skillReferences = updateEnvironmentOptions.skillReferences; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Instantiates a new builder with required properties. + * + * @param assistantId the assistantId + * @param environmentId the environmentId + */ + public Builder(String assistantId, String environmentId) { + this.assistantId = assistantId; + this.environmentId = environmentId; + } + + /** + * Builds a UpdateEnvironmentOptions. + * + * @return the new UpdateEnvironmentOptions instance + */ + public UpdateEnvironmentOptions build() { + return new UpdateEnvironmentOptions(this); + } + + /** + * Adds an skillReference to skillReferences. + * + * @param skillReference the new skillReference + * @return the UpdateEnvironmentOptions builder + */ + public Builder addSkillReference(EnvironmentSkill skillReference) { + com.ibm.cloud.sdk.core.util.Validator.notNull( + skillReference, "skillReference cannot be null"); + if (this.skillReferences == null) { + this.skillReferences = new ArrayList(); + } + this.skillReferences.add(skillReference); + return this; + } + + /** + * Set the assistantId. + * + * @param assistantId the assistantId + * @return the UpdateEnvironmentOptions builder + */ + public Builder assistantId(String assistantId) { + this.assistantId = assistantId; + return this; + } + + /** + * Set the environmentId. + * + * @param environmentId the environmentId + * @return the UpdateEnvironmentOptions builder + */ + public Builder environmentId(String environmentId) { + this.environmentId = environmentId; + return this; + } + + /** + * Set the name. + * + * @param name the name + * @return the UpdateEnvironmentOptions builder + */ + public Builder name(String name) { + this.name = name; + return this; + } + + /** + * Set the description. + * + * @param description the description + * @return the UpdateEnvironmentOptions builder + */ + public Builder description(String description) { + this.description = description; + return this; + } + + /** + * Set the sessionTimeout. + * + * @param sessionTimeout the sessionTimeout + * @return the UpdateEnvironmentOptions builder + */ + public Builder sessionTimeout(long sessionTimeout) { + this.sessionTimeout = sessionTimeout; + return this; + } + + /** + * Set the skillReferences. Existing skillReferences will be replaced. + * + * @param skillReferences the skillReferences + * @return the UpdateEnvironmentOptions builder + */ + public Builder skillReferences(List skillReferences) { + this.skillReferences = skillReferences; + return this; + } + } + + protected UpdateEnvironmentOptions() {} + + protected UpdateEnvironmentOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notEmpty( + builder.assistantId, "assistantId cannot be empty"); + com.ibm.cloud.sdk.core.util.Validator.notEmpty( + builder.environmentId, "environmentId cannot be empty"); + assistantId = builder.assistantId; + environmentId = builder.environmentId; + name = builder.name; + description = builder.description; + sessionTimeout = builder.sessionTimeout; + skillReferences = builder.skillReferences; + } + + /** + * New builder. + * + * @return a UpdateEnvironmentOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the assistantId. + * + *

The assistant ID or the environment ID of the environment where the assistant is deployed, + * depending on the type of request: - For message, session, and log requests, specify the + * 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 + * assistant settings and scroll to the **Environments** section. + * + *

**Note:** If you are using the classic Watson Assistant experience, always use the assistant + * ID. To find the assistant ID in the user interface, open the assistant settings and click API + * Details. + * + * @return the assistantId + */ + public String assistantId() { + return assistantId; + } + + /** + * Gets the environmentId. + * + *

Unique identifier of the environment. To find the environment ID in the Watson Assistant + * user interface, open the environment settings and click **API Details**. **Note:** Currently, + * the API does not support creating environments. + * + * @return the environmentId + */ + public String environmentId() { + return environmentId; + } + + /** + * Gets the name. + * + *

The name of the environment. + * + * @return the name + */ + public String name() { + return name; + } + + /** + * Gets the description. + * + *

The description of the environment. + * + * @return the description + */ + public String description() { + return description; + } + + /** + * Gets the sessionTimeout. + * + *

The session inactivity timeout setting for the environment (in seconds). + * + * @return the sessionTimeout + */ + public Long sessionTimeout() { + return sessionTimeout; + } + + /** + * Gets the skillReferences. + * + *

An array of objects identifying the skills (such as action and dialog) that exist in the + * environment. + * + * @return the skillReferences + */ + public List skillReferences() { + return skillReferences; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/UpdateSkillOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/UpdateSkillOptions.java new file mode 100644 index 00000000000..6d23747db6e --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/UpdateSkillOptions.java @@ -0,0 +1,268 @@ +/* + * (C) Copyright IBM Corp. 2023. + * + * 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.ibm.watson.assistant.v2.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; +import java.util.Map; + +/** The updateSkill options. */ +public class UpdateSkillOptions extends GenericModel { + + protected String assistantId; + protected String skillId; + protected String name; + protected String description; + protected Map workspace; + protected Map dialogSettings; + protected SearchSettings searchSettings; + + /** Builder. */ + public static class Builder { + private String assistantId; + private String skillId; + private String name; + private String description; + private Map workspace; + private Map dialogSettings; + private SearchSettings searchSettings; + + /** + * Instantiates a new Builder from an existing UpdateSkillOptions instance. + * + * @param updateSkillOptions the instance to initialize the Builder with + */ + private Builder(UpdateSkillOptions updateSkillOptions) { + this.assistantId = updateSkillOptions.assistantId; + this.skillId = updateSkillOptions.skillId; + this.name = updateSkillOptions.name; + this.description = updateSkillOptions.description; + this.workspace = updateSkillOptions.workspace; + this.dialogSettings = updateSkillOptions.dialogSettings; + this.searchSettings = updateSkillOptions.searchSettings; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Instantiates a new builder with required properties. + * + * @param assistantId the assistantId + * @param skillId the skillId + */ + public Builder(String assistantId, String skillId) { + this.assistantId = assistantId; + this.skillId = skillId; + } + + /** + * Builds a UpdateSkillOptions. + * + * @return the new UpdateSkillOptions instance + */ + public UpdateSkillOptions build() { + return new UpdateSkillOptions(this); + } + + /** + * Set the assistantId. + * + * @param assistantId the assistantId + * @return the UpdateSkillOptions builder + */ + public Builder assistantId(String assistantId) { + this.assistantId = assistantId; + return this; + } + + /** + * Set the skillId. + * + * @param skillId the skillId + * @return the UpdateSkillOptions builder + */ + public Builder skillId(String skillId) { + this.skillId = skillId; + return this; + } + + /** + * Set the name. + * + * @param name the name + * @return the UpdateSkillOptions builder + */ + public Builder name(String name) { + this.name = name; + return this; + } + + /** + * Set the description. + * + * @param description the description + * @return the UpdateSkillOptions builder + */ + public Builder description(String description) { + this.description = description; + return this; + } + + /** + * Set the workspace. + * + * @param workspace the workspace + * @return the UpdateSkillOptions builder + */ + public Builder workspace(Map workspace) { + this.workspace = workspace; + return this; + } + + /** + * Set the dialogSettings. + * + * @param dialogSettings the dialogSettings + * @return the UpdateSkillOptions builder + */ + public Builder dialogSettings(Map dialogSettings) { + this.dialogSettings = dialogSettings; + return this; + } + + /** + * Set the searchSettings. + * + * @param searchSettings the searchSettings + * @return the UpdateSkillOptions builder + */ + public Builder searchSettings(SearchSettings searchSettings) { + this.searchSettings = searchSettings; + return this; + } + } + + protected UpdateSkillOptions() {} + + protected UpdateSkillOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notEmpty( + builder.assistantId, "assistantId cannot be empty"); + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.skillId, "skillId cannot be empty"); + assistantId = builder.assistantId; + skillId = builder.skillId; + name = builder.name; + description = builder.description; + workspace = builder.workspace; + dialogSettings = builder.dialogSettings; + searchSettings = builder.searchSettings; + } + + /** + * New builder. + * + * @return a UpdateSkillOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the assistantId. + * + *

The assistant ID or the environment ID of the environment where the assistant is deployed, + * depending on the type of request: - For message, session, and log requests, specify the + * 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 + * assistant settings and scroll to the **Environments** section. + * + *

**Note:** If you are using the classic Watson Assistant experience, always use the assistant + * ID. To find the assistant ID in the user interface, open the assistant settings and click API + * Details. + * + * @return the assistantId + */ + public String assistantId() { + return assistantId; + } + + /** + * Gets the skillId. + * + *

Unique identifier of the skill. To find the skill ID in the Watson Assistant user interface, + * open the skill settings and click **API Details**. + * + * @return the skillId + */ + public String skillId() { + return skillId; + } + + /** + * Gets the name. + * + *

The name of the skill. This string cannot contain carriage return, newline, or tab + * characters. + * + * @return the name + */ + public String name() { + return name; + } + + /** + * Gets the description. + * + *

The description of the skill. This string cannot contain carriage return, newline, or tab + * characters. + * + * @return the description + */ + public String description() { + return description; + } + + /** + * Gets the workspace. + * + *

An object containing the conversational content of an action or dialog skill. + * + * @return the workspace + */ + public Map workspace() { + return workspace; + } + + /** + * Gets the dialogSettings. + * + *

For internal use only. + * + * @return the dialogSettings + */ + public Map dialogSettings() { + return dialogSettings; + } + + /** + * Gets the searchSettings. + * + *

An object describing the search skill configuration. + * + * @return the searchSettings + */ + public SearchSettings searchSettings() { + return searchSettings; + } +}