azure_mgmt_notification_hubs 0.3.1 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. checksums.yaml +5 -13
  2. data/azure_mgmt_notification_hubs.gemspec +4 -5
  3. data/lib/azure_mgmt_notification_hubs.rb +3 -56
  4. data/lib/generated/azure_mgmt_notification_hubs.rb +58 -0
  5. data/lib/{azure_mgmt_notification_hubs → generated/azure_mgmt_notification_hubs}/models/access_rights.rb +0 -0
  6. data/lib/generated/azure_mgmt_notification_hubs/models/adm_credential.rb +46 -0
  7. data/lib/generated/azure_mgmt_notification_hubs/models/adm_credential_properties.rb +64 -0
  8. data/lib/generated/azure_mgmt_notification_hubs/models/apns_credential.rb +46 -0
  9. data/lib/generated/azure_mgmt_notification_hubs/models/apns_credential_properties.rb +74 -0
  10. data/lib/generated/azure_mgmt_notification_hubs/models/baidu_credential.rb +46 -0
  11. data/lib/generated/azure_mgmt_notification_hubs/models/baidu_credential_properties.rb +64 -0
  12. data/lib/generated/azure_mgmt_notification_hubs/models/check_availability_parameters.rb +83 -0
  13. data/lib/generated/azure_mgmt_notification_hubs/models/check_availability_resource.rb +102 -0
  14. data/lib/generated/azure_mgmt_notification_hubs/models/gcm_credential.rb +46 -0
  15. data/lib/generated/azure_mgmt_notification_hubs/models/gcm_credential_properties.rb +54 -0
  16. data/lib/generated/azure_mgmt_notification_hubs/models/mpns_credential.rb +46 -0
  17. data/lib/generated/azure_mgmt_notification_hubs/models/mpns_credential_properties.rb +64 -0
  18. data/lib/generated/azure_mgmt_notification_hubs/models/namespace_create_or_update_parameters.rb +72 -0
  19. data/lib/generated/azure_mgmt_notification_hubs/models/namespace_list_result.rb +95 -0
  20. data/lib/generated/azure_mgmt_notification_hubs/models/namespace_properties.rb +153 -0
  21. data/lib/generated/azure_mgmt_notification_hubs/models/namespace_resource.rb +102 -0
  22. data/lib/{azure_mgmt_notification_hubs → generated/azure_mgmt_notification_hubs}/models/namespace_type.rb +0 -0
  23. data/lib/generated/azure_mgmt_notification_hubs/models/notification_hub_create_or_update_parameters.rb +73 -0
  24. data/lib/generated/azure_mgmt_notification_hubs/models/notification_hub_list_result.rb +95 -0
  25. data/lib/generated/azure_mgmt_notification_hubs/models/notification_hub_properties.rb +145 -0
  26. data/lib/generated/azure_mgmt_notification_hubs/models/notification_hub_resource.rb +105 -0
  27. data/lib/generated/azure_mgmt_notification_hubs/models/resource_list_keys.rb +56 -0
  28. data/lib/generated/azure_mgmt_notification_hubs/models/shared_access_authorization_rule_create_or_update_parameters.rb +67 -0
  29. data/lib/generated/azure_mgmt_notification_hubs/models/shared_access_authorization_rule_list_result.rb +97 -0
  30. data/lib/generated/azure_mgmt_notification_hubs/models/shared_access_authorization_rule_properties.rb +133 -0
  31. data/lib/generated/azure_mgmt_notification_hubs/models/shared_access_authorization_rule_resource.rb +107 -0
  32. data/lib/generated/azure_mgmt_notification_hubs/models/wns_credential.rb +46 -0
  33. data/lib/generated/azure_mgmt_notification_hubs/models/wns_credential_properties.rb +64 -0
  34. data/lib/{azure_mgmt_notification_hubs → generated/azure_mgmt_notification_hubs}/module_definition.rb +0 -0
  35. data/lib/{azure_mgmt_notification_hubs → generated/azure_mgmt_notification_hubs}/namespaces.rb +166 -82
  36. data/lib/{azure_mgmt_notification_hubs → generated/azure_mgmt_notification_hubs}/notification_hubs.rb +119 -72
  37. data/lib/{azure_mgmt_notification_hubs → generated/azure_mgmt_notification_hubs}/notification_hubs_management_client.rb +4 -4
  38. data/lib/{azure_mgmt_notification_hubs → generated/azure_mgmt_notification_hubs}/version.rb +1 -1
  39. metadata +56 -76
  40. data/lib/azure_mgmt_notification_hubs/models/adm_credential.rb +0 -63
  41. data/lib/azure_mgmt_notification_hubs/models/adm_credential_properties.rb +0 -74
  42. data/lib/azure_mgmt_notification_hubs/models/apns_credential.rb +0 -63
  43. data/lib/azure_mgmt_notification_hubs/models/apns_credential_properties.rb +0 -83
  44. data/lib/azure_mgmt_notification_hubs/models/baidu_credential.rb +0 -63
  45. data/lib/azure_mgmt_notification_hubs/models/baidu_credential_properties.rb +0 -74
  46. data/lib/azure_mgmt_notification_hubs/models/check_availability_parameters.rb +0 -86
  47. data/lib/azure_mgmt_notification_hubs/models/check_availability_resource.rb +0 -102
  48. data/lib/azure_mgmt_notification_hubs/models/gcm_credential.rb +0 -63
  49. data/lib/azure_mgmt_notification_hubs/models/gcm_credential_properties.rb +0 -65
  50. data/lib/azure_mgmt_notification_hubs/models/mpns_credential.rb +0 -63
  51. data/lib/azure_mgmt_notification_hubs/models/mpns_credential_properties.rb +0 -74
  52. data/lib/azure_mgmt_notification_hubs/models/namespace_create_or_update_parameters.rb +0 -83
  53. data/lib/azure_mgmt_notification_hubs/models/namespace_list_result.rb +0 -87
  54. data/lib/azure_mgmt_notification_hubs/models/namespace_properties.rb +0 -159
  55. data/lib/azure_mgmt_notification_hubs/models/namespace_resource.rb +0 -108
  56. data/lib/azure_mgmt_notification_hubs/models/notification_hub_create_or_update_parameters.rb +0 -84
  57. data/lib/azure_mgmt_notification_hubs/models/notification_hub_list_result.rb +0 -87
  58. data/lib/azure_mgmt_notification_hubs/models/notification_hub_properties.rb +0 -197
  59. data/lib/azure_mgmt_notification_hubs/models/notification_hub_resource.rb +0 -111
  60. data/lib/azure_mgmt_notification_hubs/models/resource_list_keys.rb +0 -67
  61. data/lib/azure_mgmt_notification_hubs/models/shared_access_authorization_rule_create_or_update_parameters.rb +0 -83
  62. data/lib/azure_mgmt_notification_hubs/models/shared_access_authorization_rule_list_result.rb +0 -87
  63. data/lib/azure_mgmt_notification_hubs/models/shared_access_authorization_rule_properties.rb +0 -145
  64. data/lib/azure_mgmt_notification_hubs/models/shared_access_authorization_rule_resource.rb +0 -113
  65. data/lib/azure_mgmt_notification_hubs/models/wns_credential.rb +0 -63
  66. data/lib/azure_mgmt_notification_hubs/models/wns_credential_properties.rb +0 -74
