azure_cognitiveservices_newssearch 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: 31eb51fb6bd84614cea9d24ecf15e59dc1d7d56a
4
- data.tar.gz: aa3af0c5432f8b4d76576eec1e83a23ba3cc5575
3
+ metadata.gz: f12a4960dff5666aec476f42cb596813735f757c
4
+ data.tar.gz: 8f7fb8d2fcc5b1bfed34c8c33867e19556143faf
5
5
  SHA512:
6
- metadata.gz: 86931371a3ab1835a88f56ec651e1266b193473b559f58c981fad2ef5e55ee208531a582bb583b076d80c8c43e5f36473b3cbf0171cba838570fc35b1884933c
7
- data.tar.gz: 29a7290b64749b860a57cb7c2c1362c608e156d0327d9b4ebb4fbd32e82dc3fa870fe05fd07cb009abc123ec0c300bc3664e539dcc7bf8f4e36177621309f75c
6
+ metadata.gz: 126a9cfa721fcf9c94c8689e9c0134ba8735f1984e844e6280255a0b76ba75b095e28228d6bb09848a1eb1346d6c4e0e83fcb954bab849030b46d7e037ca7dc1
7
+ data.tar.gz: d9f799a00524f535079833020995b5e27e39cdbe27b7781103beb1fba92363789f6f43386ea0890b71329b8e0eefbe2e88bed8247b459fc9afb390d52f5279c4
@@ -753,6 +753,7 @@ module Azure::CognitiveServices::NewsSearch::V1_0
753
753
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
754
754
  #
755
755
  def search_async(query, accept_language:nil, user_agent:nil, client_id:nil, client_ip:nil, location:nil, country_code:nil, count:nil, freshness:nil, market:nil, offset:nil, original_image:nil, safe_search:nil, set_lang:nil, sort_by:nil, text_decorations:nil, text_format:nil, custom_headers:nil)
756
+ fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
756
757
  x_bing_apis_sdk = 'true'
757
758
  fail ArgumentError, 'query is nil' if query.nil?
758
759
 
@@ -771,6 +772,7 @@ module Azure::CognitiveServices::NewsSearch::V1_0
771
772
  path_template = 'news/search'
772
773
 
773
774
  request_url = @base_url || @client.base_url
775
+ request_url = request_url.gsub('{Endpoint}', @client.endpoint)
774
776
 
