Skip to content

Commit f1fe9a7

Browse files
authored
Merge pull request #96 from watson-developer-cloud/release-3-2020
Release 3 2020
2 parents 5bcf92a + 03c8bac commit f1fe9a7

16 files changed

Lines changed: 347 additions & 146 deletions

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ IBM Cloud is migrating to token-based Identity and Access Management (IAM) authe
129129
You supply either an IAM service **API key** or an **access token**:
130130

131131
* Use the API key to have the SDK manage the lifecycle of the access token. The SDK requests an access token, ensures that the access token is valid, and refreshes it if necessary.
132-
* Use the access token if you want to manage the lifecycle yourself. For details, see [Authenticating with IAM tokens](https://cloud.ibm.com/docs/services/watson?topic=watson-iam).
132+
* Use the access token if you want to manage the lifecycle yourself. For details, see [Authenticating with IAM tokens](https://cloud.ibm.com/docs/watson?topic=watson-iam).
133133

134134
#### Supplying the IAM API key
135135

@@ -423,6 +423,6 @@ We'd love to highlight cool open-source projects that use this SDK! If you'd lik
423423
[examples]: https://github.com/watson-developer-cloud/ruby-sdk/tree/master/examples
424424
[CONTRIBUTING]: https://github.com/watson-developer-cloud/ruby-sdk/blob/master/CONTRIBUTING.md
425425
[license]: http://www.apache.org/licenses/LICENSE-2.0
426-
[vcap_services]: https://cloud.ibm.com/docs/services/watson?topic=watson-vcapServices
426+
[vcap_services]: https://cloud.ibm.com/docs/watson?topic=watson-vcapServices
427427
[ibm-cloud-onboarding]: http://cloud.ibm.com/registration?target=/developer/watson&cm_sp=WatsonPlatform-WatsonServices-_-OnPageNavLink-IBMWatson_SDKs-_-Ruby
428428
[ivar]: http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/IVar.html

lib/ibm_watson/assistant_v1.rb

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ module IBMWatson
3333
# The Assistant V1 service.
3434
class AssistantV1 < IBMCloudSdkCore::BaseService
3535
include Concurrent::Async
36+
DEFAULT_SERVICE_NAME = "assistant"
37+
DEFAULT_SERVICE_URL = "https://gateway.watsonplatform.net/assistant/api"
3638
##
3739
# @!method initialize(args)
3840
# Construct a new client for the Assistant service.
@@ -51,19 +53,23 @@ class AssistantV1 < IBMCloudSdkCore::BaseService
5153
# @option args service_url [String] The base service URL to use when contacting the service.
5254
# The base service_url may differ between IBM Cloud regions.
5355
# @option args authenticator [Object] The Authenticator instance to be configured for this service.
56+
# @option args service_name [String] The name of the service to configure. Will be used as the key to load
57+
# any external configuration, if applicable.
5458
def initialize(args = {})
5559
@__async_initialized__ = false
5660
defaults = {}
5761
defaults[:version] = nil
58-
defaults[:service_url] = "https://gateway.watsonplatform.net/assistant/api"
62+
defaults[:service_url] = DEFAULT_SERVICE_URL
63+
defaults[:service_name] = DEFAULT_SERVICE_NAME
5964
defaults[:authenticator] = nil
65+
user_service_url = args[:service_url] unless args[:service_url].nil?
6066
args = defaults.merge(args)
6167
@version = args[:version]
6268
raise ArgumentError.new("version must be provided") if @version.nil?
6369

64-
args[:service_name] = "assistant"
6570
args[:authenticator] = IBMCloudSdkCore::ConfigBasedAuthenticatorFactory.new.get_authenticator(service_name: args[:service_name]) if args[:authenticator].nil?
6671
super
72+
@service_url = user_service_url unless user_service_url.nil?
6773
end
6874

6975
#########################
@@ -706,7 +712,7 @@ def list_examples(workspace_id:, intent:, page_limit: nil, sort: nil, cursor: ni
706712
# Create user input example.
707713
# Add a new user input example to an intent.
708714
#
709-
# If you want to add multiple exaples with a single API call, consider using the
715+
# If you want to add multiple examples with a single API call, consider using the
710716
# **[Update intent](#update-intent)** method instead.
711717
#
712718
# This operation is limited to 1000 requests per 30 minutes. For more information,
@@ -2054,7 +2060,8 @@ def list_dialog_nodes(workspace_id:, page_limit: nil, sort: nil, cursor: nil, in
20542060
# @param digress_out_slots [String] Whether the user can digress to top-level nodes while filling out slots.
20552061
# @param user_label [String] A label that can be displayed externally to describe the purpose of the node to
20562062
# users.
2057-
# @param disambiguation_opt_out [Boolean] Whether the dialog node should be excluded from disambiguation suggestions.
2063+
# @param disambiguation_opt_out [Boolean] Whether the dialog node should be excluded from disambiguation suggestions. Valid
2064+
# only when **type**=`standard` or `frame`.
20582065
# @param include_audit [Boolean] Whether to include the audit properties (`created` and `updated` timestamps) in
20592066
# the response.
20602067
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
@@ -2189,7 +2196,8 @@ def get_dialog_node(workspace_id:, dialog_node:, include_audit: nil)
21892196
# @param new_digress_out_slots [String] Whether the user can digress to top-level nodes while filling out slots.
21902197
# @param new_user_label [String] A label that can be displayed externally to describe the purpose of the node to
21912198
# users.
2192-
# @param new_disambiguation_opt_out [Boolean] Whether the dialog node should be excluded from disambiguation suggestions.
2199+
# @param new_disambiguation_opt_out [Boolean] Whether the dialog node should be excluded from disambiguation suggestions. Valid
2200+
# only when **type**=`standard` or `frame`.
21932201
# @param include_audit [Boolean] Whether to include the audit properties (`created` and `updated` timestamps) in
21942202
# the response.
21952203
# @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.

lib/ibm_watson/assistant_v2.rb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ module IBMWatson
3333
# The Assistant V2 service.
3434
class AssistantV2 < IBMCloudSdkCore::BaseService
3535
include Concurrent::Async
36+
DEFAULT_SERVICE_NAME = "assistant"
37+
DEFAULT_SERVICE_URL = "https://gateway.watsonplatform.net/assistant/api"
3638
##
3739
# @!method initialize(args)
3840
# Construct a new client for the Assistant service.
@@ -51,19 +53,23 @@ class AssistantV2 < IBMCloudSdkCore::BaseService
5153
# @option args service_url [String] The base service URL to use when contacting the service.
5254
# The base service_url may differ between IBM Cloud regions.
5355
# @option args authenticator [Object] The Authenticator instance to be configured for this service.
56+
# @option args service_name [String] The name of the service to configure. Will be used as the key to load
57+
# any external configuration, if applicable.
5458
def initialize(args = {})
5559
@__async_initialized__ = false
5660
defaults = {}
5761
defaults[:version] = nil
58-
defaults[:service_url] = "https://gateway.watsonplatform.net/assistant/api"
62+
defaults[:service_url] = DEFAULT_SERVICE_URL
63+
defaults[:service_name] = DEFAULT_SERVICE_NAME
5964
defaults[:authenticator] = nil
65+
user_service_url = args[:service_url] unless args[:service_url].nil?
6066
args = defaults.merge(args)
6167
@version = args[:version]
6268
raise ArgumentError.new("version must be provided") if @version.nil?
6369

64-
args[:service_name] = "assistant"
6570
args[:authenticator] = IBMCloudSdkCore::ConfigBasedAuthenticatorFactory.new.get_authenticator(service_name: args[:service_name]) if args[:authenticator].nil?
6671
super
72+
@service_url = user_service_url unless user_service_url.nil?
6773
end
6874

6975
#########################

lib/ibm_watson/compare_comply_v1.rb

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ module IBMWatson
2929
# The Compare Comply V1 service.
3030
class CompareComplyV1 < IBMCloudSdkCore::BaseService
3131
include Concurrent::Async
32+
DEFAULT_SERVICE_NAME = "compare_comply"
33+
DEFAULT_SERVICE_URL = "https://gateway.watsonplatform.net/compare-comply/api"
3234
##
3335
# @!method initialize(args)
3436
# Construct a new client for the Compare Comply service.
@@ -47,19 +49,23 @@ class CompareComplyV1 < IBMCloudSdkCore::BaseService
4749
# @option args service_url [String] The base service URL to use when contacting the service.
4850
# The base service_url may differ between IBM Cloud regions.
4951
# @option args authenticator [Object] The Authenticator instance to be configured for this service.
52+
# @option args service_name [String] The name of the service to configure. Will be used as the key to load
53+
# any external configuration, if applicable.
5054
def initialize(args = {})
5155
@__async_initialized__ = false
5256
defaults = {}
5357
defaults[:version] = nil
54-
defaults[:service_url] = "https://gateway.watsonplatform.net/compare-comply/api"
58+
defaults[:service_url] = DEFAULT_SERVICE_URL
59+
defaults[:service_name] = DEFAULT_SERVICE_NAME
5560
defaults[:authenticator] = nil
61+
user_service_url = args[:service_url] unless args[:service_url].nil?
5662
args = defaults.merge(args)
5763
@version = args[:version]
5864
raise ArgumentError.new("version must be provided") if @version.nil?
5965

60-
args[:service_name] = "compare_comply"
6166
args[:authenticator] = IBMCloudSdkCore::ConfigBasedAuthenticatorFactory.new.get_authenticator(service_name: args[:service_name]) if args[:authenticator].nil?
6267
super
68+
@service_url = user_service_url unless user_service_url.nil?
6369
end
6470

6571
#########################
@@ -473,10 +479,10 @@ def delete_feedback(feedback_id:, model: nil)
473479
# Run Compare and Comply methods over a collection of input documents.
474480
#
475481
# **Important:** Batch processing requires the use of the [IBM Cloud Object Storage
476-
# service](https://cloud.ibm.com/docs/services/cloud-object-storage?topic=cloud-object-storage-about#about-ibm-cloud-object-storage).
482+
# service](https://cloud.ibm.com/docs/cloud-object-storage?topic=cloud-object-storage-about#about-ibm-cloud-object-storage).
477483
# The use of IBM Cloud Object Storage with Compare and Comply is discussed at [Using
478484
# batch
479-
# processing](https://cloud.ibm.com/docs/services/compare-comply?topic=compare-comply-batching#before-you-batch).
485+
# processing](https://cloud.ibm.com/docs/compare-comply?topic=compare-comply-batching#before-you-batch).
480486
# @param function [String] The Compare and Comply method to run across the submitted input documents.
481487
# @param input_credentials_file [File] A JSON file containing the input Cloud Object Storage credentials. At a minimum,
482488
# the credentials must enable `READ` permissions on the bucket defined by the

lib/ibm_watson/discovery_v1.rb

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ module IBMWatson
3232
# The Discovery V1 service.
3333
class DiscoveryV1 < IBMCloudSdkCore::BaseService
3434
include Concurrent::Async
35+
DEFAULT_SERVICE_NAME = "discovery"
36+
DEFAULT_SERVICE_URL = "https://gateway.watsonplatform.net/discovery/api"
3537
##
3638
# @!method initialize(args)
3739
# Construct a new client for the Discovery service.
@@ -50,19 +52,23 @@ class DiscoveryV1 < IBMCloudSdkCore::BaseService
5052
# @option args service_url [String] The base service URL to use when contacting the service.
5153
# The base service_url may differ between IBM Cloud regions.
5254
# @option args authenticator [Object] The Authenticator instance to be configured for this service.
55+
# @option args service_name [String] The name of the service to configure. Will be used as the key to load
56+
# any external configuration, if applicable.
5357
def initialize(args = {})
5458
@__async_initialized__ = false
5559
defaults = {}
5660
defaults[:version] = nil
57-
defaults[:service_url] = "https://gateway.watsonplatform.net/discovery/api"
61+
defaults[:service_url] = DEFAULT_SERVICE_URL
62+
defaults[:service_name] = DEFAULT_SERVICE_NAME
5863
defaults[:authenticator] = nil
64+
user_service_url = args[:service_url] unless args[:service_url].nil?
5965
args = defaults.merge(args)
6066
@version = args[:version]
6167
raise ArgumentError.new("version must be provided") if @version.nil?
6268

63-
args[:service_name] = "discovery"
6469
args[:authenticator] = IBMCloudSdkCore::ConfigBasedAuthenticatorFactory.new.get_authenticator(service_name: args[:service_name]) if args[:authenticator].nil?
6570
super
71+
@service_url = user_service_url unless user_service_url.nil?
6672
end
6773

6874
#########################
@@ -1312,7 +1318,7 @@ def delete_document(environment_id:, collection_id:, document_id:)
13121318
# Query a collection.
13131319
# By using this method, you can construct long queries. For details, see the
13141320
# [Discovery
1315-
# documentation](https://cloud.ibm.com/docs/services/discovery?topic=discovery-query-concepts#query-concepts).
1321+
# documentation](https://cloud.ibm.com/docs/discovery?topic=discovery-query-concepts#query-concepts).
13161322
# @param environment_id [String] The ID of the environment.
13171323
# @param collection_id [String] The ID of the collection.
13181324
# @param filter [String] A cacheable query that excludes documents that don't mention the query content.
@@ -1432,7 +1438,7 @@ def query(environment_id:, collection_id:, filter: nil, query: nil, natural_lang
14321438
# Queries for notices (errors or warnings) that might have been generated by the
14331439
# system. Notices are generated when ingesting documents and performing relevance
14341440
# training. See the [Discovery
1435-
# documentation](https://cloud.ibm.com/docs/services/discovery?topic=discovery-query-concepts#query-concepts)
1441+
# documentation](https://cloud.ibm.com/docs/discovery?topic=discovery-query-concepts#query-concepts)
14361442
# for more details on the query language.
14371443
# @param environment_id [String] The ID of the environment.
14381444
# @param collection_id [String] The ID of the collection.
@@ -1532,7 +1538,7 @@ def query_notices(environment_id:, collection_id:, filter: nil, query: nil, natu
15321538
# Query multiple collections.
15331539
# By using this method, you can construct long queries that search multiple
15341540
# collection. For details, see the [Discovery
1535-
# documentation](https://cloud.ibm.com/docs/services/discovery?topic=discovery-query-concepts#query-concepts).
1541+
# documentation](https://cloud.ibm.com/docs/discovery?topic=discovery-query-concepts#query-concepts).
15361542
# @param environment_id [String] The ID of the environment.
15371543
# @param collection_ids [String] A comma-separated list of collection IDs to be queried against.
15381544
# @param filter [String] A cacheable query that excludes documents that don't mention the query content.
@@ -1646,7 +1652,7 @@ def federated_query(environment_id:, collection_ids:, filter: nil, query: nil, n
16461652
# Queries for notices (errors or warnings) that might have been generated by the
16471653
# system. Notices are generated when ingesting documents and performing relevance
16481654
# training. See the [Discovery
1649-
# documentation](https://cloud.ibm.com/docs/services/discovery?topic=discovery-query-concepts#query-concepts)
1655+
# documentation](https://cloud.ibm.com/docs/discovery?topic=discovery-query-concepts#query-concepts)
16501656
# for more details on the query language.
16511657
# @param environment_id [String] The ID of the environment.
16521658
# @param collection_ids [Array[String]] A comma-separated list of collection IDs to be queried against.
@@ -2184,7 +2190,7 @@ def get_training_example(environment_id:, collection_id:, query_id:, example_id:
21842190
# You associate a customer ID with data by passing the **X-Watson-Metadata** header
21852191
# with a request that passes data. For more information about personal data and
21862192
# customer IDs, see [Information
2187-
# security](https://cloud.ibm.com/docs/services/discovery?topic=discovery-information-security#information-security).
2193+
# security](https://cloud.ibm.com/docs/discovery?topic=discovery-information-security#information-security).
21882194
# @param customer_id [String] The customer ID for which all data is to be deleted.
21892195
# @return [nil]
21902196
def delete_user_data(customer_id:)

lib/ibm_watson/discovery_v2.rb

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ module IBMWatson
3232
# The Discovery V2 service.
3333
class DiscoveryV2 < IBMCloudSdkCore::BaseService
3434
include Concurrent::Async
35+
DEFAULT_SERVICE_NAME = "discovery"
36+
DEFAULT_SERVICE_URL = nil
3537
##
3638
# @!method initialize(args)
3739
# Construct a new client for the Discovery service.
@@ -50,19 +52,23 @@ class DiscoveryV2 < IBMCloudSdkCore::BaseService
5052
# @option args service_url [String] The base service URL to use when contacting the service.
5153
# The base service_url may differ between IBM Cloud regions.
5254
# @option args authenticator [Object] The Authenticator instance to be configured for this service.
55+
# @option args service_name [String] The name of the service to configure. Will be used as the key to load
56+
# any external configuration, if applicable.
5357
def initialize(args = {})
5458
@__async_initialized__ = false
5559
defaults = {}
5660
defaults[:version] = nil
57-
defaults[:service_url] = nil
61+
defaults[:service_url] = DEFAULT_SERVICE_URL
62+
defaults[:service_name] = DEFAULT_SERVICE_NAME
5863
defaults[:authenticator] = nil
64+
user_service_url = args[:service_url] unless args[:service_url].nil?
5965
args = defaults.merge(args)
6066
@version = args[:version]
6167
raise ArgumentError.new("version must be provided") if @version.nil?
6268

63-
args[:service_name] = "discovery"
6469
args[:authenticator] = IBMCloudSdkCore::ConfigBasedAuthenticatorFactory.new.get_authenticator(service_name: args[:service_name]) if args[:authenticator].nil?
6570
super
71+
@service_url = user_service_url unless user_service_url.nil?
6672
end
6773

6874
#########################
@@ -107,7 +113,7 @@ def list_collections(project_id:)
107113
# @!method query(project_id:, collection_ids: nil, filter: nil, query: nil, natural_language_query: nil, aggregation: nil, count: nil, _return: nil, offset: nil, sort: nil, highlight: nil, spelling_suggestions: nil, table_results: nil, suggested_refinements: nil, passages: nil)
108114
# Query a project.
109115
# By using this method, you can construct queries. For details, see the [Discovery
110-
# documentation](https://cloud.ibm.com/docs/services/discovery-data?topic=discovery-data-query-concepts).
116+
# documentation](https://cloud.ibm.com/docs/discovery-data?topic=discovery-data-query-concepts).
111117
# @param project_id [String] The ID of the project. This information can be found from the deploy page of the
112118
# Discovery administrative tooling.
113119
# @param collection_ids [Array[String]] A comma-separated list of collection IDs to be queried against.

0 commit comments

Comments
 (0)