azure_mgmt_search 0.7.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. checksums.yaml +4 -4
  2. data/lib/generated/azure_mgmt_search.rb +10 -9
  3. data/lib/generated/azure_mgmt_search/admin_keys.rb +162 -24
  4. data/lib/generated/azure_mgmt_search/models/admin_key_kind.rb +16 -0
  5. data/lib/generated/azure_mgmt_search/models/admin_key_result.rb +5 -5
  6. data/lib/generated/azure_mgmt_search/models/check_name_availability_input.rb +61 -0
  7. data/lib/generated/azure_mgmt_search/models/check_name_availability_output.rb +74 -0
  8. data/lib/generated/azure_mgmt_search/models/hosting_mode.rb +16 -0
  9. data/lib/generated/azure_mgmt_search/models/provisioning_state.rb +1 -1
  10. data/lib/generated/azure_mgmt_search/models/query_key.rb +1 -1
  11. data/lib/generated/azure_mgmt_search/models/search_management_request_options.rb +44 -0
  12. data/lib/generated/azure_mgmt_search/models/search_service.rb +205 -0
  13. data/lib/generated/azure_mgmt_search/models/search_service_status.rb +1 -1
  14. data/lib/generated/azure_mgmt_search/models/sku.rb +11 -4
  15. data/lib/generated/azure_mgmt_search/models/{sku_type.rb → sku_name.rb} +5 -3
  16. data/lib/generated/azure_mgmt_search/models/unavailable_name_reason.rb +16 -0
  17. data/lib/generated/azure_mgmt_search/module_definition.rb +1 -1
  18. data/lib/generated/azure_mgmt_search/query_keys.rb +266 -21
  19. data/lib/generated/azure_mgmt_search/search_management_client.rb +20 -6
  20. data/lib/generated/azure_mgmt_search/services.rb +371 -74
  21. data/lib/generated/azure_mgmt_search/version.rb +2 -2
  22. metadata +12 -11
  23. data/lib/generated/azure_mgmt_search/models/list_query_keys_result.rb +0 -53
  24. data/lib/generated/azure_mgmt_search/models/search_service_create_or_update_parameters.rb +0 -73
  25. data/lib/generated/azure_mgmt_search/models/search_service_list_result.rb +0 -55
  26. data/lib/generated/azure_mgmt_search/models/search_service_properties.rb +0 -68
  27. data/lib/generated/azure_mgmt_search/models/search_service_readable_properties.rb +0 -107
  28. data/lib/generated/azure_mgmt_search/models/search_service_resource.rb +0 -96
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
@@ -17,12 +17,13 @@ module Azure::ARM::Search
17
17
  # @return Credentials needed for the client to connect to Azure.
18
18
  attr_reader :credentials
19
19
 
20
- # @return [String] Gets subscription credentials which uniquely identify
21
- # Microsoft Azure subscription. The subscription ID forms part of the URI
22
- # for every service call.
20
+ # @return [String] The unique identifier for a Microsoft Azure
21
+ # subscription. You can obtain this value from the Azure Resource Manager
22
+ # API or the portal.
23
23
  attr_accessor :subscription_id
24
24
 
25
- # @return [String] Client Api Version.
25
+ # @return [String] The API version to use for each request. The current
26
+ # version is 2015-08-19.
26
27
  attr_reader :api_version
27
28
 
28
29
  # @return [String] Gets or sets the preferred language for the response.
@@ -62,10 +63,11 @@ module Azure::ARM::Search
62
63
  @admin_keys = AdminKeys.new(self)
63
64
  @query_keys = QueryKeys.new(self)
64
65
  @services = Services.new(self)
65
- @api_version = '2015-02-28'
66
+ @api_version = '2015-08-19'
66
67
  @accept_language = 'en-US'
67
68
  @long_running_operation_retry_timeout = 30
68
69
  @generate_client_request_id = true
70
+ add_telemetry
69
71
  end
70
72
 
71
73
  #
@@ -123,5 +125,17 @@ module Azure::ARM::Search
123
125
  super(request_url, method, path, options)
124
126
  end
125
127
 
128
+
129
+ private
130
+ #
131
+ # Adds telemetry information.
132
+ #
133
+ def add_telemetry
134
+ sdk_information = 'azure_mgmt_search'
135
+ if defined? Azure::ARM::Search::VERSION
136
+ sdk_information = "#{sdk_information}/#{Azure::ARM::Search::VERSION}"
137
+ end
138
+ add_user_agent_information(sdk_information)
139
+ end
126
140
  end
