Skip to content

Commit

Permalink
feat(generation): api def tag 'sdk-2020-08-20' and gen tag '2.3.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinkowa committed Aug 21, 2020
1 parent f0fdd3d commit 1129e9b
Show file tree
Hide file tree
Showing 108 changed files with 6,282 additions and 1,299 deletions.
156 changes: 3 additions & 153 deletions assistant/src/main/java/com/ibm/watson/assistant/v1/Assistant.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2018, 2020.
* (C) Copyright IBM Corp. 2020.
*
* 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 @@ -24,8 +24,7 @@ public class DialogNodeOutputGeneric extends GenericModel {
* The type of response returned by the dialog node. The specified response type must be supported
* by the client application or channel.
*
* <p>**Note:** The **search_skill** response type is available only for Plus and Premium users,
* and is used only by the v2 runtime API.
* <p>**Note:** The **search_skill** response type is used only by the v2 runtime API.
*/
public interface ResponseType {
/** text. */
Expand Down Expand Up @@ -406,8 +405,7 @@ public Builder newBuilder() {
* <p>The type of response returned by the dialog node. The specified response type must be
* supported by the client application or channel.
*
* <p>**Note:** The **search_skill** response type is available only for Plus and Premium users,
* and is used only by the v2 runtime API.
* <p>**Note:** The **search_skill** response type is used only by the v2 runtime API.
*
* @return the responseType
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2019, 2020.
* (C) Copyright IBM Corp. 2020.
*
* 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 @@ -24,9 +24,7 @@ public class DialogSuggestionResponseGeneric extends GenericModel {
* The type of response returned by the dialog node. The specified response type must be supported
* by the client application or channel.
*
* <p>**Note:** The **suggestion** response type is part of the disambiguation feature, which is
* only available for Plus and Premium users. The **search_skill** response type is available only
* for Plus and Premium users, and is used only by the v2 runtime API.
* <p>**Note:** The **search_skill** response type is is used only by the v2 runtime API.
*/
public interface ResponseType {
/** text. */
Expand Down Expand Up @@ -302,9 +300,7 @@ public Builder newBuilder() {
* <p>The type of response returned by the dialog node. The specified response type must be
* supported by the client application or channel.
*
* <p>**Note:** The **suggestion** response type is part of the disambiguation feature, which is
* only available for Plus and Premium users. The **search_skill** response type is available only
* for Plus and Premium users, and is used only by the v2 runtime API.
* <p>**Note:** The **search_skill** response type is is used only by the v2 runtime API.
*
* @return the responseType
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2019, 2020.
* (C) Copyright IBM Corp. 2020.
*
* 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 @@ -23,9 +23,6 @@ public class RuntimeResponseGeneric extends GenericModel {
/**
* The type of response returned by the dialog node. The specified response type must be supported
* by the client application or channel.
*
* <p>**Note:** The **suggestion** response type is part of the disambiguation feature, which is
* only available for Plus and Premium users.
*/
public interface ResponseType {
/** text. */
Expand Down Expand Up @@ -332,9 +329,6 @@ public Builder newBuilder() {
* <p>The type of response returned by the dialog node. The specified response type must be
* supported by the client application or channel.
*
* <p>**Note:** The **suggestion** response type is part of the disambiguation feature, which is
* only available for Plus and Premium users.
*
* @return the responseType
*/
public String responseType() {
Expand Down Expand Up @@ -470,9 +464,6 @@ public String dialogNode() {
* <p>An array of objects describing the possible matching dialog nodes from which the user can
* choose.
*
* <p>**Note:** The **suggestions** property is part of the disambiguation feature, which is only
* available for Plus and Premium users.
*
* @return the suggestions
*/
public List<DialogSuggestion> suggestions() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2018, 2020.
* (C) Copyright IBM Corp. 2020.
*
* 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 @@ -182,8 +182,6 @@ public WorkspaceSystemSettingsTooling tooling() {
*
* <p>Workspace settings related to the disambiguation feature.
*
* <p>**Note:** This feature is available only to Plus and Premium users.
*
* @return the disambiguation
*/
public WorkspaceSystemSettingsDisambiguation disambiguation() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2018, 2020.
* (C) Copyright IBM Corp. 2020.
*
* 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,11 +15,7 @@
import com.google.gson.annotations.SerializedName;
import com.ibm.cloud.sdk.core.service.model.GenericModel;

/**
* Workspace settings related to the disambiguation feature.
*
* <p>**Note:** This feature is available only to Plus and Premium users.
*/
/** Workspace settings related to the disambiguation feature. */
public class WorkspaceSystemSettingsDisambiguation extends GenericModel {

/**
Expand Down
91 changes: 84 additions & 7 deletions assistant/src/main/java/com/ibm/watson/assistant/v2/Assistant.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2019, 2020.
* (C) Copyright IBM Corp. 2020.
*
* 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 @@ -22,6 +22,9 @@
import com.ibm.cloud.sdk.core.util.ResponseConverterUtils;
import com.ibm.watson.assistant.v2.model.CreateSessionOptions;
import com.ibm.watson.assistant.v2.model.DeleteSessionOptions;
import com.ibm.watson.assistant.v2.model.DeleteUserDataOptions;
import com.ibm.watson.assistant.v2.model.ListLogsOptions;
import com.ibm.watson.assistant.v2.model.LogCollection;
import com.ibm.watson.assistant.v2.model.MessageOptions;
import com.ibm.watson.assistant.v2.model.MessageResponse;
import com.ibm.watson.assistant.v2.model.MessageResponseStateless;
Expand All @@ -44,10 +47,10 @@
*/
public class Assistant extends BaseService {

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

private static final String DEFAULT_SERVICE_URL =
"https://gateway.watsonplatform.net/assistant/api";
"https://api.us-south.assistant.watson.cloud.ibm.com";

private String versionDate;

Expand Down Expand Up @@ -175,8 +178,6 @@ public ServiceCall<Void> deleteSession(DeleteSessionOptions deleteSessionOptions
* <p>Send user input to an assistant and receive a response, with conversation state (including
* context data) stored by Watson Assistant for the duration of the session.
*
* <p>There is no rate limit for this operation.
*
* @param messageOptions the {@link MessageOptions} containing the options for the call
* @return a {@link ServiceCall} with a response type of {@link MessageResponse}
*/
Expand Down Expand Up @@ -217,8 +218,6 @@ public ServiceCall<MessageResponse> message(MessageOptions messageOptions) {
* <p>Send user input to an assistant and receive a response, with conversation state (including
* context data) managed by your application.
*
* <p>There is no rate limit for this operation.
*
* @param messageStatelessOptions the {@link MessageStatelessOptions} containing the options for
* the call
* @return a {@link ServiceCall} with a response type of {@link MessageResponseStateless}
Expand Down Expand Up @@ -258,4 +257,82 @@ public ServiceCall<MessageResponseStateless> messageStateless(
new com.google.gson.reflect.TypeToken<MessageResponseStateless>() {}.getType());
return createServiceCall(builder.build(), responseConverter);
}

/**
* List log events for an assistant.
*
* <p>List the events from the log of an assistant.
*
* <p>This method is available only with Premium plans.
*
* @param listLogsOptions the {@link ListLogsOptions} containing the options for the call
* @return a {@link ServiceCall} with a response type of {@link LogCollection}
*/
public ServiceCall<LogCollection> listLogs(ListLogsOptions listLogsOptions) {
com.ibm.cloud.sdk.core.util.Validator.notNull(
listLogsOptions, "listLogsOptions cannot be null");
String[] pathSegments = {"v2/assistants", "logs"};
String[] pathParameters = {listLogsOptions.assistantId()};
RequestBuilder builder =
RequestBuilder.get(
RequestBuilder.constructHttpUrl(getServiceUrl(), pathSegments, pathParameters));
builder.query("version", versionDate);
Map<String, String> sdkHeaders = SdkCommon.getSdkHeaders("conversation", "v2", "listLogs");
for (Entry<String, String> header : sdkHeaders.entrySet()) {
builder.header(header.getKey(), header.getValue());
}
builder.header("Accept", "application/json");
if (listLogsOptions.sort() != null) {
builder.query("sort", listLogsOptions.sort());
}
if (listLogsOptions.filter() != null) {
builder.query("filter", listLogsOptions.filter());
}
if (listLogsOptions.pageLimit() != null) {
builder.query("page_limit", String.valueOf(listLogsOptions.pageLimit()));
}
if (listLogsOptions.cursor() != null) {
builder.query("cursor", listLogsOptions.cursor());
}
ResponseConverter<LogCollection> responseConverter =
ResponseConverterUtils.getValue(
new com.google.gson.reflect.TypeToken<LogCollection>() {}.getType());
return createServiceCall(builder.build(), responseConverter);
}

/**
* Delete labeled data.
*
* <p>Deletes all data associated with a specified customer ID. The method has no effect if no
* data is associated with the customer ID.
*
* <p>You associate a customer ID with data by passing the `X-Watson-Metadata` header with a
* request that passes data. For more information about personal data and customer IDs, see
* [Information
* security](https://cloud.ibm.com/docs/assistant?topic=assistant-information-security#information-security).
*
* <p>This operation is limited to 4 requests per minute. For more information, see **Rate
* limiting**.
*
* @param deleteUserDataOptions the {@link DeleteUserDataOptions} containing the options for the
* call
* @return a {@link ServiceCall} with a response type of Void
*/
public ServiceCall<Void> deleteUserData(DeleteUserDataOptions deleteUserDataOptions) {
com.ibm.cloud.sdk.core.util.Validator.notNull(
deleteUserDataOptions, "deleteUserDataOptions cannot be null");
String[] pathSegments = {"v2/user_data"};
RequestBuilder builder =
RequestBuilder.delete(RequestBuilder.constructHttpUrl(getServiceUrl(), pathSegments));
builder.query("version", versionDate);
Map<String, String> sdkHeaders =
SdkCommon.getSdkHeaders("conversation", "v2", "deleteUserData");
for (Entry<String, String> header : sdkHeaders.entrySet()) {
builder.header(header.getKey(), header.getValue());
}
builder.header("Accept", "application/json");
builder.query("customer_id", deleteUserDataOptions.customerId());
ResponseConverter<Void> responseConverter = ResponseConverterUtils.getVoid();
return createServiceCall(builder.build(), responseConverter);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
/*
* (C) Copyright IBM Corp. 2020.
*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package com.ibm.watson.assistant.v2.model;

import com.ibm.cloud.sdk.core.service.model.GenericModel;

/** The deleteUserData options. */
public class DeleteUserDataOptions extends GenericModel {

protected String customerId;

/** Builder. */
public static class Builder {
private String customerId;

private Builder(DeleteUserDataOptions deleteUserDataOptions) {
this.customerId = deleteUserDataOptions.customerId;
}

/** Instantiates a new builder. */
public Builder() {}

/**
* Instantiates a new builder with required properties.
*
* @param customerId the customerId
*/
public Builder(String customerId) {
this.customerId = customerId;
}

/**
* Builds a DeleteUserDataOptions.
*
* @return the deleteUserDataOptions
*/
public DeleteUserDataOptions build() {
return new DeleteUserDataOptions(this);
}

/**
* Set the customerId.
*
* @param customerId the customerId
* @return the DeleteUserDataOptions builder
*/
public Builder customerId(String customerId) {
this.customerId = customerId;
return this;
}
}

protected DeleteUserDataOptions(Builder builder) {
com.ibm.cloud.sdk.core.util.Validator.notNull(builder.customerId, "customerId cannot be null");
customerId = builder.customerId;
}

/**
* New builder.
*
* @return a DeleteUserDataOptions builder
*/
public Builder newBuilder() {
return new Builder(this);
}

/**
* Gets the customerId.
*
* <p>The customer ID for which all data is to be deleted.
*
* @return the customerId
*/
public String customerId() {
return customerId;
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2018, 2020.
* (C) Copyright IBM Corp. 2020.
*
* 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 @@ -25,8 +25,8 @@ public class DialogSuggestion extends GenericModel {
/**
* Gets the label.
*
* <p>The user-facing label for the disambiguation option. This label is taken from the **title**
* or **user_label** property of the corresponding dialog node, depending on the disambiguation
* <p>The user-facing label for the suggestion. This label is taken from the **title** or
* **user_label** property of the corresponding dialog node, depending on the disambiguation
* options.
*
* @return the label
Expand Down
Loading

0 comments on commit 1129e9b

Please sign in to comment.