Skip to content

[Conversation] Add newest generated code and update tests #878

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -99,17 +99,6 @@ public class Conversation extends WatsonService {

private String versionDate;

/** The Constant VERSION_DATE_2017_05_26. */
public static final String VERSION_DATE_2017_05_26 = "2017-05-26";
/** The Constant VERSION_DATE_2017_04_21. */
public static final String VERSION_DATE_2017_04_21 = "2017-04-21";
/** The Constant VERSION_DATE_2017_02_03. */
public static final String VERSION_DATE_2017_02_03 = "2017-02-03";
/** The Constant VERSION_DATE_2016_09_20. */
public static final String VERSION_DATE_2016_09_20 = "2016-09-20";
/** The Constant VERSION_DATE_2016_07_11. */
public static final String VERSION_DATE_2016_07_11 = "2016-07-11";

/**
* Instantiates a new `Conversation`.
*
Expand All @@ -122,8 +111,7 @@ public Conversation(String versionDate) {
setEndPoint(URL);
}

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

this.versionDate = versionDate;
}
Expand Down Expand Up @@ -231,6 +219,9 @@ public ServiceCall<WorkspaceExport> getWorkspace(GetWorkspaceOptions getWorkspac
if (getWorkspaceOptions.export() != null) {
builder.query("export", String.valueOf(getWorkspaceOptions.export()));
}
if (getWorkspaceOptions.includeAudit() != null) {
builder.query("include_audit", String.valueOf(getWorkspaceOptions.includeAudit()));
}
return createServiceCall(builder.build(), ResponseConverterUtils.getObject(WorkspaceExport.class));
}

Expand Down Expand Up @@ -258,6 +249,9 @@ public ServiceCall<WorkspaceCollection> listWorkspaces(ListWorkspacesOptions lis
if (listWorkspacesOptions.cursor() != null) {
builder.query("cursor", listWorkspacesOptions.cursor());
}
if (listWorkspacesOptions.includeAudit() != null) {
builder.query("include_audit", String.valueOf(listWorkspacesOptions.includeAudit()));
}
}
return createServiceCall(builder.build(), ResponseConverterUtils.getObject(WorkspaceCollection.class));
}
Expand Down Expand Up @@ -416,6 +410,9 @@ public ServiceCall<IntentExport> getIntent(GetIntentOptions getIntentOptions) {
if (getIntentOptions.export() != null) {
builder.query("export", String.valueOf(getIntentOptions.export()));
}
if (getIntentOptions.includeAudit() != null) {
builder.query("include_audit", String.valueOf(getIntentOptions.includeAudit()));
}
return createServiceCall(builder.build(), ResponseConverterUtils.getObject(IntentExport.class));
}

Expand Down Expand Up @@ -447,6 +444,9 @@ public ServiceCall<IntentCollection> listIntents(ListIntentsOptions listIntentsO
if (listIntentsOptions.cursor() != null) {
builder.query("cursor", listIntentsOptions.cursor());
}
if (listIntentsOptions.includeAudit() != null) {
builder.query("include_audit", String.valueOf(listIntentsOptions.includeAudit()));
}
return createServiceCall(builder.build(), ResponseConverterUtils.getObject(IntentCollection.class));
}

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

Expand Down Expand Up @@ -554,6 +557,9 @@ public ServiceCall<ExampleCollection> listExamples(ListExamplesOptions listExamp
if (listExamplesOptions.cursor() != null) {
builder.query("cursor", listExamplesOptions.cursor());
}
if (listExamplesOptions.includeAudit() != null) {
builder.query("include_audit", String.valueOf(listExamplesOptions.includeAudit()));
}
return createServiceCall(builder.build(), ResponseConverterUtils.getObject(ExampleCollection.class));
}

Expand Down Expand Up @@ -641,6 +647,9 @@ public ServiceCall<EntityExport> getEntity(GetEntityOptions getEntityOptions) {
if (getEntityOptions.export() != null) {
builder.query("export", String.valueOf(getEntityOptions.export()));
}
if (getEntityOptions.includeAudit() != null) {
builder.query("include_audit", String.valueOf(getEntityOptions.includeAudit()));
}
return createServiceCall(builder.build(), ResponseConverterUtils.getObject(EntityExport.class));
}

Expand Down Expand Up @@ -672,6 +681,9 @@ public ServiceCall<EntityCollection> listEntities(ListEntitiesOptions listEntiti
if (listEntitiesOptions.cursor() != null) {
builder.query("cursor", listEntitiesOptions.cursor());
}
if (listEntitiesOptions.includeAudit() != null) {
builder.query("include_audit", String.valueOf(listEntitiesOptions.includeAudit()));
}
return createServiceCall(builder.build(), ResponseConverterUtils.getObject(EntityCollection.class));
}

Expand Down Expand Up @@ -771,6 +783,9 @@ public ServiceCall<ValueExport> getValue(GetValueOptions getValueOptions) {
if (getValueOptions.export() != null) {
builder.query("export", String.valueOf(getValueOptions.export()));
}
if (getValueOptions.includeAudit() != null) {
builder.query("include_audit", String.valueOf(getValueOptions.includeAudit()));
}
return createServiceCall(builder.build(), ResponseConverterUtils.getObject(ValueExport.class));
}

Expand Down Expand Up @@ -802,6 +817,9 @@ public ServiceCall<ValueCollection> listValues(ListValuesOptions listValuesOptio
if (listValuesOptions.cursor() != null) {
builder.query("cursor", listValuesOptions.cursor());
}
if (listValuesOptions.includeAudit() != null) {
builder.query("include_audit", String.valueOf(listValuesOptions.includeAudit()));
}
return createServiceCall(builder.build(), ResponseConverterUtils.getObject(ValueCollection.class));
}

Expand Down Expand Up @@ -888,6 +906,9 @@ public ServiceCall<Synonym> getSynonym(GetSynonymOptions getSynonymOptions) {
getSynonymOptions.workspaceId(), getSynonymOptions.entity(), getSynonymOptions.value(), getSynonymOptions
.synonym()));
builder.query(VERSION, versionDate);
if (getSynonymOptions.includeAudit() != null) {
builder.query("include_audit", String.valueOf(getSynonymOptions.includeAudit()));
}
return createServiceCall(builder.build(), ResponseConverterUtils.getObject(Synonym.class));
}

Expand Down Expand Up @@ -916,6 +937,9 @@ public ServiceCall<SynonymCollection> listSynonyms(ListSynonymsOptions listSynon
if (listSynonymsOptions.cursor() != null) {
builder.query("cursor", listSynonymsOptions.cursor());
}
if (listSynonymsOptions.includeAudit() != null) {
builder.query("include_audit", String.valueOf(listSynonymsOptions.includeAudit()));
}
return createServiceCall(builder.build(), ResponseConverterUtils.getObject(SynonymCollection.class));
}

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

Expand Down Expand Up @@ -1056,6 +1083,9 @@ public ServiceCall<DialogNodeCollection> listDialogNodes(ListDialogNodesOptions
if (listDialogNodesOptions.cursor() != null) {
builder.query("cursor", listDialogNodesOptions.cursor());
}
if (listDialogNodesOptions.includeAudit() != null) {
builder.query("include_audit", String.valueOf(listDialogNodesOptions.includeAudit()));
}
return createServiceCall(builder.build(), ResponseConverterUtils.getObject(DialogNodeCollection.class));
}

Expand Down Expand Up @@ -1112,7 +1142,9 @@ public ServiceCall<DialogNode> updateDialogNode(UpdateDialogNodeOptions updateDi
if (updateDialogNodeOptions.newParent() != null) {
contentJson.addProperty("parent", updateDialogNodeOptions.newParent());
}
contentJson.addProperty("dialog_node", updateDialogNodeOptions.newDialogNode());
if (updateDialogNodeOptions.newDialogNode() != null) {
contentJson.addProperty("dialog_node", updateDialogNodeOptions.newDialogNode());
}
builder.bodyJson(contentJson);
return createServiceCall(builder.build(), ResponseConverterUtils.getObject(DialogNode.class));
}
Expand Down Expand Up @@ -1217,6 +1249,9 @@ public ServiceCall<Counterexample> getCounterexample(GetCounterexampleOptions ge
RequestBuilder builder = RequestBuilder.get(String.format("/v1/workspaces/%s/counterexamples/%s",
getCounterexampleOptions.workspaceId(), getCounterexampleOptions.text()));
builder.query(VERSION, versionDate);
if (getCounterexampleOptions.includeAudit() != null) {
builder.query("include_audit", String.valueOf(getCounterexampleOptions.includeAudit()));
}
return createServiceCall(builder.build(), ResponseConverterUtils.getObject(Counterexample.class));
}

Expand Down Expand Up @@ -1246,6 +1281,9 @@ public ServiceCall<CounterexampleCollection> listCounterexamples(
if (listCounterexamplesOptions.cursor() != null) {
builder.query("cursor", listCounterexamplesOptions.cursor());
}
if (listCounterexamplesOptions.includeAudit() != null) {
builder.query("include_audit", String.valueOf(listCounterexamplesOptions.includeAudit()));
}
return createServiceCall(builder.build(), ResponseConverterUtils.getObject(CounterexampleCollection.class));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,4 @@ public Date getCreated() {
public Date getUpdated() {
return updated;
}

/**
* Sets the text.
*
* @param text the new text
*/
public void setText(final String text) {
this.text = text;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,22 +45,4 @@ public List<Counterexample> getCounterexamples() {
public Pagination getPagination() {
return pagination;
}

/**
* Sets the counterexamples.
*
* @param counterexamples the new counterexamples
*/
public void setCounterexamples(final List<Counterexample> counterexamples) {
this.counterexamples = counterexamples;
}

/**
* Sets the pagination.
*
* @param pagination the new pagination
*/
public void setPagination(final Pagination pagination) {
this.pagination = pagination;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -259,130 +259,4 @@ public String getEventName() {
public String getVariable() {
return variable;
}

/**
* Sets the dialogNodeId.
*
* @param dialogNodeId the new dialogNodeId
*/
public void setDialogNodeId(final String dialogNodeId) {
this.dialogNodeId = dialogNodeId;
}

/**
* Sets the description.
*
* @param description the new description
*/
public void setDescription(final String description) {
this.description = description;
}

/**
* Sets the conditions.
*
* @param conditions the new conditions
*/
public void setConditions(final String conditions) {
this.conditions = conditions;
}

/**
* Sets the parent.
*
* @param parent the new parent
*/
public void setParent(final String parent) {
this.parent = parent;
}

/**
* Sets the previousSibling.
*
* @param previousSibling the new previousSibling
*/
public void setPreviousSibling(final String previousSibling) {
this.previousSibling = previousSibling;
}

/**
* Sets the output.
*
* @param output the new output
*/
public void setOutput(final Map output) {
this.output = output;
}

/**
* Sets the context.
*
* @param context the new context
*/
public void setContext(final Map context) {
this.context = context;
}

/**
* Sets the metadata.
*
* @param metadata the new metadata
*/
public void setMetadata(final Map metadata) {
this.metadata = metadata;
}

/**
* Sets the nextStep.
*
* @param nextStep the new nextStep
*/
public void setNextStep(final DialogNodeNextStep nextStep) {
this.nextStep = nextStep;
}

/**
* Sets the actions.
*
* @param actions the new actions
*/
public void setActions(final List<DialogNodeAction> actions) {
this.actions = actions;
}

/**
* Sets the title.
*
* @param title the new title
*/
public void setTitle(final String title) {
this.title = title;
}

/**
* Sets the nodeType.
*
* @param nodeType the new nodeType
*/
public void setNodeType(final String nodeType) {
this.nodeType = nodeType;
}

/**
* Sets the eventName.
*
* @param eventName the new eventName
*/
public void setEventName(final String eventName) {
this.eventName = eventName;
}

/**
* Sets the variable.
*
* @param variable the new variable
*/
public void setVariable(final String variable) {
this.variable = variable;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,22 +45,4 @@ public List<DialogNode> getDialogNodes() {
public Pagination getPagination() {
return pagination;
}

/**
* Sets the dialogNodes.
*
* @param dialogNodes the new dialogNodes
*/
public void setDialogNodes(final List<DialogNode> dialogNodes) {
this.dialogNodes = dialogNodes;
}

/**
* Sets the pagination.
*
* @param pagination the new pagination
*/
public void setPagination(final Pagination pagination) {
this.pagination = pagination;
}
}
Loading