127
141
  end
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
@@ -24,89 +24,118 @@ module Azure::ARM::Search
24
24
 
25
25
  #
26
26
  # Creates or updates a Search service in the given resource group. If the
27
- # Search service already exists, all properties will be updated with the
28
- # given values.
29
- #
30
- # @param resource_group_name [String] The name of the resource group within
31
- # the current subscription.
32
- # @param service_name [String] The name of the Search service to create or
33
- # update.
34
- # @param parameters [SearchServiceCreateOrUpdateParameters] The properties to
35
- # set or update on the Search service.
27
+ # Search service already exists, all properties will be updated with the given
28
+ # values.
29
+ #
30
+ # @param resource_group_name [String] The name of the resource group within the
31
+ # current subscription. You can obtain this value from the Azure Resource
32
+ # Manager API or the portal.
33
+ # @param search_service_name [String] The name of the Azure Search service to
34
+ # create or update. Search service names must only contain lowercase letters,
35
+ # digits or dashes, cannot use dash as the first two or last one characters,
36
+ # cannot contain consecutive dashes, and must be between 2 and 60 characters in
37
+ # length. Search service names must be globally unique since they are part of
38
+ # the service URI (https://<name>.search.windows.net). You cannot change the
39
+ # service name after the service is created.
40
+ # @param service [SearchService] The definition of the Search service to create
41
+ # or update.
42
+ # @param search_management_request_options [SearchManagementRequestOptions]
43
+ # Additional parameters for the operation
36
44
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
37
45
  # will be added to the HTTP request.
38
46
  #
39
- # @return [SearchServiceResource] operation results.
47
+ # @return [SearchService] operation results.
40
48
  #
41
- def create_or_update(resource_group_name, service_name, parameters, custom_headers = nil)
42
- response = create_or_update_async(resource_group_name, service_name, parameters, custom_headers).value!
49
+ def create_or_update(resource_group_name, search_service_name, service, search_management_request_options = nil, custom_headers = nil)
50
+ response = create_or_update_async(resource_group_name, search_service_name, service, search_management_request_options, custom_headers).value!
43
51
  response.body unless response.nil?
44
52
  end
45
53
 
46
54
  #
47
55
  # Creates or updates a Search service in the given resource group. If the
48
- # Search service already exists, all properties will be updated with the
49
- # given values.
50
- #
51
- # @param resource_group_name [String] The name of the resource group within
52
- # the current subscription.
53
- # @param service_name [String] The name of the Search service to create or
54
- # update.
55
- # @param parameters [SearchServiceCreateOrUpdateParameters] The properties to
56
- # set or update on the Search service.
56
+ # Search service already exists, all properties will be updated with the given
57
+ # values.
58
+ #
59
+ # @param resource_group_name [String] The name of the resource group within the
60
+ # current subscription. You can obtain this value from the Azure Resource
61
+ # Manager API or the portal.
62
+ # @param search_service_name [String] The name of the Azure Search service to
63
+ # create or update. Search service names must only contain lowercase letters,
64
+ # digits or dashes, cannot use dash as the first two or last one characters,
65
+ # cannot contain consecutive dashes, and must be between 2 and 60 characters in
66
+ # length. Search service names must be globally unique since they are part of
67
+ # the service URI (https://<name>.search.windows.net). You cannot change the
68
+ # service name after the service is created.
69
+ # @param service [SearchService] The definition of the Search service to create
70
+ # or update.
71
+ # @param search_management_request_options [SearchManagementRequestOptions]
72
+ # Additional parameters for the operation
57
73
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
58
74
  # will be added to the HTTP request.
59
75
  #
60
76
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
61
77
  #
62
- def create_or_update_with_http_info(resource_group_name, service_name, parameters, custom_headers = nil)
63
- create_or_update_async(resource_group_name, service_name, parameters, custom_headers).value!
78
+ def create_or_update_with_http_info(resource_group_name, search_service_name, service, search_management_request_options = nil, custom_headers = nil)
79
+ create_or_update_async(resource_group_name, search_service_name, service, search_management_request_options, custom_headers).value!
64
80
  end
65
81
 
66
82
  #
