azure_mgmt_notification_hubs 0.7.0 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/lib/generated/azure_mgmt_notification_hubs.rb +17 -20
  3. data/lib/generated/azure_mgmt_notification_hubs/models/access_rights.rb +1 -1
  4. data/lib/generated/azure_mgmt_notification_hubs/models/adm_credential.rb +26 -8
  5. data/lib/generated/azure_mgmt_notification_hubs/models/apns_credential.rb +36 -8
  6. data/lib/generated/azure_mgmt_notification_hubs/models/baidu_credential.rb +26 -8
  7. data/lib/generated/azure_mgmt_notification_hubs/models/check_availability_parameters.rb +40 -7
  8. data/lib/generated/azure_mgmt_notification_hubs/models/{check_availability_resource.rb → check_availability_result.rb} +25 -29
  9. data/lib/generated/azure_mgmt_notification_hubs/models/gcm_credential.rb +16 -8
  10. data/lib/generated/azure_mgmt_notification_hubs/models/mpns_credential.rb +26 -8
  11. data/lib/generated/azure_mgmt_notification_hubs/models/namespace_create_or_update_parameters.rb +146 -12
  12. data/lib/generated/azure_mgmt_notification_hubs/models/namespace_list_result.rb +5 -5
  13. data/lib/generated/azure_mgmt_notification_hubs/models/namespace_patch_parameters.rb +62 -0
  14. data/lib/generated/azure_mgmt_notification_hubs/models/namespace_resource.rb +128 -24
  15. data/lib/generated/azure_mgmt_notification_hubs/models/namespace_type.rb +1 -1
  16. data/lib/generated/azure_mgmt_notification_hubs/models/notification_hub_create_or_update_parameters.rb +138 -13
  17. data/lib/generated/azure_mgmt_notification_hubs/models/notification_hub_list_result.rb +5 -5
  18. data/lib/generated/azure_mgmt_notification_hubs/models/notification_hub_resource.rb +120 -27
  19. data/lib/generated/azure_mgmt_notification_hubs/models/{notification_hub_properties.rb → pns_credentials_resource.rb} +45 -31
  20. data/lib/generated/azure_mgmt_notification_hubs/models/policykey_resource.rb +46 -0
  21. data/lib/generated/azure_mgmt_notification_hubs/models/resource_list_keys.rb +34 -5
  22. data/lib/generated/azure_mgmt_notification_hubs/models/shared_access_authorization_rule_create_or_update_parameters.rb +45 -12
  23. data/lib/generated/azure_mgmt_notification_hubs/models/shared_access_authorization_rule_list_result.rb +5 -5
  24. data/lib/generated/azure_mgmt_notification_hubs/models/shared_access_authorization_rule_properties.rb +1 -82
  25. data/lib/generated/azure_mgmt_notification_hubs/models/shared_access_authorization_rule_resource.rb +32 -34
  26. data/lib/generated/azure_mgmt_notification_hubs/models/sku.rb +85 -0
  27. data/lib/generated/azure_mgmt_notification_hubs/models/sku_name.rb +17 -0
  28. data/lib/generated/azure_mgmt_notification_hubs/models/wns_credential.rb +26 -8
  29. data/lib/generated/azure_mgmt_notification_hubs/module_definition.rb +1 -1
  30. data/lib/generated/azure_mgmt_notification_hubs/namespaces.rb +379 -243
  31. data/lib/generated/azure_mgmt_notification_hubs/notification_hubs.rb +192 -71
  32. data/lib/generated/azure_mgmt_notification_hubs/notification_hubs_management_client.rb +15 -2
  33. data/lib/generated/azure_mgmt_notification_hubs/version.rb +2 -2
  34. metadata +10 -13
  35. data/lib/generated/azure_mgmt_notification_hubs/models/adm_credential_properties.rb +0 -64
  36. data/lib/generated/azure_mgmt_notification_hubs/models/apns_credential_properties.rb +0 -74
  37. data/lib/generated/azure_mgmt_notification_hubs/models/baidu_credential_properties.rb +0 -64
  38. data/lib/generated/azure_mgmt_notification_hubs/models/gcm_credential_properties.rb +0 -54
  39. data/lib/generated/azure_mgmt_notification_hubs/models/mpns_credential_properties.rb +0 -64
  40. data/lib/generated/azure_mgmt_notification_hubs/models/namespace_properties.rb +0 -153
  41. data/lib/generated/azure_mgmt_notification_hubs/models/wns_credential_properties.rb +0 -64
@@ -0,0 +1,17 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::ARM::NotificationHubs
7
+ module Models
8
+ #
9
+ # Defines values for SkuName
10
+ #
11
+ module SkuName
12
+ Free = "Free"
13
+ Basic = "Basic"
14
+ Standard = "Standard"
15
+ end
16
+ end
17
+ 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
 
@@ -12,9 +12,14 @@ module Azure::ARM::NotificationHubs
12
12
 
13
13
  include MsRestAzure
14
14
 
