azure_cognitiveservices_visualsearch 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: e15ef480b7df619f6dea70096bf49c65ff649c5d
4
- data.tar.gz: 537bddaa25a50e08bcb2ba5158b950a198246a8e
3
+ metadata.gz: 468710370711910d5844e522fb41383f19347bc1
4
+ data.tar.gz: 115e379f8ab4d7c3db435ddbbe10168a27ac2714
5
5
  SHA512:
6
- metadata.gz: 5251ba3d12a9ea50fb3c3955f4f14954027461256efa006336782a1b6594ca7917eda2818b1919edf800d92923b0341f0afe7243a5ac5ceb29e15c3cd0ed1ef8
7
- data.tar.gz: bb7fa0a09f5327bd5f93b51376e668d583402b5e6353d79b02b66569628947626cf6be030ad491c5324fd9b362fde44a06015d43ed7c0841f02ced6439d0228c
6
+ metadata.gz: 018566bc777d38fa1950e290a96ba13b3f3acdc11cbfaef2c255667b33788dbdfe5cf6fd52aac48a4e89d9a7711db71754ac5e7fa9eb5fbfc5105eaa2449b5a2
7
+ data.tar.gz: fcbf05920f307a881ff1942a981d5721c83684ac2e3e0c2e6ec03d3b8a274a5d069bd63836fb268435bb746d67690e23bb924dcf38a891f0852357d8edc75166
@@ -573,6 +573,7 @@ module Azure::CognitiveServices::VisualSearch::V1_0
573
573
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
574
574
  #
575
575
  def visual_search_async(content_type, accept_language:nil, user_agent:nil, client_id:nil, client_ip:nil, location:nil, market:nil, safe_search:nil, set_lang:nil, visual_search_request:nil, image:nil, custom_headers:nil)
576
+ fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
576
577
  x_bing_apis_sdk = 'true'
577
578
  fail ArgumentError, 'content_type is nil' if content_type.nil?
578
579
 
@@ -598,6 +599,7 @@ module Azure::CognitiveServices::VisualSearch::V1_0
598
599
  path_template = 'images/visualsearch'
599
600
 
600
601
  request_url = @base_url || @client.base_url
602
+ request_url = request_url.gsub('{Endpoint}', @client.endpoint)
601
603
 
602
604
  options = {
603
605
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
@@ -12,11 +12,16 @@ module Azure::CognitiveServices::VisualSearch::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::VisualSearch::V1_0
39
44
  #
40
45
  # Creates initializes a new instance of the VisualSearchClient 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
  @images = Images.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::VisualSearch::V1_0
121
126
  #
122
127
  def add_telemetry
123
128
  sdk_information = 'azure_cognitiveservices_visualsearch'
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
@@ -76,7 +76,7 @@ module Azure::VisualSearch::Profiles::Latest
76
76
  @base_url = options[:base_url].nil? ? nil:options[:base_url]
77
77
  @options = options[:options].nil? ? nil:options[:options]
78
78
 
79
- @client_0 = Azure::CognitiveServices::VisualSearch::V1_0::VisualSearchClient.new(configurable.credentials, base_url, options)
79
+ @client_0 = Azure::CognitiveServices::VisualSearch::V1_0::VisualSearchClient.new(configurable.credentials, options)
80
80
  if(@client_0.respond_to?(:subscription_id))
81
81
  @client_0.subscription_id = configurable.subscription_id
82
82
  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::VisualSearch
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_visualsearch
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-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