67
83
  # Creates or updates a Search service in the given resource group. If the
68
- # Search service already exists, all properties will be updated with the
69
- # given values.
70
- #
71
- # @param resource_group_name [String] The name of the resource group within
72
- # the current subscription.
73
- # @param service_name [String] The name of the Search service to create or
74
- # update.
75
- # @param parameters [SearchServiceCreateOrUpdateParameters] The properties to
76
- # set or update on the Search service.
84
+ # Search service already exists, all properties will be updated with the given
85
+ # values.
86
+ #
87
+ # @param resource_group_name [String] The name of the resource group within the
88
+ # current subscription. You can obtain this value from the Azure Resource
89
+ # Manager API or the portal.
90
+ # @param search_service_name [String] The name of the Azure Search service to
91
+ # create or update. Search service names must only contain lowercase letters,
92
+ # digits or dashes, cannot use dash as the first two or last one characters,
93
+ # cannot contain consecutive dashes, and must be between 2 and 60 characters in
94
+ # length. Search service names must be globally unique since they are part of
95
+ # the service URI (https://<name>.search.windows.net). You cannot change the
96
+ # service name after the service is created.
97
+ # @param service [SearchService] The definition of the Search service to create
98
+ # or update.
99
+ # @param search_management_request_options [SearchManagementRequestOptions]
100
+ # Additional parameters for the operation
77
101
  # @param [Hash{String => String}] A hash of custom headers that will be added
78
102
  # to the HTTP request.
79
103
  #
80
104
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
81
105
  #
82
- def create_or_update_async(resource_group_name, service_name, parameters, custom_headers = nil)
106
+ def create_or_update_async(resource_group_name, search_service_name, service, search_management_request_options = nil, custom_headers = nil)
83
107
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
84
- fail ArgumentError, 'service_name is nil' if service_name.nil?
85
- fail ArgumentError, 'parameters is nil' if parameters.nil?
108
+ fail ArgumentError, 'search_service_name is nil' if search_service_name.nil?
109
+ fail ArgumentError, 'service is nil' if service.nil?
86
110
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
87
111
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
88
112
 
113
+ client_request_id = nil
114
+ unless search_management_request_options.nil?
115
+ client_request_id = search_management_request_options.clientRequestId
116
+ end
89
117
 
90
118
  request_headers = {}
91
119
 
92
120
  # Set Headers
93
121
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
94
122
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
123
+ request_headers['x-ms-client-request-id'] = client_request_id.to_s unless client_request_id.to_s.nil?
95
124
 
96
125
  request_headers['Content-Type'] = 'application/json; charset=utf-8'
97
126
 
98
127
  # Serialize Request
99
- request_mapper = SearchServiceCreateOrUpdateParameters.mapper()
100
- request_content = @client.serialize(request_mapper, parameters, 'parameters')
128
+ request_mapper = SearchService.mapper()
129
+ request_content = @client.serialize(request_mapper, service, 'service')
101
130
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
102
131
 
103
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{serviceName}'
132
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}'
104
133
 
105
134
  request_url = @base_url || @client.base_url
106
135
 
107
136
  options = {
108
137
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
109
- path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'subscriptionId' => @client.subscription_id},
138
+ path_params: {'resourceGroupName' => resource_group_name,'searchServiceName' => search_service_name,'subscriptionId' => @client.subscription_id},
110
139
  query_params: {'api-version' => @client.api_version},
111
140
  body: request_content,
112
141
  headers: request_headers.merge(custom_headers || {}),
@@ -128,7 +157,7 @@ module Azure::ARM::Search
128
157
  if status_code == 200
129
158
  begin
130
159
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
131
- result_mapper = SearchServiceResource.mapper()
160
+ result_mapper = SearchService.mapper()
132
161
  result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
133
162
  rescue Exception => e
134
163
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -138,7 +167,118 @@ module Azure::ARM::Search
138
167
  if status_code == 201
139
168
  begin
140
169
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
141
- result_mapper = SearchServiceResource.mapper()
170
+ result_mapper = SearchService.mapper()
171
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
172
+ rescue Exception => e
173
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
174
+ end
175
+ end
176
+
177
+ result
178
+ end
179
+
180
+ promise.execute
181
+ end
182
+
183
+ #
184
+ # Gets the Search service with the given name in the given resource group.
185
+ #
186
+ # @param resource_group_name [String] The name of the resource group within the
187
+ # current subscription. You can obtain this value from the Azure Resource
188
+ # Manager API or the portal.
189
+ # @param search_service_name [String] The name of the Azure Search service
190
+ # associated with the specified resource group.
191
+ # @param search_management_request_options [SearchManagementRequestOptions]
192
+ # Additional parameters for the operation
193
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
194
+ # will be added to the HTTP request.
195
+ #
196
+ # @return [SearchService] operation results.
197
+ #
198
+ def get(resource_group_name, search_service_name, search_management_request_options = nil, custom_headers = nil)
199
+ response = get_async(resource_group_name, search_service_name, search_management_request_options, custom_headers).value!
200
+ response.body unless response.nil?
201
+ end
202
+
203
+ #
204
+ # Gets the Search service with the given name in the given resource group.
205
+ #
206
+ # @param resource_group_name [String] The name of the resource group within the
207
+ # current subscription. You can obtain this value from the Azure Resource
208
+ # Manager API or the portal.
209
+ # @param search_service_name [String] The name of the Azure Search service
210
+ # associated with the specified resource group.
211
+ # @param search_management_request_options [SearchManagementRequestOptions]
212
+ # Additional parameters for the operation
213
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
214
+ # will be added to the HTTP request.
215
+ #
216
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
217
+ #
218
+ def get_with_http_info(resource_group_name, search_service_name, search_management_request_options = nil, custom_headers = nil)
219
+ get_async(resource_group_name, search_service_name, search_management_request_options, custom_headers).value!
220
+ end
221
+
222
+ #
223
+ # Gets the Search service with the given name in the given resource group.
224
+ #
225
+ # @param resource_group_name [String] The name of the resource group within the
226
+ # current subscription. You can obtain this value from the Azure Resource
227
+ # Manager API or the portal.
228
+ # @param search_service_name [String] The name of the Azure Search service
229
+ # associated with the specified resource group.
230
+ # @param search_management_request_options [SearchManagementRequestOptions]
231
+ # Additional parameters for the operation
232
+ # @param [Hash{String => String}] A hash of custom headers that will be added
233
+ # to the HTTP request.
234
+ #
235
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
236
+ #
237
+ def get_async(resource_group_name, search_service_name, search_management_request_options = nil, custom_headers = nil)
238
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
239
+ fail ArgumentError, 'search_service_name is nil' if search_service_name.nil?
240
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
241
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
242
+
243
+ client_request_id = nil
244
+ unless search_management_request_options.nil?
245
+ client_request_id = search_management_request_options.clientRequestId
246
+ end
247
+
248
+ request_headers = {}
249
+
250
+ # Set Headers
251
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
252
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
253
+ request_headers['x-ms-client-request-id'] = client_request_id.to_s unless client_request_id.to_s.nil?
254
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}'
255
+
256
+ request_url = @base_url || @client.base_url
257
+
258
+ options = {
259
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
260
+ path_params: {'resourceGroupName' => resource_group_name,'searchServiceName' => search_service_name,'subscriptionId' => @client.subscription_id},
261
+ query_params: {'api-version' => @client.api_version},
262
+ headers: request_headers.merge(custom_headers || {}),
263
+ base_url: request_url
264
+ }
265
+ promise = @client.make_request_async(:get, path_template, options)
266
+
267
+ promise = promise.then do |result|
268
+ http_response = result.response
269
+ status_code = http_response.status
270
+ response_content = http_response.body
271
+ unless status_code == 200
272
+ error_model = JSON.load(response_content)
273
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
274
+ end
275
+
276
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
277
+ # Deserialize Response
278
+ if status_code == 200
279
+ begin
280
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
281
+ result_mapper = SearchService.mapper()
142
282
  result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
143
283
  rescue Exception => e
144
284
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -155,15 +295,19 @@ module Azure::ARM::Search
155
295
  # Deletes a Search service in the given resource group, along with its
156
296
  # associated resources.
157
297
  #
158
- # @param resource_group_name [String] The name of the resource group within
159
- # the current subscription.
160
- # @param service_name [String] The name of the Search service to delete.
298
+ # @param resource_group_name [String] The name of the resource group within the
299
+ # current subscription. You can obtain this value from the Azure Resource
300
+ # Manager API or the portal.
301
+ # @param search_service_name [String] The name of the Azure Search service
302
+ # associated with the specified resource group.
303
+ # @param search_management_request_options [SearchManagementRequestOptions]
304
+ # Additional parameters for the operation
161
305
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
162
306
  # will be added to the HTTP request.