15
- # @return [WnsCredentialProperties] Gets or sets properties of
16
- # NotificationHub WnsCredential.
17
- attr_accessor :properties
15
+ # @return [String] The package ID for this credential.
16
+ attr_accessor :package_sid
17
+
18
+ # @return [String] The secret key.
19
+ attr_accessor :secret_key
20
+
21
+ # @return [String] The Windows Live endpoint.
22
+ attr_accessor :windows_live_endpoint
18
23
 
19
24
 
20
25
  #
@@ -29,12 +34,25 @@ module Azure::ARM::NotificationHubs
29
34
  name: 'Composite',
30
35
  class_name: 'WnsCredential',
31
36
  model_properties: {
32
- properties: {
37
+ package_sid: {
38
+ required: false,
39
+ serialized_name: 'properties.packageSid',
40
+ type: {
41
+ name: 'String'
42
+ }
43
+ },
44
+ secret_key: {
45
+ required: false,
46
+ serialized_name: 'properties.secretKey',
47
+ type: {
48
+ name: 'String'
49
+ }
50
+ },
51
+ windows_live_endpoint: {
33
52
  required: false,
34
- serialized_name: 'properties',
53
+ serialized_name: 'properties.windowsLiveEndpoint',
35
54
  type: {
36
- name: 'Composite',
37
- class_name: 'WnsCredentialProperties'
55
+ name: 'String'
38
56
  }
39
57
  }
40
58
  }
@@ -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
 
@@ -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
 
@@ -23,15 +23,15 @@ module Azure::ARM::NotificationHubs
23
23
  attr_reader :client
24
24
 
25
25
  #
26
- # Checks the availability of the given service namespace across all Windows
27
- # Azure subscriptions. This is useful because the domain name is created
28
- # based on the service namespace name.
26
+ # Checks the availability of the given service namespace across all Azure
27
+ # subscriptions. This is useful because the domain name is created based on the
28
+ # service namespace name.
29
29
  #
30
30
  # @param parameters [CheckAvailabilityParameters] The namespace name.
31
31
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
32
32
  # will be added to the HTTP request.
33
33
  #
34
- # @return [CheckAvailabilityResource] operation results.
34
+ # @return [CheckAvailabilityResult] operation results.
35
35
  #
36
36
  def check_availability(parameters, custom_headers = nil)
37
37
  response = check_availability_async(parameters, custom_headers).value!
@@ -39,9 +39,9 @@ module Azure::ARM::NotificationHubs
39
39
  end
40
40
 
41
41
  #
42
- # Checks the availability of the given service namespace across all Windows
43
- # Azure subscriptions. This is useful because the domain name is created
44
- # based on the service namespace name.
42
+ # Checks the availability of the given service namespace across all Azure
43
+ # subscriptions. This is useful because the domain name is created based on the
44
+ # service namespace name.
45
45
  #
46
46
  # @param parameters [CheckAvailabilityParameters] The namespace name.
47
47
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
@@ -54,9 +54,9 @@ module Azure::ARM::NotificationHubs
54
54
  end
55
55
 
56
56
  #
57
- # Checks the availability of the given service namespace across all Windows
58
- # Azure subscriptions. This is useful because the domain name is created
59
- # based on the service namespace name.
57
+ # Checks the availability of the given service namespace across all Azure
58
+ # subscriptions. This is useful because the domain name is created based on the
59
+ # service namespace name.
60
60
  #
61
61
  # @param parameters [CheckAvailabilityParameters] The namespace name.
62
62
  # @param [Hash{String => String}] A hash of custom headers that will be added
@@ -111,7 +111,7 @@ module Azure::ARM::NotificationHubs
111
111
  if status_code == 200
112
112
  begin
113
113
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
114
- result_mapper = CheckAvailabilityResource.mapper()
114
+ result_mapper = CheckAvailabilityResult.mapper()
115
115
  result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
116
116
  rescue Exception => e
117
117
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -245,88 +245,54 @@ module Azure::ARM::NotificationHubs
245
245
  end
246
246
 
247
247
  #
248
- # Deletes an existing namespace. This operation also removes all associated
249
- # notificationHubs under the namespace.
250
- #
251
- # @param resource_group_name [String] The name of the resource group.
252
- # @param namespace_name [String] The namespace name.
253
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
254
- # will be added to the HTTP request.
255
- #
256
- def delete(resource_group_name, namespace_name, custom_headers = nil)
257
- response = delete_async(resource_group_name, namespace_name, custom_headers).value!
258
- nil
259
- end
260
-
261
- #
262
- # @param resource_group_name [String] The name of the resource group.
263
- # @param namespace_name [String] The namespace name.
264
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
265
- # will be added to the HTTP request.
266
- #
267
- # @return [Concurrent::Promise] promise which provides async access to http
268
- # response.
269
- #
270
- def delete_async(resource_group_name, namespace_name, custom_headers = nil)
271
- # Send request
272
- promise = begin_delete_async(resource_group_name, namespace_name, custom_headers)
273
-
274
- promise = promise.then do |response|
275
- # Defining deserialization method.
276
- deserialize_method = lambda do |parsed_response|
277
- end
278
-
279
- # Waiting for response.
280
- @client.get_long_running_operation_result(response, deserialize_method)
281
- end
282
-
283
- promise
284
- end
285
-
286
- #
287
- # Deletes an existing namespace. This operation also removes all associated
288
- # notificationHubs under the namespace.
248
+ # Patches the existing namespace
289
249
  #
290
250
  # @param resource_group_name [String] The name of the resource group.
291
251
  # @param namespace_name [String] The namespace name.
252
+ # @param parameters [NamespacePatchParameters] Parameters supplied to patch a
253
+ # Namespace Resource.
292
254
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
293
255
  # will be added to the HTTP request.
294
256
  #
257
+ # @return [NamespaceResource] operation results.
295
258
  #
296
- def begin_delete(resource_group_name, namespace_name, custom_headers = nil)
297
- response = begin_delete_async(resource_group_name, namespace_name, custom_headers).value!
298
- nil
259
+ def patch(resource_group_name, namespace_name, parameters, custom_headers = nil)
260
+ response = patch_async(resource_group_name, namespace_name, parameters, custom_headers).value!
261
+ response.body unless response.nil?
299
262
  end
300
263
 
301
264
  #
302
- # Deletes an existing namespace. This operation also removes all associated
303
- # notificationHubs under the namespace.
265
+ # Patches the existing namespace
304
266
  #
305
267
  # @param resource_group_name [String] The name of the resource group.
306
268
  # @param namespace_name [String] The namespace name.
269
+ # @param parameters [NamespacePatchParameters] Parameters supplied to patch a
270
+ # Namespace Resource.
307
271
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
308
272
  # will be added to the HTTP request.
309
273
  #
310
274
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
311
275
  #
312
- def begin_delete_with_http_info(resource_group_name, namespace_name, custom_headers = nil)
313
- begin_delete_async(resource_group_name, namespace_name, custom_headers).value!
276
+ def patch_with_http_info(resource_group_name, namespace_name, parameters, custom_headers = nil)
277
+ patch_async(resource_group_name, namespace_name, parameters, custom_headers).value!
314
278
  end
315
279
 
316
280
  #
317
- # Deletes an existing namespace. This operation also removes all associated
318
- # notificationHubs under the namespace.
281
+ # Patches the existing namespace
319
282
  #
320
283
  # @param resource_group_name [String] The name of the resource group.
321
284
  # @param namespace_name [String] The namespace name.
285
+ # @param parameters [NamespacePatchParameters] Parameters supplied to patch a
286
+ # Namespace Resource.
322
287
  # @param [Hash{String => String}] A hash of custom headers that will be added
323
288
  # to the HTTP request.
324
289
  #
325
290
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
326
291
  #
327
- def begin_delete_async(resource_group_name, namespace_name, custom_headers = nil)
292
+ def patch_async(resource_group_name, namespace_name, parameters, custom_headers = nil)
328
293
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
329
294
  fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
295
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
330
296
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
331
297
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
332
298
 
@@ -336,6 +302,14 @@ module Azure::ARM::NotificationHubs
336
302
  # Set Headers
337
303
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
338
304
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
305
+
306
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
307
+
308
+ # Serialize Request
309
+ request_mapper = NamespacePatchParameters.mapper()
310
+ request_content = @client.serialize(request_mapper, parameters, 'parameters')
311
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
312
+
339
313
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}'
340
314
 
