azure_cognitiveservices_websearch 0.17.1 → 0.18.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cd85351850691c04a86fe36c56d5a0453a20d6d9
4
- data.tar.gz: dcb4aa427f66ed4eabf57e95d1d9a689027351f7
3
+ metadata.gz: 7a247fab1fa5cc74e1085d2a4a6507f8d703dbb6
4
+ data.tar.gz: 6424abf5905ffa5280fd890ddb45800a8a1c6789
5
5
  SHA512:
6
- metadata.gz: 31e475fe1df646fc4dc511fe7e56cc3e34c36016db20fd520e874d690b3e1588678a17b4d99da49c996291005f213335a05d91af857029793d3402b6e310351f
7
- data.tar.gz: 3909c69afe673f70e2caaf1ee25de67cb00ceae8af2e762c34f5df727171d46688fca0047f191cd99ab1766a37e3db8f589ead50c6cde6eac4b47f2f63ca6703
6
+ metadata.gz: 4d2e4866c4a265ee373cfd87f8948c795bb223d08c95c153765c5ad8f14bdd29ee502a9600c4916e2ecb147ed91f350e89575c77004fda4a5fbece5e1444c74b
7
+ data.tar.gz: ea21bb04b22e4a4c470e91f866fadd584ae82646d0cedae6584d52fa61f24d95bd839c260427412a8e0ac18da2c93a4019c4e975785a5a698f89b8f63f4237df
@@ -716,6 +716,7 @@ module Azure::CognitiveServices::WebSearch::V1_0
716
716
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
717
717
  #
718
718
  def search_async(query, accept_language:nil, pragma:nil, user_agent:nil, client_id:nil, client_ip:nil, location:nil, answer_count:nil, country_code:nil, count:nil, freshness:nil, market:'en-us', offset:nil, promote:nil, response_filter:nil, safe_search:nil, set_lang:nil, text_decorations:nil, text_format:nil, custom_headers:nil)
719
+ fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
719
720
  x_bing_apis_sdk = 'true'
720
721
  fail ArgumentError, 'query is nil' if query.nil?
721
722
 
@@ -735,6 +736,7 @@ module Azure::CognitiveServices::WebSearch::V1_0
735
736
  path_template = 'search'
736
737
 
737
738
  request_url = @base_url || @client.base_url
739
+ request_url = request_url.gsub('{Endpoint}', @client.endpoint)
738
740
 
739
741
  options = {
740
742
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
@@ -12,11 +12,16 @@ module Azure::CognitiveServices::WebSearch::V1_0
12
12
  include MsRestAzure::Serialization
13
13
 
14
14
  # @return [String] the base URI of the service.
15
- attr_accessor :base_url
15
+ attr_reader :base_url
16
16
 
17
17
  # @return Credentials needed for the client to connect to Azure.
18
18
  attr_reader :credentials1
19
19
 
20
+ # @return [String] Supported Cognitive Services endpoints (protocol and
21
+ # hostname, for example: "https://westus.api.cognitive.microsoft.com",
22
+ # "https://api.cognitive.microsoft.com").
23
+ attr_accessor :endpoint
24
+
20
25
  # @return Subscription credentials which uniquely identify client
21
26
  # subscription.
22
27
  attr_accessor :credentials
@@ -39,17 +44,17 @@ module Azure::CognitiveServices::WebSearch::V1_0
39
44
  #
40
45
  # Creates initializes a new instance of the WebSearchClient class.
41
46
  # @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
42
- # @param base_url [String] the base URI of the service.
43
47
  # @param options [Array] filters to be applied to the HTTP requests.
44
48
  #
45
- def initialize(credentials = nil, base_url = nil, options = nil)
49
+ def initialize(credentials = nil, options = nil)
46
50
  super(credentials, options)
47
- @base_url = base_url || 'https://api.cognitive.microsoft.com/bing/v7.0'
51
+ @base_url = '{Endpoint}/bing/v7.0'
48
52
 
49
53
  fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
50
54
  @credentials = credentials
51
55
 
52
56
  @web = Web.new(self)
57
+ @endpoint = 'https://api.cognitive.microsoft.com'
53
58
  @accept_language = 'en-US'
54
59
  @long_running_operation_retry_timeout = 30
55
60
  @generate_client_request_id = true
@@ -121,7 +126,7 @@ module Azure::CognitiveServices::WebSearch::V1_0
121
126
  #
122
127
  def add_telemetry
123
128
  sdk_information = 'azure_cognitiveservices_websearch'
124
- sdk_information = "#{sdk_information}/0.17.1"
129
+ sdk_information = "#{sdk_information}/0.18.0"
125
130
  add_user_agent_information(sdk_information)
126
131
  end
127
132
  end
@@ -70,7 +70,7 @@ module Azure::WebSearch::Profiles::Latest
70
70
  @base_url = options[:base_url].nil? ? nil:options[:base_url]
71
71
  @options = options[:options].nil? ? nil:options[:options]
72
72
 
73
- @client_0 = Azure::CognitiveServices::WebSearch::V1_0::WebSearchClient.new(configurable.credentials, base_url, options)
73
+ @client_0 = Azure::CognitiveServices::WebSearch::V1_0::WebSearchClient.new(configurable.credentials, options)
74
74
  if(@client_0.respond_to?(:subscription_id))
75
75
  @client_0.subscription_id = configurable.subscription_id
76
76
  end
data/lib/version.rb CHANGED
@@ -3,5 +3,5 @@
3
3
  # Licensed under the MIT License. See License.txt in the project root for license information.
4
4
 
5
5
  module Azure::CognitiveServices::WebSearch
6
- VERSION = '0.17.1'
6
+ VERSION = '0.18.0'
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: azure_cognitiveservices_websearch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.1
4
+ version: 0.18.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Microsoft Corporation
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-11-06 00:00:00.000000000 Z
11
+ date: 2018-12-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler