Skip to content

Commit b0ee30d

Browse files
Merge pull request #878 from watson-developer-cloud/codegen/conversation
[Conversation] Add newest generated code and update tests
2 parents 7e0d978 + 85573a2 commit b0ee30d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+844
-1290
lines changed

conversation/src/main/java/com/ibm/watson/developer_cloud/conversation/v1/Conversation.java

Lines changed: 52 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -99,17 +99,6 @@ public class Conversation extends WatsonService {
9999

100100
private String versionDate;
101101

102-
/** The Constant VERSION_DATE_2017_05_26. */
103-
public static final String VERSION_DATE_2017_05_26 = "2017-05-26";
104-
/** The Constant VERSION_DATE_2017_04_21. */
105-
public static final String VERSION_DATE_2017_04_21 = "2017-04-21";
106-
/** The Constant VERSION_DATE_2017_02_03. */
107-
public static final String VERSION_DATE_2017_02_03 = "2017-02-03";
108-
/** The Constant VERSION_DATE_2016_09_20. */
109-
public static final String VERSION_DATE_2016_09_20 = "2016-09-20";
110-
/** The Constant VERSION_DATE_2016_07_11. */
111-
public static final String VERSION_DATE_2016_07_11 = "2016-07-11";
112-
113102
/**
114103
* Instantiates a new `Conversation`.
115104
*
@@ -122,8 +111,7 @@ public Conversation(String versionDate) {
122111
setEndPoint(URL);
123112
}
124113

125-
Validator.isTrue((versionDate != null) && !versionDate.isEmpty(),
126-
"'version cannot be null. Use " + VERSION_DATE_2017_05_26);
114+
Validator.isTrue((versionDate != null) && !versionDate.isEmpty(), "version cannot be null.");
127115

128116
this.versionDate = versionDate;
129117
}
@@ -231,6 +219,9 @@ public ServiceCall<WorkspaceExport> getWorkspace(GetWorkspaceOptions getWorkspac
231219
if (getWorkspaceOptions.export() != null) {
232220
builder.query("export", String.valueOf(getWorkspaceOptions.export()));
233221
}
222+
if (getWorkspaceOptions.includeAudit() != null) {
223+
builder.query("include_audit", String.valueOf(getWorkspaceOptions.includeAudit()));
224+
}
234225
return createServiceCall(builder.build(), ResponseConverterUtils.getObject(WorkspaceExport.class));
235226
}
236227

@@ -258,6 +249,9 @@ public ServiceCall<WorkspaceCollection> listWorkspaces(ListWorkspacesOptions lis
258249
if (listWorkspacesOptions.cursor() != null) {
259250
builder.query("cursor", listWorkspacesOptions.cursor());
260251
}
252+
if (listWorkspacesOptions.includeAudit() != null) {
253+
builder.query("include_audit", String.valueOf(listWorkspacesOptions.includeAudit()));
254+
}
261255
}
262256
return createServiceCall(builder.build(), ResponseConverterUtils.getObject(WorkspaceCollection.class));
263257
}
@@ -416,6 +410,9 @@ public ServiceCall<IntentExport> getIntent(GetIntentOptions getIntentOptions) {
416410
if (getIntentOptions.export() != null) {
417411
builder.query("export", String.valueOf(getIntentOptions.export()));
418412
}
413+
if (getIntentOptions.includeAudit() != null) {
414+
builder.query("include_audit", String.valueOf(getIntentOptions.includeAudit()));
415+
}
419416
return createServiceCall(builder.build(), ResponseConverterUtils.getObject(IntentExport.class));
420417
}
421418

@@ -447,6 +444,9 @@ public ServiceCall<IntentCollection> listIntents(ListIntentsOptions listIntentsO
447444
if (listIntentsOptions.cursor() != null) {
448445
builder.query("cursor", listIntentsOptions.cursor());
449446
}
447+
if (listIntentsOptions.includeAudit() != null) {
448+
builder.query("include_audit", String.valueOf(listIntentsOptions.includeAudit()));
449+
}
450450
return createServiceCall(builder.build(), ResponseConverterUtils.getObject(IntentCollection.class));
451451
}
452452

@@ -526,6 +526,9 @@ public ServiceCall<Example> getExample(GetExampleOptions getExampleOptions) {
526526
RequestBuilder builder = RequestBuilder.get(String.format("/v1/workspaces/%s/intents/%s/examples/%s",
527527
getExampleOptions.workspaceId(), getExampleOptions.intent(), getExampleOptions.text()));
528528
builder.query(VERSION, versionDate);
529+
if (getExampleOptions.includeAudit() != null) {
530+
builder.query("include_audit", String.valueOf(getExampleOptions.includeAudit()));
531+
}
529532
return createServiceCall(builder.build(), ResponseConverterUtils.getObject(Example.class));
530533
}
531534

@@ -554,6 +557,9 @@ public ServiceCall<ExampleCollection> listExamples(ListExamplesOptions listExamp
554557
if (listExamplesOptions.cursor() != null) {
555558
builder.query("cursor", listExamplesOptions.cursor());
556559
}
560+
if (listExamplesOptions.includeAudit() != null) {
561+
builder.query("include_audit", String.valueOf(listExamplesOptions.includeAudit()));
562+
}
557563
return createServiceCall(builder.build(), ResponseConverterUtils.getObject(ExampleCollection.class));
558564
}
559565

@@ -641,6 +647,9 @@ public ServiceCall<EntityExport> getEntity(GetEntityOptions getEntityOptions) {
641647
if (getEntityOptions.export() != null) {
642648
builder.query("export", String.valueOf(getEntityOptions.export()));
643649
}
650+
if (getEntityOptions.includeAudit() != null) {
651+
builder.query("include_audit", String.valueOf(getEntityOptions.includeAudit()));
652+
}
644653
return createServiceCall(builder.build(), ResponseConverterUtils.getObject(EntityExport.class));
645654
}
646655

@@ -672,6 +681,9 @@ public ServiceCall<EntityCollection> listEntities(ListEntitiesOptions listEntiti
672681
if (listEntitiesOptions.cursor() != null) {
673682
builder.query("cursor", listEntitiesOptions.cursor());
674683
}
684+
if (listEntitiesOptions.includeAudit() != null) {
685+
builder.query("include_audit", String.valueOf(listEntitiesOptions.includeAudit()));
686+
}
675687
return createServiceCall(builder.build(), ResponseConverterUtils.getObject(EntityCollection.class));
676688
}
677689

@@ -771,6 +783,9 @@ public ServiceCall<ValueExport> getValue(GetValueOptions getValueOptions) {
771783
if (getValueOptions.export() != null) {
772784
builder.query("export", String.valueOf(getValueOptions.export()));
773785
}
786+
if (getValueOptions.includeAudit() != null) {
787+
builder.query("include_audit", String.valueOf(getValueOptions.includeAudit()));
788+
}
774789
return createServiceCall(builder.build(), ResponseConverterUtils.getObject(ValueExport.class));
775790
}
776791

@@ -802,6 +817,9 @@ public ServiceCall<ValueCollection> listValues(ListValuesOptions listValuesOptio
802817
if (listValuesOptions.cursor() != null) {
803818
builder.query("cursor", listValuesOptions.cursor());
804819
}
820+
if (listValuesOptions.includeAudit() != null) {
821+
builder.query("include_audit", String.valueOf(listValuesOptions.includeAudit()));
822+
}
805823
return createServiceCall(builder.build(), ResponseConverterUtils.getObject(ValueCollection.class));
806824
}
807825

@@ -888,6 +906,9 @@ public ServiceCall<Synonym> getSynonym(GetSynonymOptions getSynonymOptions) {
888906
getSynonymOptions.workspaceId(), getSynonymOptions.entity(), getSynonymOptions.value(), getSynonymOptions
889907
.synonym()));
890908
builder.query(VERSION, versionDate);
909+
if (getSynonymOptions.includeAudit() != null) {
910+
builder.query("include_audit", String.valueOf(getSynonymOptions.includeAudit()));
911+
}
891912
return createServiceCall(builder.build(), ResponseConverterUtils.getObject(Synonym.class));
892913
}
893914

@@ -916,6 +937,9 @@ public ServiceCall<SynonymCollection> listSynonyms(ListSynonymsOptions listSynon
916937
if (listSynonymsOptions.cursor() != null) {
917938
builder.query("cursor", listSynonymsOptions.cursor());
918939
}
940+
if (listSynonymsOptions.includeAudit() != null) {
941+
builder.query("include_audit", String.valueOf(listSynonymsOptions.includeAudit()));
942+
}
919943
return createServiceCall(builder.build(), ResponseConverterUtils.getObject(SynonymCollection.class));
920944
}
921945

@@ -1028,6 +1052,9 @@ public ServiceCall<DialogNode> getDialogNode(GetDialogNodeOptions getDialogNodeO
10281052
RequestBuilder builder = RequestBuilder.get(String.format("/v1/workspaces/%s/dialog_nodes/%s", getDialogNodeOptions
10291053
.workspaceId(), getDialogNodeOptions.dialogNode()));
10301054
builder.query(VERSION, versionDate);
1055+
if (getDialogNodeOptions.includeAudit() != null) {
1056+
builder.query("include_audit", String.valueOf(getDialogNodeOptions.includeAudit()));
1057+
}
10311058
return createServiceCall(builder.build(), ResponseConverterUtils.getObject(DialogNode.class));
10321059
}
10331060

@@ -1056,6 +1083,9 @@ public ServiceCall<DialogNodeCollection> listDialogNodes(ListDialogNodesOptions
10561083
if (listDialogNodesOptions.cursor() != null) {
10571084
builder.query("cursor", listDialogNodesOptions.cursor());
10581085
}
1086+
if (listDialogNodesOptions.includeAudit() != null) {
1087+
builder.query("include_audit", String.valueOf(listDialogNodesOptions.includeAudit()));
1088+
}
10591089
return createServiceCall(builder.build(), ResponseConverterUtils.getObject(DialogNodeCollection.class));
10601090
}
10611091

@@ -1112,7 +1142,9 @@ public ServiceCall<DialogNode> updateDialogNode(UpdateDialogNodeOptions updateDi
11121142
if (updateDialogNodeOptions.newParent() != null) {
11131143
contentJson.addProperty("parent", updateDialogNodeOptions.newParent());
11141144
}
1115-
contentJson.addProperty("dialog_node", updateDialogNodeOptions.newDialogNode());
1145+
if (updateDialogNodeOptions.newDialogNode() != null) {
1146+
contentJson.addProperty("dialog_node", updateDialogNodeOptions.newDialogNode());
1147+
}
11161148
builder.bodyJson(contentJson);
11171149
return createServiceCall(builder.build(), ResponseConverterUtils.getObject(DialogNode.class));
11181150
}
@@ -1217,6 +1249,9 @@ public ServiceCall<Counterexample> getCounterexample(GetCounterexampleOptions ge
12171249
RequestBuilder builder = RequestBuilder.get(String.format("/v1/workspaces/%s/counterexamples/%s",
12181250
getCounterexampleOptions.workspaceId(), getCounterexampleOptions.text()));
12191251
builder.query(VERSION, versionDate);
1252+
if (getCounterexampleOptions.includeAudit() != null) {
1253+
builder.query("include_audit", String.valueOf(getCounterexampleOptions.includeAudit()));
1254+
}
12201255
return createServiceCall(builder.build(), ResponseConverterUtils.getObject(Counterexample.class));
12211256
}
12221257

@@ -1246,6 +1281,9 @@ public ServiceCall<CounterexampleCollection> listCounterexamples(
12461281
if (listCounterexamplesOptions.cursor() != null) {
12471282
builder.query("cursor", listCounterexamplesOptions.cursor());
12481283
}
1284+
if (listCounterexamplesOptions.includeAudit() != null) {
1285+
builder.query("include_audit", String.valueOf(listCounterexamplesOptions.includeAudit()));
1286+
}
12491287
return createServiceCall(builder.build(), ResponseConverterUtils.getObject(CounterexampleCollection.class));
12501288
}
12511289

conversation/src/main/java/com/ibm/watson/developer_cloud/conversation/v1/model/Counterexample.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,4 @@ public Date getCreated() {
5757
public Date getUpdated() {
5858
return updated;
5959
}
60-
61-
/**
62-
* Sets the text.
63-
*
64-
* @param text the new text
65-
*/
66-
public void setText(final String text) {
67-
this.text = text;
68-
}
6960
}