341
315
  request_url = @base_url || @client.base_url
@@ -344,21 +318,32 @@ module Azure::ARM::NotificationHubs
344
318
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
345
319
  path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'subscriptionId' => @client.subscription_id},
346
320
  query_params: {'api-version' => @client.api_version},
321
+ body: request_content,
347
322
  headers: request_headers.merge(custom_headers || {}),
348
323
  base_url: request_url
349
324
  }
350
- promise = @client.make_request_async(:delete, path_template, options)
325
+ promise = @client.make_request_async(:patch, path_template, options)
351
326
 
352
327
  promise = promise.then do |result|
353
328
  http_response = result.response
354
329
  status_code = http_response.status
355
330
  response_content = http_response.body
356
- unless status_code == 204 || status_code == 200 || status_code == 202
331
+ unless status_code == 200
357
332
  error_model = JSON.load(response_content)
358
333
  fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
359
334
  end
360
335
 
361
336
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
337
+ # Deserialize Response
338
+ if status_code == 200
339
+ begin
340
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
341
+ result_mapper = NamespaceResource.mapper()
342
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
343
+ rescue Exception => e
344
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
345
+ end
346
+ end
362
347
 
363
348
  result
364
349
  end
@@ -366,6 +351,45 @@ module Azure::ARM::NotificationHubs
366
351
  promise.execute
367
352
  end
368
353
 
