azure_cognitiveservices_customsearch 0.17.0 → 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: ea372e843ab3a5a0a8bd2a7174a301a6f20f6764
4
- data.tar.gz: ed373350bc1c5ab3e9a60eecbfd85748b90566b7
3
+ metadata.gz: 1b4dc2466b474bcbd8a978cc0f127f0a8e986366
4
+ data.tar.gz: cb224930a958dd94d3ec786c7fc57bdf3641c7d8
5
5
  SHA512:
6
- metadata.gz: d04abadead43ab03e036914747d2de576efc0edb7ec5a4296094de362ad0a0021b1e1c7c9f06a9f8f4d406a6e4f62952015076a93963d69993def7e7b49bec1f
7
- data.tar.gz: 093469e8ad01d11584a186c1ee252614fe9e32caf9a74cd7edf3eb5a347951a9c4e967afa9452a9a4687ebdd5a1bf4e51eb5995b9ca115cc13e94f0f3cebb714
6
+ metadata.gz: a5312501111d065169a9f2860c077c8e8ec2e2fff2bc5ec6323711f16275ef758c4a3b45a582db7a33d9a88f6eec81e7eeb5e6f6605068e9a3cad6c343b6c9f1
7
+ data.tar.gz: e1085c9249a2539e95c37bba0250cb379cb96a562d2bc527c85628910d9e44f2b9facd09315b91459eee337f708fdd69db6e64ed9eac1ef07ffe8accf861fae0
@@ -26,7 +26,7 @@ module Azure::CognitiveServices::CustomSearch::V1_0
26
26
  # The Custom Search API lets you send a search query to Bing and get back web
27
27
  # pages found in your custom view of the web.
28
28
  #
29
- # @param custom_config [Integer] The identifier for the custom search
29
+ # @param custom_config [String] The identifier for the custom search
30
30
  # configuration
31
31
  # @param query [String] The user's search query term. The term may not be
32
32
  # empty. The term may contain Bing Advanced Operators. For example, to limit
@@ -218,7 +218,7 @@ module Azure::CognitiveServices::CustomSearch::V1_0
218
218
  # The Custom Search API lets you send a search query to Bing and get back web
219
219
  # pages found in your custom view of the web.
220
220
  #
221
- # @param custom_config [Integer] The identifier for the custom search
221
+ # @param custom_config [String] The identifier for the custom search
222
222
  # configuration
223
223
  # @param query [String] The user's search query term. The term may not be
224
224
  # empty. The term may contain Bing Advanced Operators. For example, to limit
@@ -409,7 +409,7 @@ module Azure::CognitiveServices::CustomSearch::V1_0
409
409
  # The Custom Search API lets you send a search query to Bing and get back web
410
410
  # pages found in your custom view of the web.
411
411
  #
412
- # @param custom_config [Integer] The identifier for the custom search
412
+ # @param custom_config [String] The identifier for the custom search
413
413
  # configuration
414
414
  # @param query [String] The user's search query term. The term may not be
415
415
  # empty. The term may contain Bing Advanced Operators. For example, to limit
@@ -593,9 +593,9 @@ module Azure::CognitiveServices::CustomSearch::V1_0
593
593
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
594
594
  #
595
595
  def search_async(custom_config, query, accept_language:nil, user_agent:nil, client_id:nil, client_ip:nil, location:nil, country_code:nil, count:nil, market:'en-us', offset:nil, safe_search:nil, set_lang:nil, text_decorations:nil, text_format:nil, custom_headers:nil)
596
+ fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
596
597
  x_bing_apis_sdk = 'true'
597
598
  fail ArgumentError, 'custom_config is nil' if custom_config.nil?
598
- fail ArgumentError, "'custom_config' should satisfy the constraint - 'InclusiveMinimum': '0'" if !custom_config.nil? && custom_config < 0
599
599
  fail ArgumentError, 'query is nil' if query.nil?
600
600
 
601
601
 
@@ -613,6 +613,7 @@ module Azure::CognitiveServices::CustomSearch::V1_0
613
613
  path_template = 'search'
614
614
 
615
615
  request_url = @base_url || @client.base_url
616
+ request_url = request_url.gsub('{Endpoint}', @client.endpoint)
616
617
 
617
618
  options = {
618
619
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
@@ -12,11 +12,16 @@ module Azure::CognitiveServices::CustomSearch::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::CustomSearch::V1_0
39
44
  #
40
45
  # Creates initializes a new instance of the CustomSearchClient 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/bingcustomsearch/v7.0'
51
+ @base_url = '{Endpoint}/bingcustomsearch/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
  @custom_instance = CustomInstance.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::CustomSearch::V1_0
121
126
  #
122
127
  def add_telemetry
123
128
  sdk_information = 'azure_cognitiveservices_customsearch'
124
- sdk_information = "#{sdk_information}/0.17.0"
129
+ sdk_information = "#{sdk_information}/0.18.0"
125
130
  add_user_agent_information(sdk_information)
126
131
  end
127
132
  end
@@ -48,7 +48,7 @@ module Azure::CustomSearch::Profiles::Latest
48
48
  @base_url = options[:base_url].nil? ? nil:options[:base_url]
49
49
  @options = options[:options].nil? ? nil:options[:options]
50
50
 
51
- @client_0 = Azure::CognitiveServices::CustomSearch::V1_0::CustomSearchClient.new(configurable.credentials, base_url, options)
51
+ @client_0 = Azure::CognitiveServices::CustomSearch::V1_0::CustomSearchClient.new(configurable.credentials, options)
52
52
  if(@client_0.respond_to?(:subscription_id))
53
53
  @client_0.subscription_id = configurable.subscription_id
54
54
  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::CustomSearch
6
- VERSION = '0.17.0'
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_customsearch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.0
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-07-31 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