Skip to content

Commit 5d26c82

Browse files
committed
feat: regenrate sdk according to current api defs
1 parent edc586d commit 5d26c82

File tree

5 files changed

+42
-18
lines changed

5 files changed

+42
-18
lines changed

lib/ibm_watson.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ module IBMWatson
1313
require_relative("./ibm_watson/assistant_v2.rb")
1414
require_relative("./ibm_watson/text_to_speech_v1.rb")
1515
require_relative("./ibm_watson/discovery_v1.rb")
16+
require_relative("./ibm_watson/discovery_v2.rb")
1617
require_relative("./ibm_watson/natural_language_understanding_v1.rb")
1718
require_relative("./ibm_watson/speech_to_text_v1.rb")
1819
require_relative("./ibm_watson/visual_recognition_v3.rb")

lib/ibm_watson/assistant_v1.rb

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ def list_workspaces(page_limit: nil, sort: nil, cursor: nil, include_audit: nil)
177177
end
178178

179179
##
180-
# @!method create_workspace(name: nil, description: nil, language: nil, metadata: nil, learning_opt_out: nil, system_settings: nil, intents: nil, entities: nil, dialog_nodes: nil, counterexamples: nil)
180+
# @!method create_workspace(name: nil, description: nil, language: nil, metadata: nil, learning_opt_out: nil, system_settings: nil, intents: nil, entities: nil, dialog_nodes: nil, counterexamples: nil, webhooks: nil)
181181
# Create workspace.
182182
# Create a workspace based on component objects. You must provide workspace
183183
# components defining the content of the new workspace.
@@ -199,8 +199,9 @@ def list_workspaces(page_limit: nil, sort: nil, cursor: nil, include_audit: nil)
199199
# @param dialog_nodes [Array[DialogNode]] An array of objects describing the dialog nodes in the workspace.
200200
# @param counterexamples [Array[Counterexample]] An array of objects defining input examples that have been marked as irrelevant
201201
# input.
202+
# @param webhooks [Array[Webhook]]
202203
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
203-
def create_workspace(name: nil, description: nil, language: nil, metadata: nil, learning_opt_out: nil, system_settings: nil, intents: nil, entities: nil, dialog_nodes: nil, counterexamples: nil)
204+
def create_workspace(name: nil, description: nil, language: nil, metadata: nil, learning_opt_out: nil, system_settings: nil, intents: nil, entities: nil, dialog_nodes: nil, counterexamples: nil, webhooks: nil)
204205
headers = {
205206
}
206207
sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "create_workspace")
@@ -220,7 +221,8 @@ def create_workspace(name: nil, description: nil, language: nil, metadata: nil,
220221
"intents" => intents,
221222
"entities" => entities,
222223
"dialog_nodes" => dialog_nodes,
223-
"counterexamples" => counterexamples
224+
"counterexamples" => counterexamples,
225+
"webhooks" => webhooks
224226
}
225227

226228
method_url = "/v1/workspaces"
@@ -282,7 +284,7 @@ def get_workspace(workspace_id:, export: nil, include_audit: nil, sort: nil)
282284
end
283285

284286
##
285-
# @!method update_workspace(workspace_id:, name: nil, description: nil, language: nil, metadata: nil, learning_opt_out: nil, system_settings: nil, intents: nil, entities: nil, dialog_nodes: nil, counterexamples: nil, append: nil)
287+
# @!method update_workspace(workspace_id:, name: nil, description: nil, language: nil, metadata: nil, learning_opt_out: nil, system_settings: nil, intents: nil, entities: nil, dialog_nodes: nil, counterexamples: nil, webhooks: nil, append: nil)
286288
# Update workspace.
287289
# Update an existing workspace with new or modified data. You must provide component
288290
# objects defining the content of the updated workspace.
@@ -305,6 +307,7 @@ def get_workspace(workspace_id:, export: nil, include_audit: nil, sort: nil)
305307
# @param dialog_nodes [Array[DialogNode]] An array of objects describing the dialog nodes in the workspace.
306308
# @param counterexamples [Array[Counterexample]] An array of objects defining input examples that have been marked as irrelevant
307309
# input.
310+
# @param webhooks [Array[Webhook]]
308311
# @param append [Boolean] Whether the new data is to be appended to the existing data in the workspace. If
309312
# **append**=`false`, elements included in the new data completely replace the
310313
# corresponding existing elements, including all subelements. For example, if the
@@ -315,7 +318,7 @@ def get_workspace(workspace_id:, export: nil, include_audit: nil, sort: nil)
315318
# added. If any elements in the new data collide with existing elements, the update
316319
# request fails.
317320
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
318-
def update_workspace(workspace_id:, name: nil, description: nil, language: nil, metadata: nil, learning_opt_out: nil, system_settings: nil, intents: nil, entities: nil, dialog_nodes: nil, counterexamples: nil, append: nil)
321+
def update_workspace(workspace_id:, name: nil, description: nil, language: nil, metadata: nil, learning_opt_out: nil, system_settings: nil, intents: nil, entities: nil, dialog_nodes: nil, counterexamples: nil, webhooks: nil, append: nil)
319322
raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
320323