354
+ #
355
+ # Deletes an existing namespace. This operation also removes all associated
356
+ # notificationHubs under the namespace.
357
+ #
358
+ # @param resource_group_name [String] The name of the resource group.
359
+ # @param namespace_name [String] The namespace name.
360
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
361
+ # will be added to the HTTP request.
362
+ #
363
+ def delete(resource_group_name, namespace_name, custom_headers = nil)
364
+ response = delete_async(resource_group_name, namespace_name, custom_headers).value!
365
+ nil
366
+ end
367
+
368
+ #
369
+ # @param resource_group_name [String] The name of the resource group.
370
+ # @param namespace_name [String] The namespace name.
371
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
372
+ # will be added to the HTTP request.
373
+ #
374
+ # @return [Concurrent::Promise] promise which provides async access to http
375
+ # response.
376
+ #
377
+ def delete_async(resource_group_name, namespace_name, custom_headers = nil)
378
+ # Send request
379
+ promise = begin_delete_async(resource_group_name, namespace_name, custom_headers)
380
+
381
+ promise = promise.then do |response|
382
+ # Defining deserialization method.
383
+ deserialize_method = lambda do |parsed_response|
384
+ end
385
+
386
+ # Waiting for response.
387
+ @client.get_long_running_operation_result(response, deserialize_method)
388
+ end
389
+
390
+ promise
391
+ end
392
+
369
393
  #
370
394
  # Returns the description for the specified namespace.
371
395
  #
@@ -463,8 +487,8 @@ module Azure::ARM::NotificationHubs
463
487
  # @param resource_group_name [String] The name of the resource group.
464
488
  # @param namespace_name [String] The namespace name.
465
489
  # @param authorization_rule_name [String] Aauthorization Rule Name.
466
- # @param parameters [SharedAccessAuthorizationRuleCreateOrUpdateParameters]
467
- # The shared access authorization rule.
490
+ # @param parameters [SharedAccessAuthorizationRuleCreateOrUpdateParameters] The
491
+ # shared access authorization rule.
468
492
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
469
493
  # will be added to the HTTP request.
470
494
  #
@@ -481,8 +505,8 @@ module Azure::ARM::NotificationHubs
481
505
  # @param resource_group_name [String] The name of the resource group.
482
506
  # @param namespace_name [String] The namespace name.
483
507
  # @param authorization_rule_name [String] Aauthorization Rule Name.
484
- # @param parameters [SharedAccessAuthorizationRuleCreateOrUpdateParameters]
485
- # The shared access authorization rule.
508
+ # @param parameters [SharedAccessAuthorizationRuleCreateOrUpdateParameters] The
509
+ # shared access authorization rule.
486
510
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
487
511
  # will be added to the HTTP request.
488
512
  #
@@ -498,8 +522,8 @@ module Azure::ARM::NotificationHubs
498
522
  # @param resource_group_name [String] The name of the resource group.
499
523
  # @param namespace_name [String] The namespace name.
500
524
  # @param authorization_rule_name [String] Aauthorization Rule Name.
501
- # @param parameters [SharedAccessAuthorizationRuleCreateOrUpdateParameters]
502
- # The shared access authorization rule.
525
+ # @param parameters [SharedAccessAuthorizationRuleCreateOrUpdateParameters] The
526
+ # shared access authorization rule.
503
527
  # @param [Hash{String => String}] A hash of custom headers that will be added
504
528
  # to the HTTP request.
505
529
  #
@@ -718,7 +742,7 @@ module Azure::ARM::NotificationHubs
718
742
  headers: request_headers.merge(custom_headers || {}),
719
743
  base_url: request_url
720
744
  }
721
- promise = @client.make_request_async(:post, path_template, options)
745
+ promise = @client.make_request_async(:get, path_template, options)
722
746
 
723
747
  promise = promise.then do |result|
724
748
  http_response = result.response
@@ -747,114 +771,6 @@ module Azure::ARM::NotificationHubs
747
771
  promise.execute
748
772
  end
749
773
 
