Skip to content

Commit dfeacca

Browse files
committed
feat(assistant-v1): add new DialogNodeOutputGeneric subclasses & additional properties in workspace
1 parent e627c4e commit dfeacca

6 files changed

+677
-20
lines changed

assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputGeneric.java

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* (C) Copyright IBM Corp. 2018, 2021.
2+
* (C) Copyright IBM Corp. 2022.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
55
* the License. You may obtain a copy of the License at
@@ -27,7 +27,10 @@
2727
* DialogNodeOutputGenericDialogNodeOutputResponseTypeConnectToAgent -
2828
* DialogNodeOutputGenericDialogNodeOutputResponseTypeSearchSkill -
2929
* DialogNodeOutputGenericDialogNodeOutputResponseTypeChannelTransfer -
30-
* DialogNodeOutputGenericDialogNodeOutputResponseTypeUserDefined
30+
* DialogNodeOutputGenericDialogNodeOutputResponseTypeUserDefined -
31+
* DialogNodeOutputGenericDialogNodeOutputResponseTypeVideo -
32+
* DialogNodeOutputGenericDialogNodeOutputResponseTypeAudio -
33+
* DialogNodeOutputGenericDialogNodeOutputResponseTypeIframe
3134
*/
3235
public class DialogNodeOutputGeneric extends GenericModel {
3336
@SuppressWarnings("unused")
@@ -37,12 +40,16 @@ public class DialogNodeOutputGeneric extends GenericModel {
3740

3841
static {
3942
discriminatorMapping = new java.util.HashMap<>();
43+
discriminatorMapping.put(
44+
"audio", DialogNodeOutputGenericDialogNodeOutputResponseTypeAudio.class);
4045
discriminatorMapping.put(
4146
"channel_transfer",
4247
DialogNodeOutputGenericDialogNodeOutputResponseTypeChannelTransfer.class);
4348
discriminatorMapping.put(
4449
"connect_to_agent",
4550
DialogNodeOutputGenericDialogNodeOutputResponseTypeConnectToAgent.class);
51+
discriminatorMapping.put(
52+
"iframe", DialogNodeOutputGenericDialogNodeOutputResponseTypeIframe.class);
4653
discriminatorMapping.put(
4754
"image", DialogNodeOutputGenericDialogNodeOutputResponseTypeImage.class);
4855
discriminatorMapping.put(
@@ -54,6 +61,8 @@ public class DialogNodeOutputGeneric extends GenericModel {
5461
discriminatorMapping.put("text", DialogNodeOutputGenericDialogNodeOutputResponseTypeText.class);
5562
discriminatorMapping.put(
5663
"user_defined", DialogNodeOutputGenericDialogNodeOutputResponseTypeUserDefined.class);
64+
discriminatorMapping.put(
65+
"video", DialogNodeOutputGenericDialogNodeOutputResponseTypeVideo.class);
5766
}
5867

5968
/** How a response is selected from the list, if more than one response is specified. */
@@ -129,6 +138,12 @@ public interface QueryType {
129138
@SerializedName("user_defined")
130139
protected Map<String, Object> userDefined;
131140

141+
@SerializedName("channel_options")
142+
protected Map<String, Object> channelOptions;
143+
144+
@SerializedName("image_url")
145+
protected String imageUrl;
146+
132147
protected DialogNodeOutputGeneric() {}
133148

134149
/**
@@ -384,4 +399,26 @@ public String messageToUser() {
384399
public Map<String, Object> userDefined() {
385400
return userDefined;
386401
}
402+
403+
/**
404+
* Gets the channelOptions.
405+
*
406+
* <p>For internal use only.
407+
*
408+
* @return the channelOptions
409+
*/
410+
public Map<String, Object> channelOptions() {
411+
return channelOptions;
412+
}
413+
414+
/**
415+
* Gets the imageUrl.
416+
*
417+
* <p>The URL of an image that shows a preview of the embedded content.
418+
*
419+
* @return the imageUrl
420+
*/
421+
public String imageUrl() {
422+
return imageUrl;
423+
}
387424
}
Lines changed: 181 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
/*
2+
* (C) Copyright IBM Corp. 2022.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
5+
* the License. You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
10+
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
11+
* specific language governing permissions and limitations under the License.
12+
*/
13+
package com.ibm.watson.assistant.v1.model;
14+
15+
import java.util.ArrayList;
16+
import java.util.List;
17+
import java.util.Map;
18+
19+
/** DialogNodeOutputGenericDialogNodeOutputResponseTypeAudio. */
20+
public class DialogNodeOutputGenericDialogNodeOutputResponseTypeAudio
21+
extends DialogNodeOutputGeneric {
22+
23+
/** Builder. */
24+
public static class Builder {
25+
private String responseType;
26+
private String source;
27+
private String title;
28+
private String description;
29+
private List<ResponseGenericChannel> channels;
30+
private Map<String, Object> channelOptions;
31+
private String altText;
32+
33+
public Builder(
34+
DialogNodeOutputGeneric dialogNodeOutputGenericDialogNodeOutputResponseTypeAudio) {
35+
this.responseType = dialogNodeOutputGenericDialogNodeOutputResponseTypeAudio.responseType;
36+
this.source = dialogNodeOutputGenericDialogNodeOutputResponseTypeAudio.source;
37+
this.title = dialogNodeOutputGenericDialogNodeOutputResponseTypeAudio.title;
38+
this.description = dialogNodeOutputGenericDialogNodeOutputResponseTypeAudio.description;
39+
this.channels = dialogNodeOutputGenericDialogNodeOutputResponseTypeAudio.channels;
40+
this.channelOptions = dialogNodeOutputGenericDialogNodeOutputResponseTypeAudio.channelOptions;
41+
this.altText = dialogNodeOutputGenericDialogNodeOutputResponseTypeAudio.altText;
42+
}
43+
44+
/** Instantiates a new builder. */
45+
public Builder() {}
46+
47+
/**
48+
* Instantiates a new builder with required properties.
49+
*
50+
* @param responseType the responseType
51+
* @param source the source
52+
*/
53+
public Builder(String responseType, String source) {
54+
this.responseType = responseType;
55+
this.source = source;
56+
}
57+
58+
/**
59+
* Builds a DialogNodeOutputGenericDialogNodeOutputResponseTypeAudio.
60+
*
61+
* @return the new DialogNodeOutputGenericDialogNodeOutputResponseTypeAudio instance
62+
*/
63+
public DialogNodeOutputGenericDialogNodeOutputResponseTypeAudio build() {
64+
return new DialogNodeOutputGenericDialogNodeOutputResponseTypeAudio(this);
65+
}
66+
67+
/**
68+
* Adds an channels to channels.
69+
*
70+
* @param channels the new channels
71+
* @return the DialogNodeOutputGenericDialogNodeOutputResponseTypeAudio builder
72+
*/
73+
public Builder addChannels(ResponseGenericChannel channels) {
74+
com.ibm.cloud.sdk.core.util.Validator.notNull(channels, "channels cannot be null");
75+
if (this.channels == null) {
76+
this.channels = new ArrayList<ResponseGenericChannel>();
77+
}
78+
this.channels.add(channels);
79+
return this;
80+
}
81+
82+
/**
83+
* Set the responseType.
84+
*
85+
* @param responseType the responseType
86+
* @return the DialogNodeOutputGenericDialogNodeOutputResponseTypeAudio builder
87+
*/
88+
public Builder responseType(String responseType) {
89+
this.responseType = responseType;
90+
return this;
91+
}
92+
93+
/**
94+
* Set the source.
95+
*
96+
* @param source the source
97+
* @return the DialogNodeOutputGenericDialogNodeOutputResponseTypeAudio builder
98+
*/
99+
public Builder source(String source) {
100+
this.source = source;
101+
return this;
102+
}
103+
104+
/**
105+
* Set the title.
106+
*
107+
* @param title the title
108+
* @return the DialogNodeOutputGenericDialogNodeOutputResponseTypeAudio builder
109+
*/
110+
public Builder title(String title) {
111+
this.title = title;
112+
return this;
113+
}
114+
115+
/**
116+
* Set the description.
117+
*
118+
* @param description the description
119+
* @return the DialogNodeOutputGenericDialogNodeOutputResponseTypeAudio builder
120+
*/
121+
public Builder description(String description) {
122+
this.description = description;
123+
return this;
124+
}
125+
126+
/**
127+
* Set the channels. Existing channels will be replaced.
128+
*
129+
* @param channels the channels
130+
* @return the DialogNodeOutputGenericDialogNodeOutputResponseTypeAudio builder
131+
*/
132+
public Builder channels(List<ResponseGenericChannel> channels) {
133+
this.channels = channels;
134+
return this;
135+
}
136+
137+
/**
138+
* Set the channelOptions.
139+
*
140+
* @param channelOptions the channelOptions
141+
* @return the DialogNodeOutputGenericDialogNodeOutputResponseTypeAudio builder
142+
*/
143+
public Builder channelOptions(Map<String, Object> channelOptions) {
144+
this.channelOptions = channelOptions;
145+
return this;
146+
}
147+
148+
/**
149+
* Set the altText.
150+
*
151+
* @param altText the altText
152+
* @return the DialogNodeOutputGenericDialogNodeOutputResponseTypeAudio builder
153+
*/
154+
public Builder altText(String altText) {
155+
this.altText = altText;
156+
return this;
157+
}
158+
}
159+
160+
protected DialogNodeOutputGenericDialogNodeOutputResponseTypeAudio(Builder builder) {
161+
com.ibm.cloud.sdk.core.util.Validator.notNull(
162+
builder.responseType, "responseType cannot be null");
163+
com.ibm.cloud.sdk.core.util.Validator.notNull(builder.source, "source cannot be null");
164+
responseType = builder.responseType;
165+
source = builder.source;
166+
title = builder.title;
167+
description = builder.description;
168+
channels = builder.channels;
169+
channelOptions = builder.channelOptions;
170+
altText = builder.altText;
171+
}
172+
173+
/**
174+
* New builder.
175+
*
176+
* @return a DialogNodeOutputGenericDialogNodeOutputResponseTypeAudio builder
177+
*/
178+
public Builder newBuilder() {
179+
return new Builder(this);
180+
}
181+
}

0 commit comments

Comments
 (0)