Skip to content

Commit 13b89d0

Browse files
authored
Merge pull request #101 from watson-developer-cloud/release-5-2020
feat: Release 5 2020
2 parents 8cb1794 + e5e9041 commit 13b89d0

32 files changed

Lines changed: 1931 additions & 829 deletions

lib/ibm_watson/assistant_v1.rb

Lines changed: 1 addition & 145 deletions
Large diffs are not rendered by default.

lib/ibm_watson/assistant_v2.rb

Lines changed: 95 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ module IBMWatson
3434
class AssistantV2 < IBMCloudSdkCore::BaseService
3535
include Concurrent::Async
3636
DEFAULT_SERVICE_NAME = "assistant"
37-
DEFAULT_SERVICE_URL = "https://gateway.watsonplatform.net/assistant/api"
37+
DEFAULT_SERVICE_URL = "https://api.us-south.assistant.watson.cloud.ibm.com"
3838
##
3939
# @!method initialize(args)
4040
# Construct a new client for the Assistant service.
@@ -164,8 +164,6 @@ def delete_session(assistant_id:, session_id:)
164164
# Send user input to an assistant and receive a response, with conversation state
165165
# (including context data) stored by Watson Assistant for the duration of the
166166
# session.
167-
#
168-
# There is no rate limit for this operation.
169167
# @param assistant_id [String] Unique identifier of the assistant. To find the assistant ID in the Watson
170168
# Assistant user interface, open the assistant settings and click **API Details**.
171169
# For information about creating assistants, see the
@@ -218,8 +216,6 @@ def message(assistant_id:, session_id:, input: nil, context: nil)
218216
# Send user input to assistant (stateless).
219217
# Send user input to an assistant and receive a response, with conversation state
220218
# (including context data) managed by your application.
221-
#
222-
# There is no rate limit for this operation.
223219
# @param assistant_id [String] Unique identifier of the assistant. To find the assistant ID in the Watson
224220
# Assistant user interface, open the assistant settings and click **API Details**.
225221
# For information about creating assistants, see the
@@ -264,5 +260,99 @@ def message_stateless(assistant_id:, input: nil, context: nil)
264260
)
265261
response
266262
end
263+
#########################
264+
# Logs
265+
#########################
266+
267+
##
268+
# @!method list_logs(assistant_id:, sort: nil, filter: nil, page_limit: nil, cursor: nil)
269+
# List log events for an assistant.
270+
# List the events from the log of an assistant.
271+
#
272+
# This method is available only with Premium plans.
273+
# @param assistant_id [String] Unique identifier of the assistant. To find the assistant ID in the Watson
274+
# Assistant user interface, open the assistant settings and click **API Details**.
275+
# For information about creating assistants, see the
276+
# [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-assistant-add#assistant-add-task).
277+
#
278+
# **Note:** Currently, the v2 API does not support creating assistants.
279+
# @param sort [String] How to sort the returned log events. You can sort by **request_timestamp**. To
280+
# reverse the sort order, prefix the parameter value with a minus sign (`-`).
281+
# @param filter [String] A cacheable parameter that limits the results to those matching the specified
282+
# filter. For more information, see the
283+
# [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-filter-reference#filter-reference).
284+
# @param page_limit [Fixnum] The number of records to return in each page of results.
285+
# @param cursor [String] A token identifying the page of results to retrieve.
286+
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
287+
def list_logs(assistant_id:, sort: nil, filter: nil, page_limit: nil, cursor: nil)
288+
raise ArgumentError.new("assistant_id must be provided") if assistant_id.nil?
289+
290+
headers = {
291+
}
292+
sdk_headers = Common.new.get_sdk_headers("conversation", "V2", "list_logs")
293+
headers.merge!(sdk_headers)
294+
295+
params = {
296+
"version" => @version,
297+
"sort" => sort,
298+
"filter" => filter,
299+
"page_limit" => page_limit,
300+
"cursor" => cursor
301+
}
302+
303+
method_url = "/v2/assistants/%s/logs" % [ERB::Util.url_encode(assistant_id)]
304+
305+
response = request(
306+
method: "GET",
307+
url: method_url,
308+
headers: headers,
309+
params: params,
310+
accept_json: true
311+
)
312+
response
313+
end
314+
#########################
315+
# User data
316+
#########################
317+
318+
##
319+
# @!method delete_user_data(customer_id:)
320+
# Delete labeled data.
321+
# Deletes all data associated with a specified customer ID. The method has no effect
322+
# if no data is associated with the customer ID.
323+
#
324+
# You associate a customer ID with data by passing the `X-Watson-Metadata` header
325+
# with a request that passes data. For more information about personal data and
326+
# customer IDs, see [Information
327+
# security](https://cloud.ibm.com/docs/assistant?topic=assistant-information-security#information-security).
328+
#
329+
# This operation is limited to 4 requests per minute. For more information, see
330+
# **Rate limiting**.
331+
# @param customer_id [String] The customer ID for which all data is to be deleted.
332+
# @return [nil]
333+
def delete_user_data(customer_id:)
334+
raise ArgumentError.new("customer_id must be provided") if customer_id.nil?
335+
336+
headers = {
337+
}
338+
sdk_headers = Common.new.get_sdk_headers("conversation", "V2", "delete_user_data")
339+
headers.merge!(sdk_headers)
340+
341+
params = {
342+
"version" => @version,
343+
"customer_id" => customer_id
344+
}
345+
346+
method_url = "/v2/user_data"
347+
348+
request(
349+
method: "DELETE",
350+
url: method_url,
351+
headers: headers,
352+
params: params,
353+
accept_json: true
354+
)
355+
nil
356+
end
267357
end
268358
end

lib/ibm_watson/compare_comply_v1.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ module IBMWatson
3030
class CompareComplyV1 < IBMCloudSdkCore::BaseService
3131
include Concurrent::Async
3232
DEFAULT_SERVICE_NAME = "compare_comply"
33-
DEFAULT_SERVICE_URL = "https://gateway.watsonplatform.net/compare-comply/api"
33+
DEFAULT_SERVICE_URL = "https://api.us-south.compare-comply.watson.cloud.ibm.com"
3434
##
3535
# @!method initialize(args)
3636
# Construct a new client for the Compare Comply service.

lib/ibm_watson/discovery_v1.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ module IBMWatson
3333
class DiscoveryV1 < IBMCloudSdkCore::BaseService
3434
include Concurrent::Async
3535
DEFAULT_SERVICE_NAME = "discovery"
36-
DEFAULT_SERVICE_URL = "https://gateway.watsonplatform.net/discovery/api"
36+
DEFAULT_SERVICE_URL = "https://api.us-south.discovery.watson.cloud.ibm.com"
3737
##
3838
# @!method initialize(args)
3939
# Construct a new client for the Discovery service.

0 commit comments

Comments
 (0)