750
- #
751
- # The Get Operation Status operation returns the status of the specified
752
- # operation. After calling an asynchronous operation, you can call Get
753
- # Operation Status to determine whether the operation has succeeded, failed,
754
- # or is still in progress.
755
- #
756
- # @param operation_status_link [String] Location value returned by the Begin
757
- # operation.
758
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
759
- # will be added to the HTTP request.
760
- #
761
- #
762
- def get_long_running_operation_status(operation_status_link, custom_headers = nil)
763
- response = get_long_running_operation_status_async(operation_status_link, custom_headers).value!
764
- nil
765
- end
766
-
767
- #
768
- # The Get Operation Status operation returns the status of the specified
769
- # operation. After calling an asynchronous operation, you can call Get
770
- # Operation Status to determine whether the operation has succeeded, failed,
771
- # or is still in progress.
772
- #
773
- # @param operation_status_link [String] Location value returned by the Begin
774
- # operation.
775
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
776
- # will be added to the HTTP request.
777
- #
778
- # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
779
- #
780
- def get_long_running_operation_status_with_http_info(operation_status_link, custom_headers = nil)
781
- get_long_running_operation_status_async(operation_status_link, custom_headers).value!
782
- end
783
-
784
- #
785
- # The Get Operation Status operation returns the status of the specified
786
- # operation. After calling an asynchronous operation, you can call Get
787
- # Operation Status to determine whether the operation has succeeded, failed,
788
- # or is still in progress.
789
- #
790
- # @param operation_status_link [String] Location value returned by the Begin
791
- # operation.
792
- # @param [Hash{String => String}] A hash of custom headers that will be added
793
- # to the HTTP request.
794
- #
795
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
796
- #
797
- def get_long_running_operation_status_async(operation_status_link, custom_headers = nil)
798
- fail ArgumentError, 'operation_status_link is nil' if operation_status_link.nil?
799
-
800
-
801
- request_headers = {}
802
-
803
- # Set Headers
804
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
805
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
806
- path_template = '/{operationStatusLink}'
807
-
808
- request_url = @base_url || @client.base_url
809
-
810
- options = {
811
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
812
- skip_encoding_path_params: {'operationStatusLink' => operation_status_link},
813
- headers: request_headers.merge(custom_headers || {}),
814
- base_url: request_url
815
- }
816
- promise = @client.make_request_async(:get, path_template, options)
817
-
818
- promise = promise.then do |result|
819
- http_response = result.response
820
- status_code = http_response.status
821
- response_content = http_response.body
822
- unless status_code == 404 || status_code == 202 || status_code == 200
823
- error_model = JSON.load(response_content)
824
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
825
- end
826
-
827
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
828
-
829
- result
830
- end
831
-
832
- promise.execute
833
- end
834
-
835
- #
836
- # Lists the available namespaces within a resourceGroup.
837
- #
838
- # @param resource_group_name [String] The name of the resource group. If
839
- # resourceGroupName value is null the method lists all the namespaces within
840
- # subscription
841
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
842
- # will be added to the HTTP request.
843
- #
844
- # @return [NamespaceListResult] which provide lazy access to pages of the
845
- # response.
846
- #
847
- def list_as_lazy(resource_group_name, custom_headers = nil)
848
- response = list_async(resource_group_name, custom_headers).value!
849
- unless response.nil?
850
- page = response.body
851
- page.next_method = Proc.new do |next_page_link|
852
- list_next_async(next_page_link, custom_headers)
853
- end
854
- page
855
- end
856
- end
857
-
858
774
  #
859
775
  # Lists the available namespaces within a resourceGroup.
860
776
  #
@@ -948,27 +864,6 @@ module Azure::ARM::NotificationHubs
948
864
  promise.execute
949
865
  end
950
866
 
951
- #
952
- # Lists all the available namespaces within the subscription irrespective of
953
- # the resourceGroups.
954
- #
955
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
956
- # will be added to the HTTP request.
957
- #
958
- # @return [NamespaceListResult] which provide lazy access to pages of the
959
- # response.
960
- #
961
- def list_all_as_lazy(custom_headers = nil)
962
- response = list_all_async(custom_headers).value!
963
- unless response.nil?
964
- page = response.body
965
- page.next_method = Proc.new do |next_page_link|
966
- list_all_next_async(next_page_link, custom_headers)
967
- end
968
- page
969
- end
970
- end
971
-
972
867
  #
973
868
  # Lists all the available namespaces within the subscription irrespective of
974
869
  # the resourceGroups.
@@ -1055,28 +950,6 @@ module Azure::ARM::NotificationHubs
1055
950
  promise.execute
1056
951
  end
1057
952
 
1058
- #
1059
- # Gets the authorization rules for a namespace.
1060
- #
1061
- # @param resource_group_name [String] The name of the resource group.
1062
- # @param namespace_name [String] The namespace name
1063
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
1064
- # will be added to the HTTP request.
1065
- #
1066
- # @return [SharedAccessAuthorizationRuleListResult] which provide lazy access
1067
- # to pages of the response.
1068
- #
1069
- def list_authorization_rules_as_lazy(resource_group_name, namespace_name, custom_headers = nil)
1070
- response = list_authorization_rules_async(resource_group_name, namespace_name, custom_headers).value!
1071
- unless response.nil?
1072
- page = response.body
1073
- page.next_method = Proc.new do |next_page_link|
1074
- list_authorization_rules_next_async(next_page_link, custom_headers)
1075
- end
1076
- page
1077
- end
1078
- end
1079
-
1080
953
  #
1081
954
  # Gets the authorization rules for a namespace.
1082
955
  #
@@ -1139,7 +1012,7 @@ module Azure::ARM::NotificationHubs
1139
1012
  headers: request_headers.merge(custom_headers || {}),
1140
1013
  base_url: request_url
1141
1014
  }
1142
- promise = @client.make_request_async(:post, path_template, options)
1015
+ promise = @client.make_request_async(:get, path_template, options)
1143
1016
 
