@@ -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 :)
0 commit comments