azure_cognitiveservices_spellcheck 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: f8960a84da6dbe8a2b5b0197438a6ffd6f6a058d
4
- data.tar.gz: cc4687fa9c67eaf1e5ec27b46f74c6ba5279031b
3
+ metadata.gz: f916a97751cf17aed566455a27117a25c9dd46ba
4
+ data.tar.gz: 14418097d38fffc51197c28060f2275611ffa3dc
5
5
  SHA512:
6
- metadata.gz: d447a16c2b97419acd4558a6a32699266027dee1d0bf06498cdb298f6c9a4c65aa0dff00ee75abb674346ac12a9a8fc2cf38181bafe7d35a6b5e4aa3db098f76
7
- data.tar.gz: 85bbc62915d16e95e6b1e0230666273c87117bbb80379cdc616dc9f699161a9565a982440bbefb8251aec9c47cb8c3bbd64b604a3cae4ae9a24591148b3b4813
6
+ metadata.gz: e10a3d239155832ca6f1390b1fa5a6b31fa64ed2fd951d4e5bea9e883597ea250d4904fb494fce022d9fba17fb2fbafbe26adc58d0fe5a08ac19f1d3493c5d94
7
+ data.tar.gz: 77dabcc565a7ccea8d249877de0a8e3fbaf08d90e6e512285a0113b6da13319a11772849d62470e3a6ffe3884dd2eb293b19d5050cc8e7e1f86d5aa6f4920e08
@@ -12,11 +12,16 @@ module Azure::CognitiveServices::SpellCheck::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
@@ -36,16 +41,16 @@ module Azure::CognitiveServices::SpellCheck::V1_0
36
41
  #
37
42
  # Creates initializes a new instance of the SpellCheckClient class.
38
43
  # @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
39
- # @param base_url [String] the base URI of the service.
40
44
  # @param options [Array] filters to be applied to the HTTP requests.
41
45
  #
42
- def initialize(credentials = nil, base_url = nil, options = nil)
46
+ def initialize(credentials = nil, options = nil)
43
47
  super(credentials, options)
44
- @base_url = base_url || 'https://api.cognitive.microsoft.com/bing/v7.0'
48
+ @base_url = '{Endpoint}/bing/v7.0'
45
49
 
46
50
  fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
47
51
  @credentials = credentials
48
52
 
53
+ @endpoint = 'https://api.cognitive.microsoft.com'
49
54
  @accept_language = 'en-US'
50
55
  @long_running_operation_retry_timeout = 30
51
56
  @generate_client_request_id = true
@@ -699,6 +704,7 @@ module Azure::CognitiveServices::SpellCheck::V1_0
699
704
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
700
705
  #
701
706
  def spell_checker_async(text, accept_language:nil, pragma:nil, user_agent:nil, client_id:nil, client_ip:nil, location:nil, action_type:nil, app_name:nil, country_code:nil, client_machine_name:nil, doc_id:nil, market:nil, session_id:nil, set_lang:nil, user_id:nil, mode:nil, pre_context_text:nil, post_context_text:nil, custom_headers:nil)
707
+ fail ArgumentError, 'endpoint is nil' if endpoint.nil?
702
708
  x_bing_apis_sdk = 'true'
703
709
  fail ArgumentError, 'text is nil' if text.nil?
704
710
 
@@ -726,6 +732,7 @@ module Azure::CognitiveServices::SpellCheck::V1_0
726
732
  path_template = 'spellcheck'
727
733
 
728
734
  request_url = @base_url || self.base_url
735
+ request_url = request_url.gsub('{Endpoint}', endpoint)
729
736
 
730
737
  options = {
731
738
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
@@ -770,7 +777,7 @@ module Azure::CognitiveServices::SpellCheck::V1_0
770
777
  #
771
778
  def add_telemetry
772
779
  sdk_information = 'azure_cognitiveservices_spellcheck'
773
- sdk_information = "#{sdk_information}/0.17.0"
780
+ sdk_information = "#{sdk_information}/0.18.0"
774
781
  add_user_agent_information(sdk_information)
775
782
  end
776
783
  end
@@ -42,7 +42,7 @@ module Azure::SpellCheck::Profiles::Latest
42
42
  @base_url = options[:base_url].nil? ? nil:options[:base_url]
43
43
  @options = options[:options].nil? ? nil:options[:options]
44
44
 
45
- @client_0 = Azure::CognitiveServices::SpellCheck::V1_0::SpellCheckClient.new(configurable.credentials, base_url, options)
45
+ @client_0 = Azure::CognitiveServices::SpellCheck::V1_0::SpellCheckClient.new(configurable.credentials, options)
46
46
  if(@client_0.respond_to?(:subscription_id))
47
47
  @client_0.subscription_id = configurable.subscription_id
48
48
  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::SpellCheck
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_spellcheck
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