1144
1017
  promise = promise.then do |result|
1145
1018
  http_response = result.response
@@ -1266,11 +1139,208 @@ module Azure::ARM::NotificationHubs
1266
1139
  promise.execute
1267
1140
  end
1268
1141
 
1142
+ #
1143
+ # Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule
1144
+ #
1145
+ # @param resource_group_name [String] The name of the resource group.
1146
+ # @param namespace_name [String] The namespace name.
1147
+ # @param authorization_rule_name [String] The connection string of the
1148
+ # namespace for the specified authorizationRule.
1149
+ # @param parameters [PolicykeyResource] Parameters supplied to regenerate the
1150
+ # Namespace Authorization Rule Key.
1151
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1152
+ # will be added to the HTTP request.
1153
+ #
1154
+ # @return [ResourceListKeys] operation results.
1155
+ #
1156
+ def regenerate_keys(resource_group_name, namespace_name, authorization_rule_name, parameters, custom_headers = nil)
1157
+ response = regenerate_keys_async(resource_group_name, namespace_name, authorization_rule_name, parameters, custom_headers).value!
1158
+ response.body unless response.nil?
1159
+ end
1160
+
1161
+ #
1162
+ # Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule
1163
+ #
1164
+ # @param resource_group_name [String] The name of the resource group.
1165
+ # @param namespace_name [String] The namespace name.
1166
+ # @param authorization_rule_name [String] The connection string of the
1167
+ # namespace for the specified authorizationRule.
1168
+ # @param parameters [PolicykeyResource] Parameters supplied to regenerate the
1169
+ # Namespace Authorization Rule Key.
1170
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1171
+ # will be added to the HTTP request.
1172
+ #
1173
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1174
+ #
1175
+ def regenerate_keys_with_http_info(resource_group_name, namespace_name, authorization_rule_name, parameters, custom_headers = nil)
1176
+ regenerate_keys_async(resource_group_name, namespace_name, authorization_rule_name, parameters, custom_headers).value!
1177
+ end
1178
+
1179
+ #
1180
+ # Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule
1181
+ #
1182
+ # @param resource_group_name [String] The name of the resource group.
1183
+ # @param namespace_name [String] The namespace name.
1184
+ # @param authorization_rule_name [String] The connection string of the
1185
+ # namespace for the specified authorizationRule.
1186
+ # @param parameters [PolicykeyResource] Parameters supplied to regenerate the
1187
+ # Namespace Authorization Rule Key.
1188
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1189
+ # to the HTTP request.
1190
+ #
1191
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1192
+ #
1193
+ def regenerate_keys_async(resource_group_name, namespace_name, authorization_rule_name, parameters, custom_headers = nil)
1194
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1195
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
1196
+ fail ArgumentError, 'authorization_rule_name is nil' if authorization_rule_name.nil?
1197
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
1198
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1199
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1200
+
1201
+
1202
+ request_headers = {}
1203
+
1204
+ # Set Headers
1205
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1206
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1207
+
1208
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1209
+
1210
+ # Serialize Request
1211
+ request_mapper = PolicykeyResource.mapper()
1212
+ request_content = @client.serialize(request_mapper, parameters, 'parameters')
1213
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1214
+
1215
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}/regenerateKeys'
1216
+
1217
+ request_url = @base_url || @client.base_url
1218
+
1219
+ options = {
1220
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1221
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'authorizationRuleName' => authorization_rule_name,'subscriptionId' => @client.subscription_id},
1222
+ query_params: {'api-version' => @client.api_version},
1223
+ body: request_content,
1224
+ headers: request_headers.merge(custom_headers || {}),
1225
+ base_url: request_url
1226
+ }
1227
+ promise = @client.make_request_async(:post, path_template, options)
1228
+
1229
+ promise = promise.then do |result|
1230
+ http_response = result.response
1231
+ status_code = http_response.status
1232
+ response_content = http_response.body
1233
+ unless status_code == 200
1234
+ error_model = JSON.load(response_content)
1235
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1236
+ end
1237
+
1238
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1239
+ # Deserialize Response
1240
+ if status_code == 200
1241
+ begin
1242
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1243
+ result_mapper = ResourceListKeys.mapper()
1244
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
1245
+ rescue Exception => e
1246
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1247
+ end
1248
+ end
1249
+
1250
+ result
1251
+ end
1252
+
1253
+ promise.execute
1254
+ end
1255
+
1256
+ #
1257
+ # Deletes an existing namespace. This operation also removes all associated
1258
+ # notificationHubs under the namespace.
1259
+ #
1260
+ # @param resource_group_name [String] The name of the resource group.
1261
+ # @param namespace_name [String] The namespace name.
1262
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1263
+ # will be added to the HTTP request.
1264
+ #
1265
+ #
1266
+ def begin_delete(resource_group_name, namespace_name, custom_headers = nil)
1267
+ response = begin_delete_async(resource_group_name, namespace_name, custom_headers).value!
1268
+ nil
1269
+ end
1270
+
1271
+ #
1272
+ # Deletes an existing namespace. This operation also removes all associated
1273
+ # notificationHubs under the namespace.
1274
+ #
1275
+ # @param resource_group_name [String] The name of the resource group.
1276
+ # @param namespace_name [String] The namespace name.
1277
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1278
+ # will be added to the HTTP request.
1279
+ #
1280
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1281
+ #
1282
+ def begin_delete_with_http_info(resource_group_name, namespace_name, custom_headers = nil)
1283
+ begin_delete_async(resource_group_name, namespace_name, custom_headers).value!
1284
+ end
1285
+
1286
+ #
1287
+ # Deletes an existing namespace. This operation also removes all associated
1288
+ # notificationHubs under the namespace.
1289
+ #
1290
+ # @param resource_group_name [String] The name of the resource group.
1291
+ # @param namespace_name [String] The namespace name.
1292
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1293
+ # to the HTTP request.
1294
+ #
1295
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1296
+ #
1297
+ def begin_delete_async(resource_group_name, namespace_name, custom_headers = nil)
1298
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1299
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
1300
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1301
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1302
+
1303
+
1304
+ request_headers = {}
1305
+
1306
+ # Set Headers
1307
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1308
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1309
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}'
1310
+
1311
+ request_url = @base_url || @client.base_url
1312
+
1313
+ options = {
1314
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1315
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'subscriptionId' => @client.subscription_id},
1316
+ query_params: {'api-version' => @client.api_version},
1317
+ headers: request_headers.merge(custom_headers || {}),
1318
+ base_url: request_url
1319
+ }
1320
+ promise = @client.make_request_async(:delete, path_template, options)
1321
+
1322
+ promise = promise.then do |result|
1323
+ http_response = result.response
1324
+ status_code = http_response.status
1325
+ response_content = http_response.body
1326
+ unless status_code == 204 || status_code == 200 || status_code == 202
1327
+ error_model = JSON.load(response_content)
1328
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1329
+ end
1330
+
1331
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1332
+
1333
+ result
1334
+ end
1335
+
1336
+ promise.execute
1337
+ end
1338
+
1269
1339
  #