321324
headers = {
@@ -338,7 +341,8 @@ def update_workspace(workspace_id:, name: nil, description: nil, language: nil,
338341
"intents" => intents,
339342
"entities" => entities,
340343
"dialog_nodes" => dialog_nodes,
341-
"counterexamples" => counterexamples
344+
"counterexamples" => counterexamples,
345+
"webhooks" => webhooks
342346
}
343347

344348
method_url = "/v1/workspaces/%s" % [ERB::Util.url_encode(workspace_id)]
@@ -1936,7 +1940,7 @@ def list_dialog_nodes(workspace_id:, page_limit: nil, sort: nil, cursor: nil, in
19361940
end
19371941

19381942
##
1939-
# @!method create_dialog_node(workspace_id:, dialog_node:, description: nil, conditions: nil, parent: nil, previous_sibling: nil, output: nil, context: nil, metadata: nil, next_step: nil, title: nil, type: nil, event_name: nil, variable: nil, actions: nil, digress_in: nil, digress_out: nil, digress_out_slots: nil, user_label: nil)
1943+
# @!method create_dialog_node(workspace_id:, dialog_node:, description: nil, conditions: nil, parent: nil, previous_sibling: nil, output: nil, context: nil, metadata: nil, next_step: nil, title: nil, type: nil, event_name: nil, variable: nil, actions: nil, digress_in: nil, digress_out: nil, digress_out_slots: nil, user_label: nil, disambiguation_opt_out: nil)
19401944
# Create dialog node.
19411945
# Create a new dialog node.
19421946
#
@@ -1976,8 +1980,9 @@ def list_dialog_nodes(workspace_id:, page_limit: nil, sort: nil, cursor: nil, in
19761980
# @param digress_out_slots [String] Whether the user can digress to top-level nodes while filling out slots.
19771981
# @param user_label [String] A label that can be displayed externally to describe the purpose of the node to
19781982
# users.
1983+
# @param disambiguation_opt_out [Boolean] Whether the dialog node should be excluded from disambiguation suggestions.
19791984
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
1980-
def create_dialog_node(workspace_id:, dialog_node:, description: nil, conditions: nil, parent: nil, previous_sibling: nil, output: nil, context: nil, metadata: nil, next_step: nil, title: nil, type: nil, event_name: nil, variable: nil, actions: nil, digress_in: nil, digress_out: nil, digress_out_slots: nil, user_label: nil)
1985+
def create_dialog_node(workspace_id:, dialog_node:, description: nil, conditions: nil, parent: nil, previous_sibling: nil, output: nil, context: nil, metadata: nil, next_step: nil, title: nil, type: nil, event_name: nil, variable: nil, actions: nil, digress_in: nil, digress_out: nil, digress_out_slots: nil, user_label: nil, disambiguation_opt_out: nil)
19811986
raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
19821987

19831988
raise ArgumentError.new("dialog_node must be provided") if dialog_node.nil?
@@ -2009,7 +2014,8 @@ def create_dialog_node(workspace_id:, dialog_node:, description: nil, conditions
20092014
"digress_in" => digress_in,
20102015
"digress_out" => digress_out,
20112016
"digress_out_slots" => digress_out_slots,
2012-
"user_label" => user_label
2017+
"user_label" => user_label,
2018+
"disambiguation_opt_out" => disambiguation_opt_out
20132019
}
20142020

20152021
method_url = "/v1/workspaces/%s/dialog_nodes" % [ERB::Util.url_encode(workspace_id)]
@@ -2065,7 +2071,7 @@ def get_dialog_node(workspace_id:, dialog_node:, include_audit: nil)
20652071
end
20662072

20672073
##
2068-
# @!method update_dialog_node(workspace_id:, dialog_node:, new_dialog_node: nil, new_description: nil, new_conditions: nil, new_parent: nil, new_previous_sibling: nil, new_output: nil, new_context: nil, new_metadata: nil, new_next_step: nil, new_title: nil, new_type: nil, new_event_name: nil, new_variable: nil, new_actions: nil, new_digress_in: nil, new_digress_out: nil, new_digress_out_slots: nil, new_user_label: nil)
2074+
# @!method update_dialog_node(workspace_id:, dialog_node:, new_dialog_node: nil, new_description: nil, new_conditions: nil, new_parent: nil, new_previous_sibling: nil, new_output: nil, new_context: nil, new_metadata: nil, new_next_step: nil, new_title: nil, new_type: nil, new_event_name: nil, new_variable: nil, new_actions: nil, new_digress_in: nil, new_digress_out: nil, new_digress_out_slots: nil, new_user_label: nil, new_disambiguation_opt_out: nil)
20692075
# Update dialog node.
20702076
# Update an existing dialog node with new or modified data.
20712077
#
@@ -2106,8 +2112,9 @@ def get_dialog_node(workspace_id:, dialog_node:, include_audit: nil)
21062112
# @param new_digress_out_slots [String] Whether the user can digress to top-level nodes while filling out slots.
21072113
# @param new_user_label [String] A label that can be displayed externally to describe the purpose of the node to
21082114
# users.
2115+
# @param new_disambiguation_opt_out [Boolean] Whether the dialog node should be excluded from disambiguation suggestions.
21092116
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
2110-
def update_dialog_node(workspace_id:, dialog_node:, new_dialog_node: nil, new_description: nil, new_conditions: nil, new_parent: nil, new_previous_sibling: nil, new_output: nil, new_context: nil, new_metadata: nil, new_next_step: nil, new_title: nil, new_type: nil, new_event_name: nil, new_variable: nil, new_actions: nil, new_digress_in: nil, new_digress_out: nil, new_digress_out_slots: nil, new_user_label: nil)
2117+
def update_dialog_node(workspace_id:, dialog_node:, new_dialog_node: nil, new_description: nil, new_conditions: nil, new_parent: nil, new_previous_sibling: nil, new_output: nil, new_context: nil, new_metadata: nil, new_next_step: nil, new_title: nil, new_type: nil, new_event_name: nil, new_variable: nil, new_actions: nil, new_digress_in: nil, new_digress_out: nil, new_digress_out_slots: nil, new_user_label: nil, new_disambiguation_opt_out: nil)
21112118
raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
21122119

21132120
raise ArgumentError.new("dialog_node must be provided") if dialog_node.nil?
@@ -2139,7 +2146,8 @@ def update_dialog_node(workspace_id:, dialog_node:, new_dialog_node: nil, new_de
21392146
"digress_in" => new_digress_in,
21402147
"digress_out" => new_digress_out,
21412148
"digress_out_slots" => new_digress_out_slots,
2142-
"user_label" => new_user_label
2149+
"user_label" => new_user_label,
2150+
"disambiguation_opt_out" => new_disambiguation_opt_out
21432151
}
21442152

21452153
method_url = "/v1/workspaces/%s/dialog_nodes/%s" % [ERB::Util.url_encode(workspace_id), ERB::Util.url_encode(dialog_node)]
@@ -2249,8 +2257,8 @@ def list_logs(workspace_id:, sort: nil, filter: nil, page_limit: nil, cursor: ni
22492257
# more information, see **Rate limiting**.
22502258
# @param filter [String] A cacheable parameter that limits the results to those matching the specified
22512259
# filter. You must specify a filter query that includes a value for `language`, as
2252-
# well as a value for `workspace_id` or `request.context.metadata.deployment`. For
2253-
# more information, see the
2260+
# well as a value for `request.context.system.assistant_id`, `workspace_id`, or
2261+
# `request.context.metadata.deployment`. For more information, see the
22542262
# [documentation](https://cloud.ibm.com/docs/services/assistant?topic=assistant-filter-reference#filter-reference).
22552263
# @param sort [String] How to sort the returned log events. You can sort by **request_timestamp**. To
22562264
# reverse the sort order, prefix the parameter value with a minus sign (`-`).

lib/ibm_watson/assistant_v2.rb

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,10 @@ def initialize(args = {})
7474
# @!method create_session(assistant_id:)
7575
# Create a session.
7676
# Create a new session. A session is used to send user input to a skill and receive
77-
# responses. It also maintains the state of the conversation.
77+
# responses. It also maintains the state of the conversation. A session persists
78+
# until it is deleted, or until it times out because of inactivity. (For more
79+
# information, see the
80+
# [documentation](https://cloud.ibm.com/docs/services/assistant?topic=assistant-assistant-settings).
7881
# @param assistant_id [String] Unique identifier of the assistant. To find the assistant ID in the Watson
7982
# Assistant user interface, open the assistant settings and click **API Details**.
8083
# For information about creating assistants, see the
@@ -109,7 +112,9 @@ def create_session(assistant_id:)
109112
##
110113
# @!method delete_session(assistant_id:, session_id:)
111114
# Delete session.
112-
# Deletes a session explicitly before it times out.
115+
# Deletes a session explicitly before it times out. (For more information about the
116+
# session inactivity timeout, see the
117+
# [documentation](https://cloud.ibm.com/docs/services/assistant?topic=assistant-assistant-settings)).
113118
# @param assistant_id [String] Unique identifier of the assistant. To find the assistant ID in the Watson
114119
# Assistant user interface, open the assistant settings and click **API Details**.
115120
# For information about creating assistants, see the

lib/ibm_watson/discovery_v1.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1112,7 +1112,7 @@ def delete_stopword_list(environment_id:, collection_id:)
11121112
# @param collection_id [String] The ID of the collection.
11131113
# @param file [File] The content of the document to ingest. The maximum supported file size when adding
11141114
# a file to a collection is 50 megabytes, the maximum supported file size when
1115-
# testing a confiruration is 1 megabyte. Files larger than the supported size are
1115+
# testing a configuration is 1 megabyte. Files larger than the supported size are
11161116
# rejected.
11171117
# @param filename [String] The filename for file.
11181118
# @param file_content_type [String] The content type of file.
@@ -1213,7 +1213,7 @@ def get_document_status(environment_id:, collection_id:, document_id:)
12131213
# @param document_id [String] The ID of the document.
12141214
# @param file [File] The content of the document to ingest. The maximum supported file size when adding
12151215
# a file to a collection is 50 megabytes, the maximum supported file size when
1216-
# testing a confiruration is 1 megabyte. Files larger than the supported size are
1216+
# testing a configuration is 1 megabyte. Files larger than the supported size are
12171217
# rejected.
12181218
# @param filename [String] The filename for file.
12191219
# @param file_content_type [String] The content type of file.

lib/ibm_watson/speech_to_text_v1.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1104,6 +1104,11 @@ def delete_job(id:)
11041104
# model is owned by the instance of the service whose credentials are used to create
11051105
# it.
11061106
#
1107+
# You can create a maximum of 1024 custom language models, per credential. The
1108+
# service returns an error if you attempt to create more than 1024 models. You do
1109+
# not lose any models, but you cannot create any more until your model count is
1110+
# below the limit.
1111+
#
11071112
# **See also:** [Create a custom language
11081113
# model](https://cloud.ibm.com/docs/services/speech-to-text?topic=speech-to-text-languageCreate#createModel-language).
11091114
# @param name [String] A user-defined name for the new custom language model. Use a name that is unique
@@ -2225,6 +2230,11 @@ def delete_grammar(customization_id:, grammar_name:)
22252230
# model is owned by the instance of the service whose credentials are used to create
22262231
# it.
22272232
#
2233+
# You can create a maximum of 1024 custom acoustic models, per credential. The
2234+
# service returns an error if you attempt to create more than 1024 models. You do
2235+
# not lose any models, but you cannot create any more until your model count is
2236+
# below the limit.
2237+
#
22282238
# **See also:** [Create a custom acoustic
22292239
# model](https://cloud.ibm.com/docs/services/speech-to-text?topic=speech-to-text-acoustic#createModel-acoustic).
22302240
# @param name [String] A user-defined name for the new custom acoustic model. Use a name that is unique

0 commit comments

Comments
 (0)