azure_cognitiveservices_imagesearch 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: 84382ce00fb2d1563e0a2a5eaf48072fd25dbaea
4
- data.tar.gz: b94758dab11790b4c12f7f3c6a81e36daa076465
3
+ metadata.gz: b50e7e633dc4329ad973a9e84ceb86700473c4ae
4
+ data.tar.gz: 03c94e320ec6f3335c68dac91e242931a5ce6254
5
5
  SHA512:
6
- metadata.gz: a94fd759f85f6c006ee55d63f9ab996211d62b7d369b3fb4c1eaa742c833e7b594a25d9f06150080048f027cfcddbf03219f5340a027e32194dbb6ce788867e3
7
- data.tar.gz: e4736069ff7a33345a75e2dee37a0bef1a655c07d97195a860e1cd0fe9f20bfb0f212b5b3abaeb746eecf06330ebe1dc209e0579b412409623d90e4039f46f47
6
+ metadata.gz: b24e1b519a762375daf5eca982d6b20a4ccaeebc192b160db862867eeef4f4bec10b3cf1dbcf3d5844694bd938f4cd895c6995c9db1318775c3ea70023ef7da3
7
+ data.tar.gz: 86fea9b48e745bb91e1bd71d0981056d578a8b80d3f99dff2a09d733be9224de1d104b0ae046d55fd4145d9b6b336af3f5eb6f67da781796ff1a3bcd4cf1b005
@@ -12,11 +12,16 @@ module Azure::CognitiveServices::ImageSearch::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::ImageSearch::V1_0
39
44
  #
40
45
  # Creates initializes a new instance of the ImageSearchClient 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_operations = ImagesOperations.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::ImageSearch::V1_0
121
126
  #
122
127
  def add_telemetry
123
128
  sdk_information = 'azure_cognitiveservices_imagesearch'
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
@@ -963,6 +963,7 @@ module Azure::CognitiveServices::ImageSearch::V1_0
963
963
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
964
964
  #
965
965
  def search_async(query, accept_language:nil, user_agent:nil, client_id:nil, client_ip:nil, location:nil, aspect:nil, color:nil, country_code:nil, count:nil, freshness:nil, height:nil, id:nil, image_content:nil, image_type:nil, license:nil, market:nil, max_file_size:nil, max_height:nil, max_width:nil, min_file_size:nil, min_height:nil, min_width:nil, offset:nil, safe_search:nil, size:nil, set_lang:nil, width:nil, custom_headers:nil)
966
+ fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
966
967
  x_bing_apis_sdk = 'true'
967
968
  fail ArgumentError, 'query is nil' if query.nil?
968
969
 
@@ -981,6 +982,7 @@ module Azure::CognitiveServices::ImageSearch::V1_0
981
982
  path_template = 'images/search'
982
983
 
983
984
  request_url = @base_url || @client.base_url
985
+ request_url = request_url.gsub('{Endpoint}', @client.endpoint)
984
986
 
985
987
  options = {
986
988
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
@@ -1867,6 +1869,7 @@ module Azure::CognitiveServices::ImageSearch::V1_0
1867
1869
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1868
1870
  #
1869
1871
  def details_async(query, accept_language:nil, content_type:nil, user_agent:nil, client_id:nil, client_ip:nil, location:nil, crop_bottom:nil, crop_left:nil, crop_right:nil, crop_top:nil, crop_type:nil, country_code:nil, id:nil, image_url:nil, insights_token:nil, modules:nil, market:nil, safe_search:nil, set_lang:nil, custom_headers:nil)
1872
+ fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
1870
1873
  x_bing_apis_sdk = 'true'
1871
1874
  fail ArgumentError, 'query is nil' if query.nil?
1872
1875
 
@@ -1886,6 +1889,7 @@ module Azure::CognitiveServices::ImageSearch::V1_0
1886
1889
  path_template = 'images/details'
1887
1890
 
1888
1891
  request_url = @base_url || @client.base_url
1892
+ request_url = request_url.gsub('{Endpoint}', @client.endpoint)
1889
1893
 
1890
1894
  options = {
1891
1895
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
@@ -2469,6 +2473,7 @@ module Azure::CognitiveServices::ImageSearch::V1_0
2469
2473
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2470
2474
  #
2471
2475
  def trending_async(accept_language:nil, user_agent:nil, client_id:nil, client_ip:nil, location:nil, country_code:nil, market:nil, safe_search:nil, set_lang:nil, custom_headers:nil)
2476
+ fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
2472
2477
  x_bing_apis_sdk = 'true'
2473
2478
 
2474
2479
 
@@ -2486,6 +2491,7 @@ module Azure::CognitiveServices::ImageSearch::V1_0
2486
2491
  path_template = 'images/trending'
2487
2492
 
2488
2493
  request_url = @base_url || @client.base_url
2494
+ request_url = request_url.gsub('{Endpoint}', @client.endpoint)
2489
2495
 
2490
2496
  options = {
2491
2497
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
@@ -34,7 +34,7 @@ module Azure::CognitiveServices::ImageSearch::V1_0
34
34
  # of the number of websites where you can buy an apple pie. To indicate
35
35
  # the number of offers in your UX, include badging such as a shopping
36
36
  # cart icon that contains the count. When the user clicks on the icon,
37
- # use imageInisghtsToken to get the list of websites.
37
+ # use imageInsightsToken to get the list of websites.
38
38
  attr_accessor :insights_metadata
39
39
 
40
40
  # @return [String] Unique Id for the image
@@ -87,7 +87,7 @@ module Azure::ImageSearch::Profiles::Latest
87
87
  @base_url = options[:base_url].nil? ? nil:options[:base_url]
88
88
  @options = options[:options].nil? ? nil:options[:options]
89
89
 
90
- @client_0 = Azure::CognitiveServices::ImageSearch::V1_0::ImageSearchClient.new(configurable.credentials, base_url, options)
90
+ @client_0 = Azure::CognitiveServices::ImageSearch::V1_0::ImageSearchClient.new(configurable.credentials, options)
91
91
  if(@client_0.respond_to?(:subscription_id))
92
92
  @client_0.subscription_id = configurable.subscription_id
93
93
  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::ImageSearch
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_imagesearch
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