1270
1340
  # Lists the available namespaces within a resourceGroup.
1271
1341
  #
1272
- # @param next_page_link [String] The NextLink from the previous successful
1273
- # call to List operation.
1342
+ # @param next_page_link [String] The NextLink from the previous successful call
1343
+ # to List operation.
1274
1344
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1275
1345
  # will be added to the HTTP request.
1276
1346
  #
@@ -1284,8 +1354,8 @@ module Azure::ARM::NotificationHubs
1284
1354
  #
1285
1355
  # Lists the available namespaces within a resourceGroup.
1286
1356
  #
1287
- # @param next_page_link [String] The NextLink from the previous successful
1288
- # call to List operation.
1357
+ # @param next_page_link [String] The NextLink from the previous successful call
1358
+ # to List operation.
1289
1359
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1290
1360
  # will be added to the HTTP request.
1291
1361
  #
@@ -1298,8 +1368,8 @@ module Azure::ARM::NotificationHubs
1298
1368
  #
1299
1369
  # Lists the available namespaces within a resourceGroup.
1300
1370
  #
1301
- # @param next_page_link [String] The NextLink from the previous successful
1302
- # call to List operation.
1371
+ # @param next_page_link [String] The NextLink from the previous successful call
1372
+ # to List operation.
1303
1373
  # @param [Hash{String => String}] A hash of custom headers that will be added
1304
1374
  # to the HTTP request.
1305
1375
  #
@@ -1357,8 +1427,8 @@ module Azure::ARM::NotificationHubs
1357
1427
  # Lists all the available namespaces within the subscription irrespective of
1358
1428
  # the resourceGroups.
1359
1429
  #
1360
- # @param next_page_link [String] The NextLink from the previous successful
1361
- # call to List operation.
1430
+ # @param next_page_link [String] The NextLink from the previous successful call
1431
+ # to List operation.
1362
1432
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1363
1433
  # will be added to the HTTP request.
1364
1434
  #
@@ -1373,8 +1443,8 @@ module Azure::ARM::NotificationHubs
1373
1443
  # Lists all the available namespaces within the subscription irrespective of
1374
1444
  # the resourceGroups.
1375
1445
  #
1376
- # @param next_page_link [String] The NextLink from the previous successful
1377
- # call to List operation.
1446
+ # @param next_page_link [String] The NextLink from the previous successful call
1447
+ # to List operation.
1378
1448
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1379
1449
  # will be added to the HTTP request.
1380
1450
  #
@@ -1388,8 +1458,8 @@ module Azure::ARM::NotificationHubs
1388
1458
  # Lists all the available namespaces within the subscription irrespective of
1389
1459
  # the resourceGroups.
1390
1460
  #