163
307
  #
164
308
  #
165
- def delete(resource_group_name, service_name, custom_headers = nil)
166
- response = delete_async(resource_group_name, service_name, custom_headers).value!
309
+ def delete(resource_group_name, search_service_name, search_management_request_options = nil, custom_headers = nil)
310
+ response = delete_async(resource_group_name, search_service_name, search_management_request_options, custom_headers).value!
167
311
  nil
168
312
  end
169
313
 
@@ -171,49 +315,62 @@ module Azure::ARM::Search
171
315
  # Deletes a Search service in the given resource group, along with its
172
316
  # associated resources.
173
317
  #
174
- # @param resource_group_name [String] The name of the resource group within
175
- # the current subscription.
176
- # @param service_name [String] The name of the Search service to delete.
318
+ # @param resource_group_name [String] The name of the resource group within the
319
+ # current subscription. You can obtain this value from the Azure Resource
320
+ # Manager API or the portal.
321
+ # @param search_service_name [String] The name of the Azure Search service
322
+ # associated with the specified resource group.
323
+ # @param search_management_request_options [SearchManagementRequestOptions]
324
+ # Additional parameters for the operation
177
325
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
178
326
  # will be added to the HTTP request.
179
327
  #
180
328
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
181
329
  #
182
- def delete_with_http_info(resource_group_name, service_name, custom_headers = nil)
183
- delete_async(resource_group_name, service_name, custom_headers).value!
330
+ def delete_with_http_info(resource_group_name, search_service_name, search_management_request_options = nil, custom_headers = nil)
331
+ delete_async(resource_group_name, search_service_name, search_management_request_options, custom_headers).value!
184
332
  end
185
333
 
186
334
  #
187
335
  # Deletes a Search service in the given resource group, along with its
188
336
  # associated resources.
189
337
  #
190
- # @param resource_group_name [String] The name of the resource group within
191
- # the current subscription.
192
- # @param service_name [String] The name of the Search service to delete.
338
+ # @param resource_group_name [String] The name of the resource group within the
339
+ # current subscription. You can obtain this value from the Azure Resource
340
+ # Manager API or the portal.
341
+ # @param search_service_name [String] The name of the Azure Search service
342
+ # associated with the specified resource group.
343
+ # @param search_management_request_options [SearchManagementRequestOptions]
344
+ # Additional parameters for the operation
193
345
  # @param [Hash{String => String}] A hash of custom headers that will be added
194
346
  # to the HTTP request.
195
347
  #
196
348
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
197
349
  #
198
- def delete_async(resource_group_name, service_name, custom_headers = nil)
350
+ def delete_async(resource_group_name, search_service_name, search_management_request_options = nil, custom_headers = nil)
199
351
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
200
- fail ArgumentError, 'service_name is nil' if service_name.nil?
352
+ fail ArgumentError, 'search_service_name is nil' if search_service_name.nil?
201
353
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
202
354
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
203
355
 
356
+ client_request_id = nil
357
+ unless search_management_request_options.nil?
358
+ client_request_id = search_management_request_options.clientRequestId
359
+ end
204
360
 
205
361
  request_headers = {}
206
362
 
207
363
  # Set Headers
208
364
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
209
365
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
210
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{serviceName}'
366
+ request_headers['x-ms-client-request-id'] = client_request_id.to_s unless client_request_id.to_s.nil?
367
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}'
211
368
 
212
369
  request_url = @base_url || @client.base_url
213
370
 
214
371
  options = {
215
372
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
216
- path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'subscriptionId' => @client.subscription_id},
373
+ path_params: {'resourceGroupName' => resource_group_name,'searchServiceName' => search_service_name,'subscriptionId' => @client.subscription_id},
217
374
  query_params: {'api-version' => @client.api_version},
218
375
  headers: request_headers.merge(custom_headers || {}),
219
376
  base_url: request_url
@@ -224,7 +381,7 @@ module Azure::ARM::Search
224
381
  http_response = result.response
225
382
  status_code = http_response.status
226
383
  response_content = http_response.body