@@ -66,21 +66,23 @@ module Azure::ARM::NotificationHubs
66
66
  #
67
67
  def check_availability_async(parameters, custom_headers = nil)
68
68
  fail ArgumentError, 'parameters is nil' if parameters.nil?
69
- parameters.validate unless parameters.nil?
70
69
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
71
70
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
71
+
72
+
72
73
  request_headers = {}
73
74
 
74
75
  # Set Headers
75
76
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
76
77
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
77
78
 
78
- # Serialize Request
79
79
  request_headers['Content-Type'] = 'application/json; charset=utf-8'
80
- unless parameters.nil?
81
- parameters = CheckAvailabilityParameters.serialize_object(parameters)
82
- end
83
- request_content = parameters != nil ? JSON.generate(parameters, quirks_mode: true) : nil
80
+
81
+ # Serialize Request
82
+ request_mapper = CheckAvailabilityParameters.mapper()
83
+ request_content = @client.serialize(request_mapper, parameters, 'parameters')
84
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
85
+
84
86
  path_template = '/subscriptions/{subscriptionId}/providers/Microsoft.NotificationHubs/checkNamespaceAvailability'
85
87
  options = {
86
88
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
@@ -112,10 +114,8 @@ module Azure::ARM::NotificationHubs
112
114
  if status_code == 200
113
115
  begin
114
116
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
115
- unless parsed_response.nil?
116
- parsed_response = CheckAvailabilityResource.deserialize_object(parsed_response)
117
- end
118
- result.body = parsed_response
117
+ result_mapper = CheckAvailabilityResource.mapper()
118
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
119
119
  rescue Exception => e
120
120
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
121
121
  end
@@ -179,21 +179,23 @@ module Azure::ARM::NotificationHubs
179
179
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
180
180
  fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
181
181
  fail ArgumentError, 'parameters is nil' if parameters.nil?
182
- parameters.validate unless parameters.nil?
183
182
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
184
183
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
184
+
185
+
185
186
  request_headers = {}
186
187
 
187
188
  # Set Headers
188
189
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
189
190
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
190
191
 
191
- # Serialize Request
192
192
  request_headers['Content-Type'] = 'application/json; charset=utf-8'
193
- unless parameters.nil?
194
- parameters = NamespaceCreateOrUpdateParameters.serialize_object(parameters)
195
- end
196
- request_content = parameters != nil ? JSON.generate(parameters, quirks_mode: true) : nil
193
+
194
+ # Serialize Request
195
+ request_mapper = NamespaceCreateOrUpdateParameters.mapper()
196
+ request_content = @client.serialize(request_mapper, parameters, 'parameters')
197
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
198
+
197
199
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}'
198
200
  options = {
199
201
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
@@ -225,10 +227,8 @@ module Azure::ARM::NotificationHubs
225
227
  if status_code == 201
226
228
  begin
227
229
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
228
- unless parsed_response.nil?
229
- parsed_response = NamespaceResource.deserialize_object(parsed_response)
230
- end
231
- result.body = parsed_response
230
+ result_mapper = NamespaceResource.mapper()
231
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
232
232
  rescue Exception => e
233
233
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
234
234
  end
@@ -237,10 +237,8 @@ module Azure::ARM::NotificationHubs
237
237
  if status_code == 200
238
238
  begin
239
239
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
240
- unless parsed_response.nil?
241
- parsed_response = NamespaceResource.deserialize_object(parsed_response)
242
- end
243
- result.body = parsed_response
240
+ result_mapper = NamespaceResource.mapper()
241
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
244
242
  rescue Exception => e
245
243
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
246
244
  end
@@ -258,10 +256,24 @@ module Azure::ARM::NotificationHubs
258
256
  #
259
257
  # @param resource_group_name [String] The name of the resource group.
260
258
  # @param namespace_name [String] The namespace name.
259
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
260
+ # will be added to the HTTP request.
261
+ #
262
+ def delete(resource_group_name, namespace_name, custom_headers = nil)
263
+ response = delete_async(resource_group_name, namespace_name, custom_headers).value!
264
+ nil
265
+ end
266
+
267
+ #
268
+ # @param resource_group_name [String] The name of the resource group.
269
+ # @param namespace_name [String] The namespace name.
270
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
271
+ # will be added to the HTTP request.
272
+ #
261
273
  # @return [Concurrent::Promise] promise which provides async access to http
262
274
  # response.
263
275
  #
264
- def delete(resource_group_name, namespace_name, custom_headers = nil)
276
+ def delete_async(resource_group_name, namespace_name, custom_headers = nil)
265
277
  # Send request
266
278
  promise = begin_delete_async(resource_group_name, namespace_name, custom_headers)
267
279
 
@@ -270,8 +282,8 @@ module Azure::ARM::NotificationHubs
270
282
  deserialize_method = lambda do |parsed_response|
271
283
  end
272
284
 
273
- # Waiting for response.
274
- @client.get_long_running_operation_result(response, deserialize_method)
285
+ # Waiting for response.
286
+ @client.get_long_running_operation_result(response, deserialize_method)
275
287
  end
276
288
 
277
289
  promise
@@ -323,6 +335,8 @@ module Azure::ARM::NotificationHubs
323
335
  fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
324
336
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
325
337
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
338
+
339
+
326
340
  request_headers = {}
327
341
 
328
342
  # Set Headers
@@ -405,6 +419,8 @@ module Azure::ARM::NotificationHubs
405
419
  fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
406
420
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
407
421
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
422
+
423
+
408
424
  request_headers = {}
409
425
 
410
426
  # Set Headers
@@ -440,10 +456,8 @@ module Azure::ARM::NotificationHubs
440
456
  if status_code == 200
441
457
  begin
442
458
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
443
- unless parsed_response.nil?
444
- parsed_response = NamespaceResource.deserialize_object(parsed_response)
445
- end
446
- result.body = parsed_response
459
+ result_mapper = NamespaceResource.mapper()
460
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
447
461
  rescue Exception => e
448
462
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
449
463
  end
@@ -508,21 +522,23 @@ module Azure::ARM::NotificationHubs
508
522
  fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
509
523
  fail ArgumentError, 'authorization_rule_name is nil' if authorization_rule_name.nil?
510
524
  fail ArgumentError, 'parameters is nil' if parameters.nil?
511
- parameters.validate unless parameters.nil?
512
525
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
513
526
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
527
+
528
+
514
529
  request_headers = {}
515
530
 
516
531
  # Set Headers
517
532
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
518
533
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
519
534
 
520
- # Serialize Request
521
535
  request_headers['Content-Type'] = 'application/json; charset=utf-8'
522
- unless parameters.nil?
523
- parameters = SharedAccessAuthorizationRuleCreateOrUpdateParameters.serialize_object(parameters)
524
- end
525
- request_content = parameters != nil ? JSON.generate(parameters, quirks_mode: true) : nil
536
+
537
+ # Serialize Request
538
+ request_mapper = SharedAccessAuthorizationRuleCreateOrUpdateParameters.mapper()
539
+ request_content = @client.serialize(request_mapper, parameters, 'parameters')
540
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
541
+
526
542
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}'
527
543
  options = {
528
544
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
@@ -554,10 +570,8 @@ module Azure::ARM::NotificationHubs
554
570
  if status_code == 200
555
571
  begin
556
572
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
557
- unless parsed_response.nil?
558
- parsed_response = SharedAccessAuthorizationRuleResource.deserialize_object(parsed_response)
559
- end
560
- result.body = parsed_response
573
+ result_mapper = SharedAccessAuthorizationRuleResource.mapper()
574
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
561
575
  rescue Exception => e
562
576
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
563
577
  end
@@ -616,6 +630,8 @@ module Azure::ARM::NotificationHubs
616
630
  fail ArgumentError, 'authorization_rule_name is nil' if authorization_rule_name.nil?
617
631
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
618
632
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
633
+
634
+
619
635
  request_headers = {}
620
636
 
621
637
  # Set Headers
@@ -702,6 +718,8 @@ module Azure::ARM::NotificationHubs
702
718
  fail ArgumentError, 'authorization_rule_name is nil' if authorization_rule_name.nil?
703
719
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
704
720
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
721
+
722
+
705
723
  request_headers = {}
706
724
 
707
725
  # Set Headers
@@ -737,10 +755,8 @@ module Azure::ARM::NotificationHubs
737
755
  if status_code == 200
738
756
  begin
739
757
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
740
- unless parsed_response.nil?
741
- parsed_response = SharedAccessAuthorizationRuleResource.deserialize_object(parsed_response)
742
- end
743
- result.body = parsed_response
758
+ result_mapper = SharedAccessAuthorizationRuleResource.mapper()
759
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
744
760
  rescue Exception => e
745
761
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
746
762
  end
@@ -801,6 +817,8 @@ module Azure::ARM::NotificationHubs
801
817
  #
802
818
  def get_long_running_operation_status_async(operation_status_link, custom_headers = nil)
803
819
  fail ArgumentError, 'operation_status_link is nil' if operation_status_link.nil?
820
+
821
+
804
822
  request_headers = {}
805
823
 
806
824
  # Set Headers
@@ -847,11 +865,34 @@ module Azure::ARM::NotificationHubs
847
865
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
848
866
  # will be added to the HTTP request.
849
867
  #
850
- # @return [NamespaceListResult] operation results.
868
+ # @return [NamespaceListResult] which provide lazy access to pages of the
869
+ # response.
851
870
  #
852
- def list(resource_group_name, custom_headers = nil)
871
+ def list_as_lazy(resource_group_name, custom_headers = nil)
853
872
  response = list_async(resource_group_name, custom_headers).value!
854
- response.body unless response.nil?
873
+ unless response.nil?
874
+ page = response.body
875
+ page.next_method = Proc.new do |next_link|
876
+ list_next_async(next_link, custom_headers)
877
+ end
878
+ page
879
+ end
880
+ end
881
+
882
+ #
883
+ # Lists the available namespaces within a resourceGroup.
884
+ #
885
+ # @param resource_group_name [String] The name of the resource group. If
886
+ # resourceGroupName value is null the method lists all the namespaces within
887
+ # subscription
888
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
889
+ # will be added to the HTTP request.
890
+ #
891
+ # @return [Array<NamespaceResource>] operation results.
892
+ #
893
+ def list(resource_group_name, custom_headers = nil)
894
+ first_page = list_as_lazy(resource_group_name, custom_headers)
895
+ first_page.get_all_items
855
896
  end
856
897
 
857
898
  #
@@ -884,6 +925,8 @@ module Azure::ARM::NotificationHubs
884
925
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
885
926
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
886
927
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
928
+
929
+
887
930
  request_headers = {}
888
931
 
889
932
  # Set Headers
@@ -919,10 +962,8 @@ module Azure::ARM::NotificationHubs
919
962
  if status_code == 200
920
963
  begin
921
964
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
922
- unless parsed_response.nil?
923
- parsed_response = NamespaceListResult.deserialize_object(parsed_response)
924
- end
925
- result.body = parsed_response
965
+ result_mapper = NamespaceListResult.mapper()
966
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
926
967
  rescue Exception => e
927
968
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
928
969
  end
@@ -941,11 +982,32 @@ module Azure::ARM::NotificationHubs
941
982
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
942
983
  # will be added to the HTTP request.
943
984
  #
944
- # @return [NamespaceListResult] operation results.
985
+ # @return [NamespaceListResult] which provide lazy access to pages of the
986
+ # response.
945
987
  #
946
- def list_all(custom_headers = nil)
988
+ def list_all_as_lazy(custom_headers = nil)
947
989
  response = list_all_async(custom_headers).value!
948
- response.body unless response.nil?
990
+ unless response.nil?
991
+ page = response.body
992
+ page.next_method = Proc.new do |next_link|
993
+ list_all_next_async(next_link, custom_headers)
994
+ end
995
+ page
996
+ end
997
+ end
998
+
999
+ #
1000
+ # Lists all the available namespaces within the subscription irrespective of
1001
+ # the resourceGroups.
1002
+ #
1003
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1004
+ # will be added to the HTTP request.
1005
+ #
1006
+ # @return [Array<NamespaceResource>] operation results.
1007
+ #
1008
+ def list_all(custom_headers = nil)
1009
+ first_page = list_all_as_lazy(custom_headers)
1010
+ first_page.get_all_items
949
1011
  end
950
1012
 
951
1013
  #
@@ -973,6 +1035,8 @@ module Azure::ARM::NotificationHubs
973
1035
  def list_all_async(custom_headers = nil)
974
1036
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
975
1037
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1038
+
1039
+
976
1040
  request_headers = {}
977
1041
 
978
1042
  # Set Headers
@@ -1008,10 +1072,8 @@ module Azure::ARM::NotificationHubs
1008
1072
  if status_code == 200
1009
1073
  begin
1010
1074
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1011
- unless parsed_response.nil?
1012
- parsed_response = NamespaceListResult.deserialize_object(parsed_response)
1013
- end
1014
- result.body = parsed_response
1075
+ result_mapper = NamespaceListResult.mapper()
1076
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
1015
1077
  rescue Exception => e
1016
1078
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1017
1079
  end
@@ -1031,11 +1093,33 @@ module Azure::ARM::NotificationHubs
1031
1093
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1032
1094
  # will be added to the HTTP request.
1033
1095
  #
1034
- # @return [SharedAccessAuthorizationRuleListResult] operation results.
1096
+ # @return [SharedAccessAuthorizationRuleListResult] which provide lazy access
1097
+ # to pages of the response.
1035
1098
  #
1036
- def list_authorization_rules(resource_group_name, namespace_name, custom_headers = nil)
1099
+ def list_authorization_rules_as_lazy(resource_group_name, namespace_name, custom_headers = nil)
1037
1100
  response = list_authorization_rules_async(resource_group_name, namespace_name, custom_headers).value!
1038
- response.body unless response.nil?
1101
+ unless response.nil?
1102
+ page = response.body
1103
+ page.next_method = Proc.new do |next_link|
1104
+ list_authorization_rules_next_async(next_link, custom_headers)
1105
+ end
1106
+ page
1107
+ end
1108
+ end
1109
+
1110
+ #
1111
+ # Gets the authorization rules for a namespace.
1112
+ #
1113
+ # @param resource_group_name [String] The name of the resource group.
1114
+ # @param namespace_name [String] The namespace name
1115
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1116
+ # will be added to the HTTP request.
1117
+ #
1118
+ # @return [Array<SharedAccessAuthorizationRuleResource>] operation results.
1119
+ #
1120
+ def list_authorization_rules(resource_group_name, namespace_name, custom_headers = nil)
1121
+ first_page = list_authorization_rules_as_lazy(resource_group_name, namespace_name, custom_headers)
1122
+ first_page.get_all_items
1039
1123
  end
1040
1124
 
1041
1125
  #
@@ -1067,6 +1151,8 @@ module Azure::ARM::NotificationHubs
1067
1151
  fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
1068
1152
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1069
1153
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1154
+
1155
+
1070
1156
  request_headers = {}
1071
1157
 
1072
1158
  # Set Headers
@@ -1102,10 +1188,8 @@ module Azure::ARM::NotificationHubs
1102
1188
  if status_code == 200
1103
1189
  begin
1104
1190
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1105
- unless parsed_response.nil?
1106
- parsed_response = SharedAccessAuthorizationRuleListResult.deserialize_object(parsed_response)
1107
- end
1108
- result.body = parsed_response
1191
+ result_mapper = SharedAccessAuthorizationRuleListResult.mapper()
1192
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
1109
1193
  rescue Exception => e
1110
1194
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1111
1195
  end
@@ -1168,6 +1252,8 @@ module Azure::ARM::NotificationHubs
1168
1252
  fail ArgumentError, 'authorization_rule_name is nil' if authorization_rule_name.nil?
1169
1253
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1170
1254
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1255
+
1256
+
1171
1257
  request_headers = {}
1172
1258
 
1173
1259
  # Set Headers
@@ -1203,10 +1289,8 @@ module Azure::ARM::NotificationHubs
1203
1289
  if status_code == 200
1204
1290
  begin
1205
1291
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1206
- unless parsed_response.nil?
1207
- parsed_response = ResourceListKeys.deserialize_object(parsed_response)
1208
- end
1209
- result.body = parsed_response
1292
+ result_mapper = ResourceListKeys.mapper()
1293
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
1210
1294
  rescue Exception => e
1211
1295
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1212
1296
  end
@@ -1259,6 +1343,8 @@ module Azure::ARM::NotificationHubs
1259
1343
  #
1260
1344
  def list_next_async(next_page_link, custom_headers = nil)
1261
1345
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1346
+
1347
+
1262
1348
  request_headers = {}
1263
1349
 
1264
1350
  # Set Headers
@@ -1293,10 +1379,8 @@ module Azure::ARM::NotificationHubs
1293
1379
  if status_code == 200
1294
1380
  begin
1295
1381
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1296
- unless parsed_response.nil?
1297
- parsed_response = NamespaceListResult.deserialize_object(parsed_response)
1298
- end
1299
- result.body = parsed_response
1382
+ result_mapper = NamespaceListResult.mapper()
1383
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
1300
1384
  rescue Exception => e
1301
1385
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1302
1386
  end
@@ -1352,6 +1436,8 @@ module Azure::ARM::NotificationHubs
1352
1436
  #
1353
1437
  def list_all_next_async(next_page_link, custom_headers = nil)
1354
1438
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1439
+
1440
+
1355
1441
  request_headers = {}
1356
1442
 
1357
1443
  # Set Headers
@@ -1386,10 +1472,8 @@ module Azure::ARM::NotificationHubs
1386
1472
  if status_code == 200
1387
1473
  begin
1388
1474
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1389
- unless parsed_response.nil?
1390
- parsed_response = NamespaceListResult.deserialize_object(parsed_response)
1391
- end
1392
- result.body = parsed_response
1475
+ result_mapper = NamespaceListResult.mapper()
1476
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
1393
1477
  rescue Exception => e
1394
1478
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1395
1479
  end
@@ -1442,6 +1526,8 @@ module Azure::ARM::NotificationHubs
1442
1526
  #
1443
1527
  def list_authorization_rules_next_async(next_page_link, custom_headers = nil)
1444
1528
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1529
+
1530
+
1445
1531
  request_headers = {}
1446
1532
 
1447
1533
  # Set Headers
@@ -1476,10 +1562,8 @@ module Azure::ARM::NotificationHubs
1476
1562
  if status_code == 200
1477
1563
  begin
1478
1564
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1479
- unless parsed_response.nil?
1480
- parsed_response = SharedAccessAuthorizationRuleListResult.deserialize_object(parsed_response)
1481
- end
1482
- result.body = parsed_response
1565
+ result_mapper = SharedAccessAuthorizationRuleListResult.mapper()
1566
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
1483
1567
  rescue Exception => e
1484
1568
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1485
1569
  end