1391
- # @param next_page_link [String] The NextLink from the previous successful
1392
- # call to List operation.
1461
+ # @param next_page_link [String] The NextLink from the previous successful call
1462
+ # to List operation.
1393
1463
  # @param [Hash{String => String}] A hash of custom headers that will be added
1394
1464
  # to the HTTP request.
1395
1465
  #
@@ -1446,8 +1516,8 @@ module Azure::ARM::NotificationHubs
1446
1516
  #
1447
1517
  # Gets the authorization rules for a namespace.
1448
1518
  #
1449
- # @param next_page_link [String] The NextLink from the previous successful
1450
- # call to List operation.
1519
+ # @param next_page_link [String] The NextLink from the previous successful call
1520
+ # to List operation.
1451
1521
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1452
1522
  # will be added to the HTTP request.
1453
1523
  #
@@ -1461,8 +1531,8 @@ module Azure::ARM::NotificationHubs
1461
1531
  #
1462
1532
  # Gets the authorization rules for a namespace.
1463
1533
  #
1464
- # @param next_page_link [String] The NextLink from the previous successful
1465
- # call to List operation.
1534
+ # @param next_page_link [String] The NextLink from the previous successful call
1535
+ # to List operation.
1466
1536
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1467
1537
  # will be added to the HTTP request.
1468
1538
  #
@@ -1475,8 +1545,8 @@ module Azure::ARM::NotificationHubs
1475
1545
  #
1476
1546
  # Gets the authorization rules for a namespace.
1477
1547
  #
1478
- # @param next_page_link [String] The NextLink from the previous successful
1479
- # call to List operation.
1548
+ # @param next_page_link [String] The NextLink from the previous successful call
1549
+ # to List operation.
1480
1550
  # @param [Hash{String => String}] A hash of custom headers that will be added
1481
1551
  # to the HTTP request.
1482
1552
  #
@@ -1501,7 +1571,7 @@ module Azure::ARM::NotificationHubs
1501
1571
  headers: request_headers.merge(custom_headers || {}),
1502
1572
  base_url: request_url
1503
1573
  }
1504
- promise = @client.make_request_async(:post, path_template, options)
1574
+ promise = @client.make_request_async(:get, path_template, options)
1505
1575
 
1506
1576
  promise = promise.then do |result|
1507
1577
  http_response = result.response
@@ -1530,5 +1600,71 @@ module Azure::ARM::NotificationHubs
1530
1600
  promise.execute
1531
1601
  end
1532
1602
 
1603
+ #
1604
+ # Lists the available namespaces within a resourceGroup.
1605
+ #
1606
+ # @param resource_group_name [String] The name of the resource group. If
1607
+ # resourceGroupName value is null the method lists all the namespaces within
1608
+ # subscription
1609
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1610
+ # will be added to the HTTP request.
1611
+ #
1612
+ # @return [NamespaceListResult] which provide lazy access to pages of the
1613
+ # response.
1614
+ #
1615
+ def list_as_lazy(resource_group_name, custom_headers = nil)
1616
+ response = list_async(resource_group_name, custom_headers).value!
1617
+ unless response.nil?
1618
+ page = response.body
1619
+ page.next_method = Proc.new do |next_page_link|
1620
+ list_next_async(next_page_link, custom_headers)
1621
+ end
1622
+ page
1623
+ end
1624
+ end
1625
+
1626
+ #
1627
+ # Lists all the available namespaces within the subscription irrespective of
1628
+ # the resourceGroups.
1629
+ #
1630
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1631
+ # will be added to the HTTP request.
1632
+ #
1633
+ # @return [NamespaceListResult] which provide lazy access to pages of the
1634
+ # response.
1635
+ #
1636
+ def list_all_as_lazy(custom_headers = nil)
1637
+ response = list_all_async(custom_headers).value!
1638
+ unless response.nil?
1639
+ page = response.body
1640
+ page.next_method = Proc.new do |next_page_link|
1641
+ list_all_next_async(next_page_link, custom_headers)
1642
+ end
1643
+ page
1644
+ end
1645
+ end
1646
+
1647
+ #
1648
+ # Gets the authorization rules for a namespace.
1649
+ #
1650
+ # @param resource_group_name [String] The name of the resource group.
1651
+ # @param namespace_name [String] The namespace name
1652
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1653
+ # will be added to the HTTP request.
1654
+ #
1655
+ # @return [SharedAccessAuthorizationRuleListResult] which provide lazy access
1656
+ # to pages of the response.
1657
+ #
1658
+ def list_authorization_rules_as_lazy(resource_group_name, namespace_name, custom_headers = nil)
1659
+ response = list_authorization_rules_async(resource_group_name, namespace_name, custom_headers).value!
1660
+ unless response.nil?
1661
+ page = response.body
1662
+ page.next_method = Proc.new do |next_page_link|
1663
+ list_authorization_rules_next_async(next_page_link, custom_headers)
1664
+ end
1665
+ page
1666
+ end
1667
+ end
1668
+
1533
1669
  end
1534
1670
  end