227
- unless status_code == 200 || status_code == 404 || status_code == 204
384
+ unless status_code == 200 || status_code == 204 || status_code == 404
228
385
  error_model = JSON.load(response_content)
229
386
  fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
230
387
  end
@@ -238,55 +395,69 @@ module Azure::ARM::Search
238
395
  end
239
396
 
240
397
  #
241
- # Returns a list of all Search services in the given resource group.
398
+ # Gets a list of all Search services in the given resource group.
242
399
  #
243
- # @param resource_group_name [String] The name of the resource group within
244
- # the current subscription.
400
+ # @param resource_group_name [String] The name of the resource group within the
401
+ # current subscription. You can obtain this value from the Azure Resource
402
+ # Manager API or the portal.
403
+ # @param search_management_request_options [SearchManagementRequestOptions]
404
+ # Additional parameters for the operation
245
405
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
246
406
  # will be added to the HTTP request.
247
407
  #
248
408
  # @return [SearchServiceListResult] operation results.
249
409
  #
250
- def list(resource_group_name, custom_headers = nil)
251
- response = list_async(resource_group_name, custom_headers).value!
410
+ def list_by_resource_group(resource_group_name, search_management_request_options = nil, custom_headers = nil)
411
+ response = list_by_resource_group_async(resource_group_name, search_management_request_options, custom_headers).value!
252
412
  response.body unless response.nil?
253
413
  end
254
414
 
255
415
  #
256
- # Returns a list of all Search services in the given resource group.
416
+ # Gets a list of all Search services in the given resource group.
257
417
  #
258
- # @param resource_group_name [String] The name of the resource group within
259
- # the current subscription.
418
+ # @param resource_group_name [String] The name of the resource group within the
419
+ # current subscription. You can obtain this value from the Azure Resource
420
+ # Manager API or the portal.
421
+ # @param search_management_request_options [SearchManagementRequestOptions]
422
+ # Additional parameters for the operation
260
423
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
261
424
  # will be added to the HTTP request.
262
425
  #
263
426
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
264
427
  #
265
- def list_with_http_info(resource_group_name, custom_headers = nil)
266
- list_async(resource_group_name, custom_headers).value!
428
+ def list_by_resource_group_with_http_info(resource_group_name, search_management_request_options = nil, custom_headers = nil)
429
+ list_by_resource_group_async(resource_group_name, search_management_request_options, custom_headers).value!
267
430
  end
268
431
 
269
432
  #
270
- # Returns a list of all Search services in the given resource group.
433
+ # Gets a list of all Search services in the given resource group.
271
434
  #
272
- # @param resource_group_name [String] The name of the resource group within
273
- # the current subscription.
435
+ # @param resource_group_name [String] The name of the resource group within the
436
+ # current subscription. You can obtain this value from the Azure Resource
437
+ # Manager API or the portal.
438
+ # @param search_management_request_options [SearchManagementRequestOptions]
439
+ # Additional parameters for the operation
274
440
  # @param [Hash{String => String}] A hash of custom headers that will be added
275
441
  # to the HTTP request.
276
442
  #
277
443
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
278
444
  #
279
- def list_async(resource_group_name, custom_headers = nil)
445
+ def list_by_resource_group_async(resource_group_name, search_management_request_options = nil, custom_headers = nil)
280
446
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
281
447
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
282
448
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
283
449
 
450
+ client_request_id = nil
451
+ unless search_management_request_options.nil?
452
+ client_request_id = search_management_request_options.clientRequestId
453
+ end
284
454
 
285
455
  request_headers = {}
286
456
 
287
457
  # Set Headers
288
458
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
289
459
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
460
+ request_headers['x-ms-client-request-id'] = client_request_id.to_s unless client_request_id.to_s.nil?
290
461
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices'
291
462
 
292
463
  request_url = @base_url || @client.base_url
@@ -327,5 +498,131 @@ module Azure::ARM::Search
327
498
  promise.execute
328
499
  end
329
500
 