conversation/src/main/java/com/ibm/watson/developer_cloud/conversation/v1/model/CounterexampleCollection.java

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -45,22 +45,4 @@ public List<Counterexample> getCounterexamples() {
4545
public Pagination getPagination() {
4646
return pagination;
4747
}
48-
49-
/**
50-
* Sets the counterexamples.
51-
*
52-
* @param counterexamples the new counterexamples
53-
*/
54-
public void setCounterexamples(final List<Counterexample> counterexamples) {
55-
this.counterexamples = counterexamples;
56-
}
57-
58-
/**
59-
* Sets the pagination.
60-
*
61-
* @param pagination the new pagination
62-
*/
63-
public void setPagination(final Pagination pagination) {
64-
this.pagination = pagination;
65-
}
6648
}

conversation/src/main/java/com/ibm/watson/developer_cloud/conversation/v1/model/DialogNode.java

Lines changed: 0 additions & 126 deletions
Original file line numberDiff line numberDiff line change
@@ -259,130 +259,4 @@ public String getEventName() {
259259
public String getVariable() {
260260
return variable;
261261
}
262-
263-
/**
264-
* Sets the dialogNodeId.
265-
*
266-
* @param dialogNodeId the new dialogNodeId
267-
*/
268-
public void setDialogNodeId(final String dialogNodeId) {
269-
this.dialogNodeId = dialogNodeId;
270-
}
271-
272-
/**
273-
* Sets the description.
274-
*
275-
* @param description the new description
276-
*/
277-
public void setDescription(final String description) {
278-
this.description = description;
279-
}
280-
281-
/**
282-
* Sets the conditions.
283-
*
284-
* @param conditions the new conditions
285-
*/
286-
public void setConditions(final String conditions) {
287-
this.conditions = conditions;
288-
}
289-
290-
/**
291-
* Sets the parent.
292-
*
293-
* @param parent the new parent
294-
*/
295-
public void setParent(final String parent) {
296-
this.parent = parent;
297-
}
298-
299-
/**
300-
* Sets the previousSibling.
301-
*
302-
* @param previousSibling the new previousSibling
303-
*/
304-
public void setPreviousSibling(final String previousSibling) {
305-
this.previousSibling = previousSibling;
306-
}
307-
308-
/**
309-
* Sets the output.
310-
*
311-
* @param output the new output
312-
*/
313-
public void setOutput(final Map output) {
314-
this.output = output;
315-
}
316-
317-
/**
318-
* Sets the context.
319-
*
320-
* @param context the new context
321-
*/
322-
public void setContext(final Map context) {
323-
this.context = context;
324-
}
325-
326-
/**
327-
* Sets the metadata.
328-
*
329-
* @param metadata the new metadata
330-
*/
331-
public void setMetadata(final Map metadata) {
332-
this.metadata = metadata;
333-
}
334-
335-
/**
336-
* Sets the nextStep.
337-
*
338-
* @param nextStep the new nextStep
339-
*/
340-
public void setNextStep(final DialogNodeNextStep nextStep) {
341-
this.nextStep = nextStep;
342-
}
343-
344-
/**
345-
* Sets the actions.
346-
*
347-
* @param actions the new actions
348-
*/
349-
public void setActions(final List<DialogNodeAction> actions) {
350-
this.actions = actions;
351-
}
352-
353-
/**
354-
* Sets the title.
355-
*
356-
* @param title the new title
357-
*/
358-
public void setTitle(final String title) {
359-
this.title = title;
360-
}
361-
362-
/**
363-
* Sets the nodeType.
364-
*
365-
* @param nodeType the new nodeType
366-
*/
367-
public void setNodeType(final String nodeType) {
368-
this.nodeType = nodeType;
369-
}
370-
371-
/**
372-
* Sets the eventName.
373-
*
374-
* @param eventName the new eventName
375-
*/
376-
public void setEventName(final String eventName) {
377-
this.eventName = eventName;
378-
}
379-
380-
/**
381-
* Sets the variable.
382-
*
383-
* @param variable the new variable
384-
*/
385-
public void setVariable(final String variable) {
386-
this.variable = variable;
387-
}
388262
}

conversation/src/main/java/com/ibm/watson/developer_cloud/conversation/v1/model/DialogNodeCollection.java

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -45,22 +45,4 @@ public List<DialogNode> getDialogNodes() {
4545
public Pagination getPagination() {
4646
return pagination;
4747
}
48-
49-
/**
50-
* Sets the dialogNodes.
51-
*
52-
* @param dialogNodes the new dialogNodes
53-
*/
54-
public void setDialogNodes(final List<DialogNode> dialogNodes) {
55-
this.dialogNodes = dialogNodes;
56-
}
57-
58-
/**
59-
* Sets the pagination.
60-
*
61-
* @param pagination the new pagination
62-
*/
63-
public void setPagination(final Pagination pagination) {
64-
this.pagination = pagination;
65-
}
6648
}

0 commit comments

Comments
 (0)