Skip to content

Commit 64a2622

Browse files
feat(assistantv1): update models and add new methods
NEW methods: createWorkspaceAsync, updateWorkspaceAsync, exportWorkspaceAsync
1 parent cac83a5 commit 64a2622

File tree

10 files changed

+1700
-15
lines changed

10 files changed

+1700
-15
lines changed

assistant/src/main/java/com/ibm/watson/assistant/v1/Assistant.java

Lines changed: 277 additions & 1 deletion
Large diffs are not rendered by default.

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

Lines changed: 420 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
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 com.ibm.cloud.sdk.core.service.model.GenericModel;
16+
17+
/** The exportWorkspaceAsync options. */
18+
public class ExportWorkspaceAsyncOptions extends GenericModel {
19+
20+
/**
21+
* Indicates how the returned workspace data will be sorted. Specify `sort=stable` to sort all
22+
* workspace objects by unique identifier, in ascending alphabetical order.
23+
*/
24+
public interface Sort {
25+
/** stable. */
26+
String STABLE = "stable";
27+
}
28+
29+
protected String workspaceId;
30+
protected Boolean includeAudit;
31+
protected String sort;
32+
protected Boolean verbose;
33+
34+
/** Builder. */
35+
public static class Builder {
36+
private String workspaceId;
37+
private Boolean includeAudit;
38+
private String sort;
39+
private Boolean verbose;
40+
41+
private Builder(ExportWorkspaceAsyncOptions exportWorkspaceAsyncOptions) {
42+
this.workspaceId = exportWorkspaceAsyncOptions.workspaceId;
43+
this.includeAudit = exportWorkspaceAsyncOptions.includeAudit;
44+
this.sort = exportWorkspaceAsyncOptions.sort;
45+
this.verbose = exportWorkspaceAsyncOptions.verbose;
46+
}
47+
48+
/** Instantiates a new builder. */
49+
public Builder() {}
50+
51+
/**
52+
* Instantiates a new builder with required properties.
53+
*
54+
* @param workspaceId the workspaceId
55+
*/
56+
public Builder(String workspaceId) {
57+
this.workspaceId = workspaceId;
58+
}
59+
60+
/**
61+
* Builds a ExportWorkspaceAsyncOptions.
62+
*
63+
* @return the new ExportWorkspaceAsyncOptions instance
64+
*/
65+
public ExportWorkspaceAsyncOptions build() {
66+
return new ExportWorkspaceAsyncOptions(this);
67+
}
68+
69+
/**
70+
* Set the workspaceId.
71+
*
72+
* @param workspaceId the workspaceId
73+
* @return the ExportWorkspaceAsyncOptions builder
74+
*/
75+
public Builder workspaceId(String workspaceId) {
76+
this.workspaceId = workspaceId;
77+
return this;
78+
}
79+
80+
/**
81+
* Set the includeAudit.
82+
*
83+
* @param includeAudit the includeAudit
84+
* @return the ExportWorkspaceAsyncOptions builder
85+
*/
86+
public Builder includeAudit(Boolean includeAudit) {
87+
this.includeAudit = includeAudit;
88+
return this;
89+
}
90+
91+
/**
92+
* Set the sort.
93+
*
94+
* @param sort the sort
95+
* @return the ExportWorkspaceAsyncOptions builder
96+
*/
97+
public Builder sort(String sort) {
98+
this.sort = sort;
99+
return this;
100+
}
101+
102+
/**
103+
* Set the verbose.
104+
*
105+
* @param verbose the verbose
106+
* @return the ExportWorkspaceAsyncOptions builder
107+
*/
108+
public Builder verbose(Boolean verbose) {
109+
this.verbose = verbose;
110+
return this;
111+
}
112+
}
113+
114+
protected ExportWorkspaceAsyncOptions() {}
115+
116+
protected ExportWorkspaceAsyncOptions(Builder builder) {
117+
com.ibm.cloud.sdk.core.util.Validator.notEmpty(
118+
builder.workspaceId, "workspaceId cannot be empty");
119+
workspaceId = builder.workspaceId;
120+
includeAudit = builder.includeAudit;
121+
sort = builder.sort;
122+
verbose = builder.verbose;
123+
}
124+
125+
/**
126+
* New builder.
127+
*
128+
* @return a ExportWorkspaceAsyncOptions builder
129+
*/
130+
public Builder newBuilder() {
131+
return new Builder(this);
132+
}
133+
134+
/**
135+
* Gets the workspaceId.
136+
*
137+
* <p>Unique identifier of the workspace.
138+
*
139+
* @return the workspaceId
140+
*/
141+
public String workspaceId() {
142+
return workspaceId;
143+
}
144+
145+
/**
146+
* Gets the includeAudit.
147+
*
148+
* <p>Whether to include the audit properties (`created` and `updated` timestamps) in the
149+
* response.
150+
*
151+
* @return the includeAudit
152+
*/
153+
public Boolean includeAudit() {
154+
return includeAudit;
155+
}
156+
157+
/**
158+
* Gets the sort.
159+
*
160+
* <p>Indicates how the returned workspace data will be sorted. Specify `sort=stable` to sort all
161+
* workspace objects by unique identifier, in ascending alphabetical order.
162+
*
163+
* @return the sort
164+
*/
165+
public String sort() {
166+
return sort;
167+
}
168+
169+
/**
170+
* Gets the verbose.
171+
*
172+
* <p>Whether the response should include the `counts` property, which indicates how many of each
173+
* component (such as intents and entities) the workspace contains.
174+
*
175+
* @return the verbose
176+
*/
177+
public Boolean verbose() {
178+
return verbose;
179+
}
180+
}

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* (C) Copyright IBM Corp. 2017, 2020.
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
@@ -37,11 +37,9 @@ public Builder() {}
3737
* Instantiates a new builder with required properties.
3838
*
3939
* @param intent the intent
40-
* @param confidence the confidence
4140
*/
42-
public Builder(String intent, Double confidence) {
41+
public Builder(String intent) {
4342
this.intent = intent;
44-
this.confidence = confidence;
4543
}
4644

4745
/**
@@ -76,9 +74,10 @@ public Builder confidence(Double confidence) {
7674
}
7775
}
7876

77+
protected RuntimeIntent() {}
78+
7979
protected RuntimeIntent(Builder builder) {
8080
com.ibm.cloud.sdk.core.util.Validator.notNull(builder.intent, "intent cannot be null");
81-
com.ibm.cloud.sdk.core.util.Validator.notNull(builder.confidence, "confidence cannot be null");
8281
intent = builder.intent;
8382
confidence = builder.confidence;
8483
}
@@ -106,7 +105,9 @@ public String intent() {
106105
/**
107106
* Gets the confidence.
108107
*
109-
* <p>A decimal percentage that represents Watson's confidence in the intent.
108+
* <p>A decimal percentage that represents Watson's confidence in the intent. If you are
109+
* specifying an intent as part of a request, but you do not have a calculated confidence value,
110+
* specify `1`.
110111
*
111112
* @return the confidence
112113
*/
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
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 com.ibm.cloud.sdk.core.service.model.GenericModel;
16+
17+
/** An object describing an error that occurred during processing of an asynchronous operation. */
18+
public class StatusError extends GenericModel {
19+
20+
protected String message;
21+
22+
/** Builder. */
23+
public static class Builder {
24+
private String message;
25+
26+
private Builder(StatusError statusError) {
27+
this.message = statusError.message;
28+
}
29+
30+
/** Instantiates a new builder. */
31+
public Builder() {}
32+
33+
/**
34+
* Builds a StatusError.
35+
*
36+
* @return the new StatusError instance
37+
*/
38+
public StatusError build() {
39+
return new StatusError(this);
40+
}
41+
42+
/**
43+
* Set the message.
44+
*
45+
* @param message the message
46+
* @return the StatusError builder
47+
*/
48+
public Builder message(String message) {
49+
this.message = message;
50+
return this;
51+
}
52+
}
53+
54+
protected StatusError() {}
55+
56+
protected StatusError(Builder builder) {
57+
message = builder.message;
58+
}
59+
60+
/**
61+
* New builder.
62+
*
63+
* @return a StatusError builder
64+
*/
65+
public Builder newBuilder() {
66+
return new Builder(this);
67+
}
68+
69+
/**
70+
* Gets the message.
71+
*
72+
* <p>The text of the error message.
73+
*
74+
* @return the message
75+
*/
76+
public String message() {
77+
return message;
78+
}
79+
}

0 commit comments

Comments
 (0)