501
+ #
502
+ # Checks whether or not the given Search service name is available for use.
503
+ # Search service names must be globally unique since they are part of the
504
+ # service URI (https://<name>.search.windows.net).
505
+ #
506
+ # @param name [String] The Search service name to validate. Search service
507
+ # names must only contain lowercase letters, digits or dashes, cannot use dash
508
+ # as the first two or last one characters, cannot contain consecutive dashes,
509
+ # and must be between 2 and 60 characters in length.
510
+ # @param search_management_request_options [SearchManagementRequestOptions]
511
+ # Additional parameters for the operation
512
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
513
+ # will be added to the HTTP request.
514
+ #
515
+ # @return [CheckNameAvailabilityOutput] operation results.
516
+ #
517
+ def check_name_availability(name, search_management_request_options = nil, custom_headers = nil)
518
+ response = check_name_availability_async(name, search_management_request_options, custom_headers).value!
519
+ response.body unless response.nil?
520
+ end
521
+
522
+ #
523
+ # Checks whether or not the given Search service name is available for use.
524
+ # Search service names must be globally unique since they are part of the
525
+ # service URI (https://<name>.search.windows.net).
526
+ #
527
+ # @param name [String] The Search service name to validate. Search service
528
+ # names must only contain lowercase letters, digits or dashes, cannot use dash
529
+ # as the first two or last one characters, cannot contain consecutive dashes,
530
+ # and must be between 2 and 60 characters in length.
531
+ # @param search_management_request_options [SearchManagementRequestOptions]
532
+ # Additional parameters for the operation
533
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
534
+ # will be added to the HTTP request.
535
+ #
536
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
537
+ #
538
+ def check_name_availability_with_http_info(name, search_management_request_options = nil, custom_headers = nil)
539
+ check_name_availability_async(name, search_management_request_options, custom_headers).value!
540
+ end
541
+
542
+ #
543
+ # Checks whether or not the given Search service name is available for use.
544
+ # Search service names must be globally unique since they are part of the
545
+ # service URI (https://<name>.search.windows.net).
546
+ #
547
+ # @param name [String] The Search service name to validate. Search service
548
+ # names must only contain lowercase letters, digits or dashes, cannot use dash
549
+ # as the first two or last one characters, cannot contain consecutive dashes,
550
+ # and must be between 2 and 60 characters in length.
551
+ # @param search_management_request_options [SearchManagementRequestOptions]
552
+ # Additional parameters for the operation
553
+ # @param [Hash{String => String}] A hash of custom headers that will be added
554
+ # to the HTTP request.
555
+ #
556
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
557
+ #
558
+ def check_name_availability_async(name, search_management_request_options = nil, custom_headers = nil)
559
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
560
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
561
+ fail ArgumentError, 'name is nil' if name.nil?
562
+
563
+ client_request_id = nil
564
+ check_name_availability_input = CheckNameAvailabilityInput.new
565
+ unless search_management_request_options.nil?
566
+ client_request_id = search_management_request_options.clientRequestId
567
+ end
568
+ unless name.nil?
569
+ check_name_availability_input.name = name
570
+ end
571
+
572
+ request_headers = {}
573
+
574
+ # Set Headers
575
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
576
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
577
+ request_headers['x-ms-client-request-id'] = client_request_id.to_s unless client_request_id.to_s.nil?
578
+
579
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
580
+
581
+ # Serialize Request
582
+ request_mapper = CheckNameAvailabilityInput.mapper()
583
+ request_content = @client.serialize(request_mapper, check_name_availability_input, 'check_name_availability_input')
584
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
585
+
586
+ path_template = '/subscriptions/{subscriptionId}/providers/Microsoft.Search/checkNameAvailability'
587
+
588
+ request_url = @base_url || @client.base_url
589
+
590
+ options = {
591
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
592
+ path_params: {'subscriptionId' => @client.subscription_id},
593
+ query_params: {'api-version' => @client.api_version},
594
+ body: request_content,
595
+ headers: request_headers.merge(custom_headers || {}),
596
+ base_url: request_url
597
+ }
598
+ promise = @client.make_request_async(:post, path_template, options)
599
+
600
+ promise = promise.then do |result|
601
+ http_response = result.response
602
+ status_code = http_response.status
603
+ response_content = http_response.body
604
+ unless status_code == 200
605
+ error_model = JSON.load(response_content)
606
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
607
+ end
608
+
609
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
610
+ # Deserialize Response
611
+ if status_code == 200
612
+ begin
613
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
614
+ result_mapper = CheckNameAvailabilityOutput.mapper()
615
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
616
+ rescue Exception => e
617
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
618
+ end
619
+ end
620
+
621
+ result
622
+ end
623
+
624
+ promise.execute
625
+ end
626
+
330
627
  end
331
628
  end