775
777
  options = {
776
778
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
@@ -808,11 +810,11 @@ module Azure::CognitiveServices::NewsSearch::V1_0
808
810
  end
809
811
 
810
812
  #
811
- # The News Category API lets lets you search on Bing and get back a list of top
812
- # news articles by category. This section provides technical details about the
813
- # query parameters and headers that you use to request news and the JSON
814
- # response objects that contain them. For examples that show how to make
815
- # requests, see [Searching the web for
813
+ # The News Category API lets you search on Bing and get back a list of top news
814
+ # articles by category. This section provides technical details about the query
815
+ # parameters and headers that you use to request news and the JSON response
816
+ # objects that contain them. For examples that show how to make requests, see
817
+ # [Searching the web for
816
818
  # news](https://docs.microsoft.com/en-us/azure/cognitive-services/bing-news-search/search-the-web).
817
819
  #
818
820
  # @param accept_language [String] A comma-delimited list of one or more
@@ -1054,11 +1056,11 @@ module Azure::CognitiveServices::NewsSearch::V1_0
1054
1056
  end
1055
1057
 
1056
1058
  #
1057
- # The News Category API lets lets you search on Bing and get back a list of top
1058
- # news articles by category. This section provides technical details about the
1059
- # query parameters and headers that you use to request news and the JSON
1060
- # response objects that contain them. For examples that show how to make
1061
- # requests, see [Searching the web for
1059
+ # The News Category API lets you search on Bing and get back a list of top news
1060
+ # articles by category. This section provides technical details about the query
1061
+ # parameters and headers that you use to request news and the JSON response
1062
+ # objects that contain them. For examples that show how to make requests, see
1063
+ # [Searching the web for
1062
1064
  # news](https://docs.microsoft.com/en-us/azure/cognitive-services/bing-news-search/search-the-web).
1063
1065
  #
1064
1066
  # @param accept_language [String] A comma-delimited list of one or more
@@ -1299,11 +1301,11 @@ module Azure::CognitiveServices::NewsSearch::V1_0
1299
1301
  end
1300
1302
 
1301
1303
  #
1302
- # The News Category API lets lets you search on Bing and get back a list of top
1303
- # news articles by category. This section provides technical details about the
1304
- # query parameters and headers that you use to request news and the JSON
1305
- # response objects that contain them. For examples that show how to make
1306
- # requests, see [Searching the web for
1304
+ # The News Category API lets you search on Bing and get back a list of top news
1305
+ # articles by category. This section provides technical details about the query
1306
+ # parameters and headers that you use to request news and the JSON response
1307
+ # objects that contain them. For examples that show how to make requests, see
1308
+ # [Searching the web for
1307
1309
  # news](https://docs.microsoft.com/en-us/azure/cognitive-services/bing-news-search/search-the-web).
1308
1310
  #
1309
1311
  # @param accept_language [String] A comma-delimited list of one or more
@@ -1540,6 +1542,7 @@ module Azure::CognitiveServices::NewsSearch::V1_0
1540
1542
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1541
1543
  #
1542
1544
  def category_async(accept_language:nil, user_agent:nil, client_id:nil, client_ip:nil, location:nil, country_code:nil, category:nil, count:nil, headline_count:nil, market:nil, offset:nil, original_image:nil, safe_search:nil, set_lang:nil, text_decorations:nil, text_format:nil, custom_headers:nil)
1545
+ fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
1543
1546
  x_bing_apis_sdk = 'true'
1544
1547
 
1545
1548
 
@@ -1557,6 +1560,7 @@ module Azure::CognitiveServices::NewsSearch::V1_0
1557
1560
  path_template = 'news'
1558
1561
 
1559
1562
  request_url = @base_url || @client.base_url
1563
+ request_url = request_url.gsub('{Endpoint}', @client.endpoint)
1560
1564
 
1561
1565
  options = {
1562
1566
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
@@ -1594,8 +1598,8 @@ module Azure::CognitiveServices::NewsSearch::V1_0
1594
1598
  end
1595
1599
 
1596
1600
  #
1597
- # The News Trending Topics API lets lets you search on Bing and get back a list
1598
- # of trending news topics that are currently trending on Bing. This section
1601
+ # The News Trending Topics API lets you search on Bing and get back a list of
1602
+ # trending news topics that are currently trending on Bing. This section
1599
1603
  # provides technical details about the query parameters and headers that you
1600
1604
  # use to request news and the JSON response objects that contain them. For
1601
1605
  # examples that show how to make requests, see [Searching the web for
@@ -1821,8 +1825,8 @@ module Azure::CognitiveServices::NewsSearch::V1_0
1821
1825
  end
1822
1826
 
1823
1827
  #
1824
- # The News Trending Topics API lets lets you search on Bing and get back a list
1825
- # of trending news topics that are currently trending on Bing. This section
1828
+ # The News Trending Topics API lets you search on Bing and get back a list of
1829
+ # trending news topics that are currently trending on Bing. This section
1826
1830
  # provides technical details about the query parameters and headers that you
1827
1831
  # use to request news and the JSON response objects that contain them. For
1828
1832
  # examples that show how to make requests, see [Searching the web for
@@ -2047,8 +2051,8 @@ module Azure::CognitiveServices::NewsSearch::V1_0
2047
2051
  end
2048
2052
 
2049
2053
  #
2050
- # The News Trending Topics API lets lets you search on Bing and get back a list
2051
- # of trending news topics that are currently trending on Bing. This section
2054
+ # The News Trending Topics API lets you search on Bing and get back a list of
2055
+ # trending news topics that are currently trending on Bing. This section
2052
2056
  # provides technical details about the query parameters and headers that you
2053
2057
  # use to request news and the JSON response objects that contain them. For
2054
2058
  # examples that show how to make requests, see [Searching the web for
@@ -2269,6 +2273,7 @@ module Azure::CognitiveServices::NewsSearch::V1_0
2269
2273
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2270
2274
  #
2271
2275
  def trending_async(accept_language:nil, user_agent:nil, client_id:nil, client_ip:nil, location:nil, country_code:nil, count:nil, market:nil, offset:nil, safe_search:nil, set_lang:nil, since:nil, sort_by:nil, text_decorations:nil, text_format:nil, custom_headers:nil)
2276
+ fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
2272
2277
  x_bing_apis_sdk = 'true'
2273
2278
 
2274
2279
 
@@ -2286,6 +2291,7 @@ module Azure::CognitiveServices::NewsSearch::V1_0
2286
2291
  path_template = 'news/trendingtopics'
2287
2292
 
2288
2293
  request_url = @base_url || @client.base_url
2294
+ request_url = request_url.gsub('{Endpoint}', @client.endpoint)
2289
2295
 
2290
2296
  options = {
2291
2297
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
@@ -12,11 +12,16 @@ module Azure::CognitiveServices::NewsSearch::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::NewsSearch::V1_0
39
44
  #
40
45
  # Creates initializes a new instance of the NewsSearchClient 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
  @news_operations = NewsOperations.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::NewsSearch::V1_0
121
126
  #
122
127
  def add_telemetry
123
128
  sdk_information = 'azure_cognitiveservices_newssearch'
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
@@ -53,7 +53,7 @@ module Azure::NewsSearch::Profiles::Latest
53
53
  @base_url = options[:base_url].nil? ? nil:options[:base_url]
54
54
  @options = options[:options].nil? ? nil:options[:options]
55
55
 
56
- @client_0 = Azure::CognitiveServices::NewsSearch::V1_0::NewsSearchClient.new(configurable.credentials, base_url, options)
56
+ @client_0 = Azure::CognitiveServices::NewsSearch::V1_0::NewsSearchClient.new(configurable.credentials, options)
57
57
  if(@client_0.respond_to?(:subscription_id))
58
58
  @client_0.subscription_id = configurable.subscription_id
59
59
  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::NewsSearch
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_newssearch
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