azure_cognitiveservices_websearch 0.16.0 → 0.18.2

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
- SHA1:
3
- metadata.gz: 4e9851541d4c7416d9d9fe3289b57087ab41cca7
4
- data.tar.gz: ee22b9a3af9f2ccda08d43cbb796a800115e3501
2
+ SHA256:
3
+ metadata.gz: 831e5f30b48599d50668c5adb63572e4e7ed457b970e388f3b6a4f737ac90f63
4
+ data.tar.gz: d6613215af99bbf4b32a43824b9e95a5e2a65ccdc57921279103ee9eb4f9d5cc
5
5
  SHA512:
6
- metadata.gz: 8645400c82c9c029baa3868c354bff671b384588f91b5ea4db94a78abd4ca00bbbacfaa1a8755fa833a2841af893b206ef5b08339e2319a38497aba7a7fd27b3
7
- data.tar.gz: ebee77375a2c3bc7c5ee702ff59f1fa63e03b7947255bba4638e46507d96df94d6b7367535c45bef86462bfd46cf70fe388ef305933e68e3a211ab23bca51e0c
6
+ metadata.gz: e2d2521291292e98ef4b02f0ed735ddd2c2a8a05064139b7b2442321c974d94a8123fcb0990f52078cbde71bc14a8c4fd1f12d2c7c6a6c06bbd9a5a17a448d8b
7
+ data.tar.gz: bbc55467ec9ed13db9bffd85bff5ea318f85c730a354d9c8e9666c6f5e259f32567acf6ab2678a10f3a69e0839524f440889059b2e3a8d5abaa0604aef0db530
@@ -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,24 +12,30 @@ 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
23
28
 
24
- # @return [String] Gets or sets the preferred language for the response.
29
+ # @return [String] The preferred language for the response.
25
30
  attr_accessor :accept_language
26
31
 
27
- # @return [Integer] Gets or sets the retry timeout in seconds for Long
28
- # Running Operations. Default value is 30.
32
+ # @return [Integer] The retry timeout in seconds for Long Running
33
+ # Operations. Default value is 30.
29
34
  attr_accessor :long_running_operation_retry_timeout
30
35
 
31
- # @return [Boolean] When set to true a unique x-ms-client-request-id value
32
- # is generated and included in each request. Default is true.
36
+ # @return [Boolean] Whether a unique x-ms-client-request-id should be
37
+ # generated. When set to true a unique x-ms-client-request-id value is
38
+ # generated and included in each request. Default is true.
33
39
  attr_accessor :generate_client_request_id
34
40
 
35
41
  # @return [Web] web
@@ -38,17 +44,17 @@ module Azure::CognitiveServices::WebSearch::V1_0
38
44
  #
39
45
  # Creates initializes a new instance of the WebSearchClient class.
40
46
  # @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
41
- # @param base_url [String] the base URI of the service.
42
47
  # @param options [Array] filters to be applied to the HTTP requests.
43
48
  #
44
- def initialize(credentials = nil, base_url = nil, options = nil)
49
+ def initialize(credentials = nil, options = nil)
45
50
  super(credentials, options)
46
- @base_url = base_url || 'https://api.cognitive.microsoft.com/bing/v7.0'
51
+ @base_url = '{Endpoint}/bing/v7.0'
47
52
 
48
53
  fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
49
54
  @credentials = credentials
50
55
 
51
56
  @web = Web.new(self)
57
+ @endpoint = 'https://api.cognitive.microsoft.com'
52
58
  @accept_language = 'en-US'
53
59
  @long_running_operation_retry_timeout = 30
54
60
  @generate_client_request_id = true
@@ -120,7 +126,7 @@ module Azure::CognitiveServices::WebSearch::V1_0
120
126
  #
121
127
  def add_telemetry
122
128
  sdk_information = 'azure_cognitiveservices_websearch'
123
- sdk_information = "#{sdk_information}/0.16.0"
129
+ sdk_information = "#{sdk_information}/0.18.2"
124
130
  add_user_agent_information(sdk_information)
125
131
  end
126
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
@@ -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.16.0'
6
+ VERSION = '0.18.2'
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.16.0
4
+ version: 0.18.2
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-02-12 00:00:00.000000000 Z
11
+ date: 2020-06-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 0.10.0
75
+ version: 0.12.0
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 0.10.0
82
+ version: 0.12.0
83
83
  description: Microsoft Azure Cognitive Services Web Search Client Library for Ruby
84
84
  email: azrubyteam@microsoft.com
85
85
  executables: []
@@ -163,7 +163,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
163
163
  version: '0'
164
164
  requirements: []
165
165
  rubyforge_project:
166
- rubygems_version: 2.5.1
166
+ rubygems_version: 2.7.8
167
167
  signing_key:
168
168
  specification_version: 4
169
169
  summary: Official Ruby client library to consume Microsoft Azure Cognitive Services