Skip to content

Commit

Permalink
feat(assistant-v1): generated using api-def: master & generator: 3.46.0
Browse files Browse the repository at this point in the history
OutputData: BREAKING required text property removed, RuntimeEntity: BREAKING optional metadata
property removed, RuntimeResponseGeneric: Three new response types added, Workspace: MAYBE BREAKING
workspaceID changed form required to optional

BREAKING CHANGE: OutputData: BREAKING required text property removed, RuntimeEntity: BREAKING
optional metadata property removed
  • Loading branch information
kevinkowa committed Mar 15, 2022
1 parent 96e94d2 commit dc7f6a4
Show file tree
Hide file tree
Showing 7 changed files with 568 additions and 99 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2019, 2021.
* (C) Copyright IBM Corp. 2022.
*
* 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
Expand All @@ -12,7 +12,7 @@
*/

/*
* IBM OpenAPI SDK Code Generator Version: 3.38.0-07189efd-20210827-205025
* IBM OpenAPI SDK Code Generator Version: 3.46.0-a4e29da0-20220224-210428
*/

package com.ibm.watson.assistant.v1;
Expand Down Expand Up @@ -109,7 +109,7 @@
*/
public class Assistant extends BaseService {

public static final String DEFAULT_SERVICE_NAME = "assistant";
public static final String DEFAULT_SERVICE_NAME = "conversation";

public static final String DEFAULT_SERVICE_URL =
"https://api.us-south.assistant.watson.cloud.ibm.com";
Expand All @@ -121,7 +121,7 @@ public class Assistant extends BaseService {
* the client instance.
*
* @param version Release date of the API version you want to use. Specify dates in YYYY-MM-DD
* format. The current version is `2021-06-14`.
* format. The current version is `2021-11-27`.
*/
public Assistant(String version) {
this(
Expand All @@ -135,7 +135,7 @@ public Assistant(String version) {
* authenticator are used to configure the client instance.
*
* @param version Release date of the API version you want to use. Specify dates in YYYY-MM-DD
* format. The current version is `2021-06-14`.
* format. The current version is `2021-11-27`.
* @param authenticator the {@link Authenticator} instance to be configured for this client
*/
public Assistant(String version, Authenticator authenticator) {
Expand All @@ -147,7 +147,7 @@ public Assistant(String version, Authenticator authenticator) {
* configure the client instance.
*
* @param version Release date of the API version you want to use. Specify dates in YYYY-MM-DD
* format. The current version is `2021-06-14`.
* format. The current version is `2021-11-27`.
* @param serviceName the service name to be used when configuring the client instance
*/
public Assistant(String version, String serviceName) {
Expand All @@ -159,7 +159,7 @@ public Assistant(String version, String serviceName) {
* are used to configure the client instance.
*
* @param version Release date of the API version you want to use. Specify dates in YYYY-MM-DD
* format. The current version is `2021-06-14`.
* format. The current version is `2021-11-27`.
* @param serviceName the service name to be used when configuring the client instance
* @param authenticator the {@link Authenticator} instance to be configured for this client
*/
Expand All @@ -174,7 +174,7 @@ public Assistant(String version, String serviceName, Authenticator authenticator
* Gets the version.
*
* <p>Release date of the API version you want to use. Specify dates in YYYY-MM-DD format. The
* current version is `2021-06-14`.
* current version is `2021-11-27`.
*
* @return the version
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2017, 2020.
* (C) Copyright IBM Corp. 2022.
*
* 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
Expand Down Expand Up @@ -35,9 +35,6 @@ public class OutputData extends DynamicModel<Object> {
@SerializedName("log_messages")
protected List<LogMessage> logMessages;

@SerializedName("text")
protected List<String> text;

@SerializedName("generic")
protected List<RuntimeResponseGeneric> generic;

Expand All @@ -50,15 +47,13 @@ public static class Builder {
private List<String> nodesVisited;
private List<DialogNodeVisitedDetails> nodesVisitedDetails;
private List<LogMessage> logMessages;
private List<String> text;
private List<RuntimeResponseGeneric> generic;
private Map<String, Object> dynamicProperties;

private Builder(OutputData outputData) {
this.nodesVisited = outputData.nodesVisited;
this.nodesVisitedDetails = outputData.nodesVisitedDetails;
this.logMessages = outputData.logMessages;
this.text = outputData.text;
this.generic = outputData.generic;
this.dynamicProperties = outputData.getProperties();
}
Expand All @@ -70,11 +65,9 @@ public Builder() {}
* Instantiates a new builder with required properties.
*
* @param logMessages the logMessages
* @param text the text
*/
public Builder(List<LogMessage> logMessages, List<String> text) {
public Builder(List<LogMessage> logMessages) {
this.logMessages = logMessages;
this.text = text;
}

/**
Expand Down Expand Up @@ -132,21 +125,6 @@ public Builder addLogMessages(LogMessage logMessages) {
return this;
}

/**
* Adds an text to text.
*
* @param text the new text
* @return the OutputData builder
*/
public Builder addText(String text) {
com.ibm.cloud.sdk.core.util.Validator.notNull(text, "text cannot be null");
if (this.text == null) {
this.text = new ArrayList<String>();
}
this.text.add(text);
return this;
}

/**
* Adds an generic to generic.
*
Expand Down Expand Up @@ -195,17 +173,6 @@ public Builder logMessages(List<LogMessage> logMessages) {
return this;
}

/**
* Set the text. Existing text will be replaced.
*
* @param text the text
* @return the OutputData builder
*/
public Builder text(List<String> text) {
this.text = text;
return this;
}

/**
* Set the generic. Existing generic will be replaced.
*
Expand Down Expand Up @@ -238,11 +205,9 @@ protected OutputData(Builder builder) {
super(new TypeToken<Object>() {});
com.ibm.cloud.sdk.core.util.Validator.notNull(
builder.logMessages, "logMessages cannot be null");
com.ibm.cloud.sdk.core.util.Validator.notNull(builder.text, "text cannot be null");
nodesVisited = builder.nodesVisited;
nodesVisitedDetails = builder.nodesVisitedDetails;
logMessages = builder.logMessages;
text = builder.text;
generic = builder.generic;
this.setProperties(builder.dynamicProperties);
}
Expand Down Expand Up @@ -320,26 +285,6 @@ public void setLogMessages(final List<LogMessage> logMessages) {
this.logMessages = logMessages;
}

/**
* Gets the text.
*
* <p>An array of responses to the user.
*
* @return the text
*/
public List<String> getText() {
return this.text;
}

/**
* Sets the text.
*
* @param text the new text
*/
public void setText(final List<String> text) {
this.text = text;
}

/**
* Gets the generic.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2017, 2021.
* (C) Copyright IBM Corp. 2022.
*
* 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
Expand All @@ -15,7 +15,6 @@
import com.ibm.cloud.sdk.core.service.model.GenericModel;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/** A term from the request that was identified as an entity. */
public class RuntimeEntity extends GenericModel {
Expand All @@ -24,7 +23,6 @@ public class RuntimeEntity extends GenericModel {
protected List<Long> location;
protected String value;
protected Double confidence;
protected Map<String, Object> metadata;
protected List<CaptureGroup> groups;
protected RuntimeEntityInterpretation interpretation;
protected List<RuntimeEntityAlternative> alternatives;
Expand All @@ -36,7 +34,6 @@ public static class Builder {
private List<Long> location;
private String value;
private Double confidence;
private Map<String, Object> metadata;
private List<CaptureGroup> groups;
private RuntimeEntityInterpretation interpretation;
private List<RuntimeEntityAlternative> alternatives;
Expand All @@ -47,7 +44,6 @@ private Builder(RuntimeEntity runtimeEntity) {
this.location = runtimeEntity.location;
this.value = runtimeEntity.value;
this.confidence = runtimeEntity.confidence;
this.metadata = runtimeEntity.metadata;
this.groups = runtimeEntity.groups;
this.interpretation = runtimeEntity.interpretation;
this.alternatives = runtimeEntity.alternatives;
Expand Down Expand Up @@ -166,17 +162,6 @@ public Builder confidence(Double confidence) {
return this;
}

/**
* Set the metadata.
*
* @param metadata the metadata
* @return the RuntimeEntity builder
*/
public Builder metadata(Map<String, Object> metadata) {
this.metadata = metadata;
return this;
}

/**
* Set the groups. Existing groups will be replaced.
*
Expand Down Expand Up @@ -229,7 +214,6 @@ protected RuntimeEntity(Builder builder) {
location = builder.location;
value = builder.value;
confidence = builder.confidence;
metadata = builder.metadata;
groups = builder.groups;
interpretation = builder.interpretation;
alternatives = builder.alternatives;
Expand Down Expand Up @@ -290,21 +274,6 @@ public Double confidence() {
return confidence;
}

/**
* Gets the metadata.
*
* <p>**Deprecated.** Any metadata for the entity.
*
* <p>Beginning with the `2021-06-14` API version, the `metadata` property is no longer returned.
* For information about system entities recognized in the user input, see the `interpretation`
* property.
*
* @return the metadata
*/
public Map<String, Object> metadata() {
return metadata;
}

/**
* Gets the groups.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2019, 2021.
* (C) Copyright IBM Corp. 2022.
*
* 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
Expand All @@ -26,7 +26,9 @@
* RuntimeResponseGenericRuntimeResponseTypeConnectToAgent -
* RuntimeResponseGenericRuntimeResponseTypeSuggestion -
* RuntimeResponseGenericRuntimeResponseTypeChannelTransfer -
* RuntimeResponseGenericRuntimeResponseTypeUserDefined
* RuntimeResponseGenericRuntimeResponseTypeUserDefined -
* RuntimeResponseGenericRuntimeResponseTypeVideo - RuntimeResponseGenericRuntimeResponseTypeAudio -
* RuntimeResponseGenericRuntimeResponseTypeIframe
*/
public class RuntimeResponseGeneric extends GenericModel {
@SuppressWarnings("unused")
Expand All @@ -36,10 +38,12 @@ public class RuntimeResponseGeneric extends GenericModel {

static {
discriminatorMapping = new java.util.HashMap<>();
discriminatorMapping.put("audio", RuntimeResponseGenericRuntimeResponseTypeAudio.class);
discriminatorMapping.put(
"channel_transfer", RuntimeResponseGenericRuntimeResponseTypeChannelTransfer.class);
discriminatorMapping.put(
"connect_to_agent", RuntimeResponseGenericRuntimeResponseTypeConnectToAgent.class);
discriminatorMapping.put("iframe", RuntimeResponseGenericRuntimeResponseTypeIframe.class);
discriminatorMapping.put("image", RuntimeResponseGenericRuntimeResponseTypeImage.class);
discriminatorMapping.put("option", RuntimeResponseGenericRuntimeResponseTypeOption.class);
discriminatorMapping.put(
Expand All @@ -48,6 +52,7 @@ public class RuntimeResponseGeneric extends GenericModel {
discriminatorMapping.put("text", RuntimeResponseGenericRuntimeResponseTypeText.class);
discriminatorMapping.put(
"user_defined", RuntimeResponseGenericRuntimeResponseTypeUserDefined.class);
discriminatorMapping.put("video", RuntimeResponseGenericRuntimeResponseTypeVideo.class);
}

/** The preferred type of control to display. */
Expand Down Expand Up @@ -97,6 +102,12 @@ public interface Preference {
@SerializedName("user_defined")
protected Map<String, Object> userDefined;

@SerializedName("channel_options")
protected Map<String, Object> channelOptions;

@SerializedName("image_url")
protected String imageUrl;

protected RuntimeResponseGeneric() {}

/**
Expand Down Expand Up @@ -316,4 +327,26 @@ public String messageToUser() {
public Map<String, Object> userDefined() {
return userDefined;
}

/**
* Gets the channelOptions.
*
* <p>For internal use only.
*
* @return the channelOptions
*/
public Map<String, Object> channelOptions() {
return channelOptions;
}

/**
* Gets the imageUrl.
*
* <p>The URL of an image that shows a preview of the embedded content.
*
* @return the imageUrl
*/
public String imageUrl() {
return imageUrl;
}
}
Loading

0 comments on commit dc7f6a4

Please sign in to comment.