azure_mgmt_event_hub 0.17.0 → 0.18.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (111) hide show
  1. checksums.yaml +5 -5
  2. data/lib/2014-09-01/generated/azure_mgmt_event_hub.rb +59 -0
  3. data/lib/2014-09-01/generated/azure_mgmt_event_hub/consumer_groups.rb +598 -0
  4. data/lib/2014-09-01/generated/azure_mgmt_event_hub/event_hub_management_client.rb +145 -0
  5. data/lib/2014-09-01/generated/azure_mgmt_event_hub/event_hubs.rb +1239 -0
  6. data/lib/2014-09-01/generated/azure_mgmt_event_hub/models/access_rights.rb +17 -0
  7. data/lib/2014-09-01/generated/azure_mgmt_event_hub/models/check_name_availability_parameter.rb +46 -0
  8. data/lib/2014-09-01/generated/azure_mgmt_event_hub/models/check_name_availability_result.rb +75 -0
  9. data/lib/2014-09-01/generated/azure_mgmt_event_hub/models/consumer_group_create_or_update_parameters.rb +115 -0
  10. data/lib/2014-09-01/generated/azure_mgmt_event_hub/models/consumer_group_list_result.rb +100 -0
  11. data/lib/2014-09-01/generated/azure_mgmt_event_hub/models/consumer_group_resource.rb +117 -0
  12. data/lib/2014-09-01/generated/azure_mgmt_event_hub/models/entity_status.rb +23 -0
  13. data/lib/2014-09-01/generated/azure_mgmt_event_hub/models/event_hub_create_or_update_parameters.rb +150 -0
  14. data/lib/2014-09-01/generated/azure_mgmt_event_hub/models/event_hub_list_result.rb +100 -0
  15. data/lib/2014-09-01/generated/azure_mgmt_event_hub/models/event_hub_resource.rb +152 -0
  16. data/lib/2014-09-01/generated/azure_mgmt_event_hub/models/namespace_create_or_update_parameters.rb +160 -0
  17. data/lib/2014-09-01/generated/azure_mgmt_event_hub/models/namespace_list_result.rb +100 -0
  18. data/lib/2014-09-01/generated/azure_mgmt_event_hub/models/namespace_resource.rb +181 -0
  19. data/lib/2014-09-01/generated/azure_mgmt_event_hub/models/namespace_state.rb +27 -0
  20. data/lib/2014-09-01/generated/azure_mgmt_event_hub/models/namespace_update_parameter.rb +66 -0
  21. data/lib/2014-09-01/generated/azure_mgmt_event_hub/models/operation.rb +59 -0
  22. data/lib/2014-09-01/generated/azure_mgmt_event_hub/models/operation_display.rb +72 -0
  23. data/lib/2014-09-01/generated/azure_mgmt_event_hub/models/operation_list_result.rb +103 -0
  24. data/lib/2014-09-01/generated/azure_mgmt_event_hub/models/resource.rb +91 -0
  25. data/lib/2014-09-01/generated/azure_mgmt_event_hub/models/shared_access_authorization_rule_create_or_update_parameters.rb +79 -0
  26. data/lib/2014-09-01/generated/azure_mgmt_event_hub/models/shared_access_authorization_rule_list_result.rb +102 -0
  27. data/lib/2014-09-01/generated/azure_mgmt_event_hub/models/shared_access_authorization_rule_post_resource.rb +175 -0
  28. data/lib/2014-09-01/generated/azure_mgmt_event_hub/models/shared_access_authorization_rule_resource.rb +90 -0
  29. data/lib/2014-09-01/generated/azure_mgmt_event_hub/models/sku.rb +70 -0
  30. data/lib/2014-09-01/generated/azure_mgmt_event_hub/models/sku_name.rb +16 -0
  31. data/lib/2014-09-01/generated/azure_mgmt_event_hub/models/sku_tier.rb +17 -0
  32. data/lib/2014-09-01/generated/azure_mgmt_event_hub/models/tracked_resource.rb +89 -0
  33. data/lib/2014-09-01/generated/azure_mgmt_event_hub/models/unavailable_reason.rb +20 -0
  34. data/lib/2014-09-01/generated/azure_mgmt_event_hub/module_definition.rb +9 -0
  35. data/lib/2014-09-01/generated/azure_mgmt_event_hub/namespaces.rb +2044 -0
  36. data/lib/2014-09-01/generated/azure_mgmt_event_hub/operations.rb +219 -0
  37. data/lib/2015-08-01/generated/azure_mgmt_event_hub/consumer_groups.rb +10 -0
  38. data/lib/2015-08-01/generated/azure_mgmt_event_hub/event_hub_management_client.rb +1 -1
  39. data/lib/2015-08-01/generated/azure_mgmt_event_hub/event_hubs.rb +31 -5
  40. data/lib/2015-08-01/generated/azure_mgmt_event_hub/models/consumer_group_list_result.rb +1 -1
  41. data/lib/2015-08-01/generated/azure_mgmt_event_hub/models/event_hub_list_result.rb +1 -1
  42. data/lib/2015-08-01/generated/azure_mgmt_event_hub/models/namespace_list_result.rb +1 -1
  43. data/lib/2015-08-01/generated/azure_mgmt_event_hub/models/operation_list_result.rb +1 -1
  44. data/lib/2015-08-01/generated/azure_mgmt_event_hub/models/resource.rb +9 -0
  45. data/lib/2015-08-01/generated/azure_mgmt_event_hub/models/shared_access_authorization_rule_list_result.rb +1 -1
  46. data/lib/2015-08-01/generated/azure_mgmt_event_hub/namespaces.rb +32 -0
  47. data/lib/2015-08-01/generated/azure_mgmt_event_hub/operations.rb +4 -0
  48. data/lib/2017-04-01/generated/azure_mgmt_event_hub.rb +20 -13
  49. data/lib/2017-04-01/generated/azure_mgmt_event_hub/consumer_groups.rb +14 -0
  50. data/lib/2017-04-01/generated/azure_mgmt_event_hub/disaster_recovery_configs.rb +27 -3
  51. data/lib/2017-04-01/generated/azure_mgmt_event_hub/event_hub_management_client.rb +1 -1
  52. data/lib/2017-04-01/generated/azure_mgmt_event_hub/event_hubs.rb +33 -0
  53. data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/arm_disaster_recovery.rb +1 -1
  54. data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/arm_disaster_recovery_list_result.rb +1 -1
  55. data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/authorization_rule_list_result.rb +1 -1
  56. data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/capture_description.rb +11 -0
  57. data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/consumer_group.rb +1 -1
  58. data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/consumer_group_list_result.rb +1 -1
  59. data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/default_action.rb +16 -0
  60. data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/ehnamespace.rb +13 -1
  61. data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/ehnamespace_list_result.rb +1 -1
  62. data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/error_response.rb +1 -1
  63. data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/event_hub_list_result.rb +1 -1
  64. data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/messaging_regions_list_result.rb +1 -1
  65. data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/network_rule_ipaction.rb +15 -0
  66. data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/network_rule_set.rb +114 -0
  67. data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/network_rule_set_list_result.rb +100 -0
  68. data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/nwrule_set_ip_rules.rb +59 -0
  69. data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/nwrule_set_virtual_network_rules.rb +59 -0
  70. data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/operation_list_result.rb +1 -1
  71. data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/regenerate_access_key_parameters.rb +1 -1
  72. data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/resource.rb +9 -0
  73. data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/sku.rb +1 -1
  74. data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/subnet.rb +46 -0
  75. data/lib/2017-04-01/generated/azure_mgmt_event_hub/namespaces.rb +461 -0
  76. data/lib/2017-04-01/generated/azure_mgmt_event_hub/operations.rb +4 -0
  77. data/lib/2017-04-01/generated/azure_mgmt_event_hub/regions.rb +4 -0
  78. data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub.rb +22 -7
  79. data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/clusters.rb +483 -0
  80. data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/configuration.rb +4 -0
  81. data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/event_hub2018preview_management_client.rb +1 -1
  82. data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/models/available_cluster.rb +47 -0
  83. data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/models/available_clusters_list.rb +56 -0
  84. data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/models/cluster.rb +12 -0
  85. data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/models/cluster_list_result.rb +1 -1
  86. data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/models/default_action.rb +16 -0
  87. data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/models/ehnamespace.rb +36 -1
  88. data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/models/ehnamespace_id_container.rb +46 -0
  89. data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/models/ehnamespace_id_list_result.rb +56 -0
  90. data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/models/ehnamespace_list_result.rb +1 -1
  91. data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/models/encryption.rb +62 -0
  92. data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/models/identity.rb +72 -0
  93. data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/models/identity_type.rb +15 -0
  94. data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/models/ip_filter_rule_list_result.rb +1 -1
  95. data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/models/key_source.rb +15 -0
  96. data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/models/key_vault_properties.rb +57 -0
  97. data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/models/network_rule_ipaction.rb +15 -0
  98. data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/models/network_rule_set.rb +114 -0
  99. data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/models/nwrule_set_ip_rules.rb +58 -0
  100. data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/models/nwrule_set_virtual_network_rules.rb +59 -0
  101. data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/models/operation_list_result.rb +1 -1
  102. data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/models/resource.rb +9 -0
  103. data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/models/sku.rb +1 -1
  104. data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/models/subnet.rb +46 -0
  105. data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/models/virtual_network_rule_list_result.rb +6 -6
  106. data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/namespaces.rb +260 -11
  107. data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/operations.rb +4 -0
  108. data/lib/azure_mgmt_event_hub.rb +2 -1
  109. data/lib/profiles/latest/modules/eventhub_profile_module.rb +82 -22
  110. data/lib/version.rb +1 -1
  111. metadata +62 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 21314af3d9470e168399d17e264e13778ed1f485
4
- data.tar.gz: d6ea18e728d0409deacdd742616307a356a9d3d1
2
+ SHA256:
3
+ metadata.gz: 5ac8a3fa67a295cef3cb6f8864d208c8fc01218f5dc51f15df24aaff8543404a
4
+ data.tar.gz: 3ca26d294b55dd57fedbc0b70103954c8c02c02135470c3928d529d9e85595d7
5
5
  SHA512:
6
- metadata.gz: b2d4c00cfbe47bd8b70cbd2e10e560c268d73893fb1f1bffef950b1c3ad142d52358ef92f452af89730bc12e06249d75d56e8ada6423924a8122e272f863904a
7
- data.tar.gz: 007dfd53dc165d51e93186982a07cf91d92c3f0c8bfff6737ad73dd34936833d455d9c945e307556653a6085e923a56b8742f64255efab17cbe3d89012375d26
6
+ metadata.gz: 7118a05acb3512d93785589606acfde6e46eaaeda8a640dc55fb2dafbb33d573d10ede8db7f027f8aab768c9c528e92c847759487d55e3b55e6a7481f461ea3c
7
+ data.tar.gz: 8210f161b82570cc9f0c561c06d80307d54e597bdb4e471438e63b0a274ceda5d2be61c25338e0d0b1b9b44af4e6f74a1ac3269acedeb8e60877b63cf9c4b3aa
@@ -0,0 +1,59 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ require 'uri'
7
+ require 'cgi'
8
+ require 'date'
9
+ require 'json'
10
+ require 'base64'
11
+ require 'erb'
12
+ require 'securerandom'
13
+ require 'time'
14
+ require 'timeliness'
15
+ require 'faraday'
16
+ require 'faraday-cookie_jar'
17
+ require 'concurrent'
18
+ require 'ms_rest'
19
+ require '2014-09-01/generated/azure_mgmt_event_hub/module_definition'
20
+ require 'ms_rest_azure'
21
+
22
+ module Azure::EventHub::Mgmt::V2014_09_01
23
+ autoload :Operations, '2014-09-01/generated/azure_mgmt_event_hub/operations.rb'
24
+ autoload :Namespaces, '2014-09-01/generated/azure_mgmt_event_hub/namespaces.rb'
25
+ autoload :EventHubs, '2014-09-01/generated/azure_mgmt_event_hub/event_hubs.rb'
26
+ autoload :ConsumerGroups, '2014-09-01/generated/azure_mgmt_event_hub/consumer_groups.rb'
27
+ autoload :EventHubManagementClient, '2014-09-01/generated/azure_mgmt_event_hub/event_hub_management_client.rb'
28
+
29
+ module Models
30
+ autoload :SharedAccessAuthorizationRuleListResult, '2014-09-01/generated/azure_mgmt_event_hub/models/shared_access_authorization_rule_list_result.rb'
31
+ autoload :OperationDisplay, '2014-09-01/generated/azure_mgmt_event_hub/models/operation_display.rb'
32
+ autoload :CheckNameAvailabilityParameter, '2014-09-01/generated/azure_mgmt_event_hub/models/check_name_availability_parameter.rb'
33
+ autoload :OperationListResult, '2014-09-01/generated/azure_mgmt_event_hub/models/operation_list_result.rb'
34
+ autoload :Operation, '2014-09-01/generated/azure_mgmt_event_hub/models/operation.rb'
35
+ autoload :Resource, '2014-09-01/generated/azure_mgmt_event_hub/models/resource.rb'
36
+ autoload :NamespaceCreateOrUpdateParameters, '2014-09-01/generated/azure_mgmt_event_hub/models/namespace_create_or_update_parameters.rb'
37
+ autoload :EventHubCreateOrUpdateParameters, '2014-09-01/generated/azure_mgmt_event_hub/models/event_hub_create_or_update_parameters.rb'
38
+ autoload :NamespaceListResult, '2014-09-01/generated/azure_mgmt_event_hub/models/namespace_list_result.rb'
39
+ autoload :NamespaceUpdateParameter, '2014-09-01/generated/azure_mgmt_event_hub/models/namespace_update_parameter.rb'
40
+ autoload :SharedAccessAuthorizationRuleCreateOrUpdateParameters, '2014-09-01/generated/azure_mgmt_event_hub/models/shared_access_authorization_rule_create_or_update_parameters.rb'
41
+ autoload :CheckNameAvailabilityResult, '2014-09-01/generated/azure_mgmt_event_hub/models/check_name_availability_result.rb'
42
+ autoload :ConsumerGroupListResult, '2014-09-01/generated/azure_mgmt_event_hub/models/consumer_group_list_result.rb'
43
+ autoload :EventHubListResult, '2014-09-01/generated/azure_mgmt_event_hub/models/event_hub_list_result.rb'
44
+ autoload :Sku, '2014-09-01/generated/azure_mgmt_event_hub/models/sku.rb'
45
+ autoload :ConsumerGroupCreateOrUpdateParameters, '2014-09-01/generated/azure_mgmt_event_hub/models/consumer_group_create_or_update_parameters.rb'
46
+ autoload :TrackedResource, '2014-09-01/generated/azure_mgmt_event_hub/models/tracked_resource.rb'
47
+ autoload :NamespaceResource, '2014-09-01/generated/azure_mgmt_event_hub/models/namespace_resource.rb'
48
+ autoload :SharedAccessAuthorizationRuleResource, '2014-09-01/generated/azure_mgmt_event_hub/models/shared_access_authorization_rule_resource.rb'
49
+ autoload :SharedAccessAuthorizationRulePostResource, '2014-09-01/generated/azure_mgmt_event_hub/models/shared_access_authorization_rule_post_resource.rb'
50
+ autoload :EventHubResource, '2014-09-01/generated/azure_mgmt_event_hub/models/event_hub_resource.rb'
51
+ autoload :ConsumerGroupResource, '2014-09-01/generated/azure_mgmt_event_hub/models/consumer_group_resource.rb'
52
+ autoload :SkuName, '2014-09-01/generated/azure_mgmt_event_hub/models/sku_name.rb'
53
+ autoload :SkuTier, '2014-09-01/generated/azure_mgmt_event_hub/models/sku_tier.rb'
54
+ autoload :NamespaceState, '2014-09-01/generated/azure_mgmt_event_hub/models/namespace_state.rb'
55
+ autoload :AccessRights, '2014-09-01/generated/azure_mgmt_event_hub/models/access_rights.rb'
56
+ autoload :EntityStatus, '2014-09-01/generated/azure_mgmt_event_hub/models/entity_status.rb'
57
+ autoload :UnavailableReason, '2014-09-01/generated/azure_mgmt_event_hub/models/unavailable_reason.rb'
58
+ end
59
+ end
@@ -0,0 +1,598 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::EventHub::Mgmt::V2014_09_01
7
+ #
8
+ # Azure Event Hubs client
9
+ #
10
+ class ConsumerGroups
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the ConsumerGroups class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [EventHubManagementClient] reference to the EventHubManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Creates or updates an Event Hubs consumer group as a nested resource within a
26
+ # Namespace.
27
+ #
28
+ # @param resource_group_name [String] Name of the resource group within the
29
+ # azure subscription.
30
+ # @param namespace_name [String] The Namespace name
31
+ # @param event_hub_name [String] The Event Hub name
32
+ # @param consumer_group_name [String] The consumer group name
33
+ # @param parameters [ConsumerGroupCreateOrUpdateParameters] Parameters supplied
34
+ # to create or update a consumer group resource.
35
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
36
+ # will be added to the HTTP request.
37
+ #
38
+ # @return [ConsumerGroupResource] operation results.
39
+ #
40
+ def create_or_update(resource_group_name, namespace_name, event_hub_name, consumer_group_name, parameters, custom_headers:nil)
41
+ response = create_or_update_async(resource_group_name, namespace_name, event_hub_name, consumer_group_name, parameters, custom_headers:custom_headers).value!
42
+ response.body unless response.nil?
43
+ end
44
+
45
+ #
46
+ # Creates or updates an Event Hubs consumer group as a nested resource within a
47
+ # Namespace.
48
+ #
49
+ # @param resource_group_name [String] Name of the resource group within the
50
+ # azure subscription.
51
+ # @param namespace_name [String] The Namespace name
52
+ # @param event_hub_name [String] The Event Hub name
53
+ # @param consumer_group_name [String] The consumer group name
54
+ # @param parameters [ConsumerGroupCreateOrUpdateParameters] Parameters supplied
55
+ # to create or update a consumer group resource.
56
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
57
+ # will be added to the HTTP request.
58
+ #
59
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
60
+ #
61
+ def create_or_update_with_http_info(resource_group_name, namespace_name, event_hub_name, consumer_group_name, parameters, custom_headers:nil)
62
+ create_or_update_async(resource_group_name, namespace_name, event_hub_name, consumer_group_name, parameters, custom_headers:custom_headers).value!
63
+ end
64
+
65
+ #
66
+ # Creates or updates an Event Hubs consumer group as a nested resource within a
67
+ # Namespace.
68
+ #
69
+ # @param resource_group_name [String] Name of the resource group within the
70
+ # azure subscription.
71
+ # @param namespace_name [String] The Namespace name
72
+ # @param event_hub_name [String] The Event Hub name
73
+ # @param consumer_group_name [String] The consumer group name
74
+ # @param parameters [ConsumerGroupCreateOrUpdateParameters] Parameters supplied
75
+ # to create or update a consumer group resource.
76
+ # @param [Hash{String => String}] A hash of custom headers that will be added
77
+ # to the HTTP request.
78
+ #
79
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
80
+ #
81
+ def create_or_update_async(resource_group_name, namespace_name, event_hub_name, consumer_group_name, parameters, custom_headers:nil)
82
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
83
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
84
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
85
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
86
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
87
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
88
+ fail ArgumentError, 'event_hub_name is nil' if event_hub_name.nil?
89
+ fail ArgumentError, "'event_hub_name' should satisfy the constraint - 'MaxLength': '50'" if !event_hub_name.nil? && event_hub_name.length > 50
90
+ fail ArgumentError, "'event_hub_name' should satisfy the constraint - 'MinLength': '1'" if !event_hub_name.nil? && event_hub_name.length < 1
91
+ fail ArgumentError, 'consumer_group_name is nil' if consumer_group_name.nil?
92
+ fail ArgumentError, "'consumer_group_name' should satisfy the constraint - 'MaxLength': '50'" if !consumer_group_name.nil? && consumer_group_name.length > 50
93
+ fail ArgumentError, "'consumer_group_name' should satisfy the constraint - 'MinLength': '1'" if !consumer_group_name.nil? && consumer_group_name.length < 1
94
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
95
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
96
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
97
+
98
+
99
+ request_headers = {}
100
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
101
+
102
+ # Set Headers
103
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
104
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
105
+
106
+ # Serialize Request
107
+ request_mapper = Azure::EventHub::Mgmt::V2014_09_01::Models::ConsumerGroupCreateOrUpdateParameters.mapper()
108
+ request_content = @client.serialize(request_mapper, parameters)
109
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
110
+
111
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/consumergroups/{consumerGroupName}'
112
+
113
+ request_url = @base_url || @client.base_url
114
+
115
+ options = {
116
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
117
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'eventHubName' => event_hub_name,'consumerGroupName' => consumer_group_name,'subscriptionId' => @client.subscription_id},
118
+ query_params: {'api-version' => @client.api_version},
119
+ body: request_content,
120
+ headers: request_headers.merge(custom_headers || {}),
121
+ base_url: request_url
122
+ }
123
+ promise = @client.make_request_async(:put, path_template, options)
124
+
125
+ promise = promise.then do |result|
126
+ http_response = result.response
127
+ status_code = http_response.status
128
+ response_content = http_response.body
129
+ unless status_code == 200
130
+ error_model = JSON.load(response_content)
131
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
132
+ end
133
+
134
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
135
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
136
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
137
+ # Deserialize Response
138
+ if status_code == 200
139
+ begin
140
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
141
+ result_mapper = Azure::EventHub::Mgmt::V2014_09_01::Models::ConsumerGroupResource.mapper()
142
+ result.body = @client.deserialize(result_mapper, parsed_response)
143
+ rescue Exception => e
144
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
145
+ end
146
+ end
147
+
148
+ result
149
+ end
150
+
151
+ promise.execute
152
+ end
153
+
154
+ #
155
+ # Deletes a consumer group from the specified Event Hub and resource group.
156
+ #
157
+ # @param resource_group_name [String] Name of the resource group within the
158
+ # azure subscription.
159
+ # @param namespace_name [String] The Namespace name
160
+ # @param event_hub_name [String] The Event Hub name
161
+ # @param consumer_group_name [String] The consumer group name
162
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
163
+ # will be added to the HTTP request.
164
+ #
165
+ #
166
+ def delete(resource_group_name, namespace_name, event_hub_name, consumer_group_name, custom_headers:nil)
167
+ response = delete_async(resource_group_name, namespace_name, event_hub_name, consumer_group_name, custom_headers:custom_headers).value!
168
+ nil
169
+ end
170
+
171
+ #
172
+ # Deletes a consumer group from the specified Event Hub and resource group.
173
+ #
174
+ # @param resource_group_name [String] Name of the resource group within the
175
+ # azure subscription.
176
+ # @param namespace_name [String] The Namespace name
177
+ # @param event_hub_name [String] The Event Hub name
178
+ # @param consumer_group_name [String] The consumer group name
179
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
180
+ # will be added to the HTTP request.
181
+ #
182
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
183
+ #
184
+ def delete_with_http_info(resource_group_name, namespace_name, event_hub_name, consumer_group_name, custom_headers:nil)
185
+ delete_async(resource_group_name, namespace_name, event_hub_name, consumer_group_name, custom_headers:custom_headers).value!
186
+ end
187
+
188
+ #
189
+ # Deletes a consumer group from the specified Event Hub and resource group.
190
+ #
191
+ # @param resource_group_name [String] Name of the resource group within the
192
+ # azure subscription.
193
+ # @param namespace_name [String] The Namespace name
194
+ # @param event_hub_name [String] The Event Hub name
195
+ # @param consumer_group_name [String] The consumer group name
196
+ # @param [Hash{String => String}] A hash of custom headers that will be added
197
+ # to the HTTP request.
198
+ #
199
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
200
+ #
201
+ def delete_async(resource_group_name, namespace_name, event_hub_name, consumer_group_name, custom_headers:nil)
202
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
203
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
204
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
205
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
206
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
207
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
208
+ fail ArgumentError, 'event_hub_name is nil' if event_hub_name.nil?
209
+ fail ArgumentError, "'event_hub_name' should satisfy the constraint - 'MaxLength': '50'" if !event_hub_name.nil? && event_hub_name.length > 50
210
+ fail ArgumentError, "'event_hub_name' should satisfy the constraint - 'MinLength': '1'" if !event_hub_name.nil? && event_hub_name.length < 1
211
+ fail ArgumentError, 'consumer_group_name is nil' if consumer_group_name.nil?
212
+ fail ArgumentError, "'consumer_group_name' should satisfy the constraint - 'MaxLength': '50'" if !consumer_group_name.nil? && consumer_group_name.length > 50
213
+ fail ArgumentError, "'consumer_group_name' should satisfy the constraint - 'MinLength': '1'" if !consumer_group_name.nil? && consumer_group_name.length < 1
214
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
215
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
216
+
217
+
218
+ request_headers = {}
219
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
220
+
221
+ # Set Headers
222
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
223
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
224
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/consumergroups/{consumerGroupName}'
225
+
226
+ request_url = @base_url || @client.base_url
227
+
228
+ options = {
229
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
230
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'eventHubName' => event_hub_name,'consumerGroupName' => consumer_group_name,'subscriptionId' => @client.subscription_id},
231
+ query_params: {'api-version' => @client.api_version},
232
+ headers: request_headers.merge(custom_headers || {}),
233
+ base_url: request_url
234
+ }
235
+ promise = @client.make_request_async(:delete, path_template, options)
236
+
237
+ promise = promise.then do |result|
238
+ http_response = result.response
239
+ status_code = http_response.status
240
+ response_content = http_response.body
241
+ unless status_code == 204 || status_code == 200
242
+ error_model = JSON.load(response_content)
243
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
244
+ end
245
+
246
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
247
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
248
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
249
+
250
+ result
251
+ end
252
+
253
+ promise.execute
254
+ end
255
+
256
+ #
257
+ # Gets a description for the specified consumer group.
258
+ #
259
+ # @param resource_group_name [String] Name of the resource group within the
260
+ # azure subscription.
261
+ # @param namespace_name [String] The Namespace name
262
+ # @param event_hub_name [String] The Event Hub name
263
+ # @param consumer_group_name [String] The consumer group 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 [ConsumerGroupResource] operation results.
268
+ #
269
+ def get(resource_group_name, namespace_name, event_hub_name, consumer_group_name, custom_headers:nil)
270
+ response = get_async(resource_group_name, namespace_name, event_hub_name, consumer_group_name, custom_headers:custom_headers).value!
271
+ response.body unless response.nil?
272
+ end
273
+
274
+ #
275
+ # Gets a description for the specified consumer group.
276
+ #
277
+ # @param resource_group_name [String] Name of the resource group within the
278
+ # azure subscription.
279
+ # @param namespace_name [String] The Namespace name
280
+ # @param event_hub_name [String] The Event Hub name
281
+ # @param consumer_group_name [String] The consumer group name
282
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
283
+ # will be added to the HTTP request.
284
+ #
285
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
286
+ #
287
+ def get_with_http_info(resource_group_name, namespace_name, event_hub_name, consumer_group_name, custom_headers:nil)
288
+ get_async(resource_group_name, namespace_name, event_hub_name, consumer_group_name, custom_headers:custom_headers).value!
289
+ end
290
+
291
+ #
292
+ # Gets a description for the specified consumer group.
293
+ #
294
+ # @param resource_group_name [String] Name of the resource group within the
295
+ # azure subscription.
296
+ # @param namespace_name [String] The Namespace name
297
+ # @param event_hub_name [String] The Event Hub name
298
+ # @param consumer_group_name [String] The consumer group name
299
+ # @param [Hash{String => String}] A hash of custom headers that will be added
300
+ # to the HTTP request.
301
+ #
302
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
303
+ #
304
+ def get_async(resource_group_name, namespace_name, event_hub_name, consumer_group_name, custom_headers:nil)
305
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
306
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
307
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
308
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
309
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
310
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
311
+ fail ArgumentError, 'event_hub_name is nil' if event_hub_name.nil?
312
+ fail ArgumentError, "'event_hub_name' should satisfy the constraint - 'MaxLength': '50'" if !event_hub_name.nil? && event_hub_name.length > 50
313
+ fail ArgumentError, "'event_hub_name' should satisfy the constraint - 'MinLength': '1'" if !event_hub_name.nil? && event_hub_name.length < 1
314
+ fail ArgumentError, 'consumer_group_name is nil' if consumer_group_name.nil?
315
+ fail ArgumentError, "'consumer_group_name' should satisfy the constraint - 'MaxLength': '50'" if !consumer_group_name.nil? && consumer_group_name.length > 50
316
+ fail ArgumentError, "'consumer_group_name' should satisfy the constraint - 'MinLength': '1'" if !consumer_group_name.nil? && consumer_group_name.length < 1
317
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
318
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
319
+
320
+
321
+ request_headers = {}
322
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
323
+
324
+ # Set Headers
325
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
326
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
327
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/consumergroups/{consumerGroupName}'
328
+
329
+ request_url = @base_url || @client.base_url
330
+
331
+ options = {
332
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
333
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'eventHubName' => event_hub_name,'consumerGroupName' => consumer_group_name,'subscriptionId' => @client.subscription_id},
334
+ query_params: {'api-version' => @client.api_version},
335
+ headers: request_headers.merge(custom_headers || {}),
336
+ base_url: request_url
337
+ }
338
+ promise = @client.make_request_async(:get, path_template, options)
339
+
340
+ promise = promise.then do |result|
341
+ http_response = result.response
342
+ status_code = http_response.status
343
+ response_content = http_response.body
344
+ unless status_code == 200
345
+ error_model = JSON.load(response_content)
346
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
347
+ end
348
+
349
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
350
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
351
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
352
+ # Deserialize Response
353
+ if status_code == 200
354
+ begin
355
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
356
+ result_mapper = Azure::EventHub::Mgmt::V2014_09_01::Models::ConsumerGroupResource.mapper()
357
+ result.body = @client.deserialize(result_mapper, parsed_response)
358
+ rescue Exception => e
359
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
360
+ end
361
+ end
362
+
363
+ result
364
+ end
365
+
366
+ promise.execute
367
+ end
368
+
369
+ #
370
+ # Gets all the consumer groups in a Namespace. An empty feed is returned if no
371
+ # consumer group exists in the Namespace.
372
+ #
373
+ # @param resource_group_name [String] Name of the resource group within the
374
+ # azure subscription.
375
+ # @param namespace_name [String] The Namespace name
376
+ # @param event_hub_name [String] The Event Hub name
377
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
378
+ # will be added to the HTTP request.
379
+ #
380
+ # @return [Array<ConsumerGroupResource>] operation results.
381
+ #
382
+ def list_all(resource_group_name, namespace_name, event_hub_name, custom_headers:nil)
383
+ first_page = list_all_as_lazy(resource_group_name, namespace_name, event_hub_name, custom_headers:custom_headers)
384
+ first_page.get_all_items
385
+ end
386
+
387
+ #
388
+ # Gets all the consumer groups in a Namespace. An empty feed is returned if no
389
+ # consumer group exists in the Namespace.
390
+ #
391
+ # @param resource_group_name [String] Name of the resource group within the
392
+ # azure subscription.
393
+ # @param namespace_name [String] The Namespace name
394
+ # @param event_hub_name [String] The Event Hub name
395
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
396
+ # will be added to the HTTP request.
397
+ #
398
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
399
+ #
400
+ def list_all_with_http_info(resource_group_name, namespace_name, event_hub_name, custom_headers:nil)
401
+ list_all_async(resource_group_name, namespace_name, event_hub_name, custom_headers:custom_headers).value!
402
+ end
403
+
404
+ #
405
+ # Gets all the consumer groups in a Namespace. An empty feed is returned if no
406
+ # consumer group exists in the Namespace.
407
+ #
408
+ # @param resource_group_name [String] Name of the resource group within the
409
+ # azure subscription.
410
+ # @param namespace_name [String] The Namespace name
411
+ # @param event_hub_name [String] The Event Hub name
412
+ # @param [Hash{String => String}] A hash of custom headers that will be added
413
+ # to the HTTP request.
414
+ #
415
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
416
+ #
417
+ def list_all_async(resource_group_name, namespace_name, event_hub_name, custom_headers:nil)
418
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
419
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
420
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
421
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
422
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
423
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
424
+ fail ArgumentError, 'event_hub_name is nil' if event_hub_name.nil?
425
+ fail ArgumentError, "'event_hub_name' should satisfy the constraint - 'MaxLength': '50'" if !event_hub_name.nil? && event_hub_name.length > 50
426
+ fail ArgumentError, "'event_hub_name' should satisfy the constraint - 'MinLength': '1'" if !event_hub_name.nil? && event_hub_name.length < 1
427
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
428
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
429
+
430
+
431
+ request_headers = {}
432
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
433
+
434
+ # Set Headers
435
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
436
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
437
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/consumergroups'
438
+
439
+ request_url = @base_url || @client.base_url
440
+
441
+ options = {
442
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
443
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'eventHubName' => event_hub_name,'subscriptionId' => @client.subscription_id},
444
+ query_params: {'api-version' => @client.api_version},
445
+ headers: request_headers.merge(custom_headers || {}),
446
+ base_url: request_url
447
+ }
448
+ promise = @client.make_request_async(:get, path_template, options)
449
+
450
+ promise = promise.then do |result|
451
+ http_response = result.response
452
+ status_code = http_response.status
453
+ response_content = http_response.body
454
+ unless status_code == 200
455
+ error_model = JSON.load(response_content)
456
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
457
+ end
458
+
459
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
460
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
461
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
462
+ # Deserialize Response
463
+ if status_code == 200
464
+ begin
465
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
466
+ result_mapper = Azure::EventHub::Mgmt::V2014_09_01::Models::ConsumerGroupListResult.mapper()
467
+ result.body = @client.deserialize(result_mapper, parsed_response)
468
+ rescue Exception => e
469
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
470
+ end
471
+ end
472
+
473
+ result
474
+ end
475
+
476
+ promise.execute
477
+ end
478
+
479
+ #
480
+ # Gets all the consumer groups in a Namespace. An empty feed is returned if no
481
+ # consumer group exists in the Namespace.
482
+ #
483
+ # @param next_page_link [String] The NextLink from the previous successful call
484
+ # to List operation.
485
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
486
+ # will be added to the HTTP request.
487
+ #
488
+ # @return [ConsumerGroupListResult] operation results.
489
+ #
490
+ def list_all_next(next_page_link, custom_headers:nil)
491
+ response = list_all_next_async(next_page_link, custom_headers:custom_headers).value!
492
+ response.body unless response.nil?
493
+ end
494
+
495
+ #
496
+ # Gets all the consumer groups in a Namespace. An empty feed is returned if no
497
+ # consumer group exists in the Namespace.
498
+ #
499
+ # @param next_page_link [String] The NextLink from the previous successful call
500
+ # to List operation.
501
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
502
+ # will be added to the HTTP request.
503
+ #
504
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
505
+ #
506
+ def list_all_next_with_http_info(next_page_link, custom_headers:nil)
507
+ list_all_next_async(next_page_link, custom_headers:custom_headers).value!
508
+ end
509
+
510
+ #
511
+ # Gets all the consumer groups in a Namespace. An empty feed is returned if no
512
+ # consumer group exists in the Namespace.
513
+ #
514
+ # @param next_page_link [String] The NextLink from the previous successful call
515
+ # to List operation.
516
+ # @param [Hash{String => String}] A hash of custom headers that will be added
517
+ # to the HTTP request.
518
+ #
519
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
520
+ #
521
+ def list_all_next_async(next_page_link, custom_headers:nil)
522
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
523
+
524
+
525
+ request_headers = {}
526
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
527
+
528
+ # Set Headers
529
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
530
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
531
+ path_template = '{nextLink}'
532
+
533
+ request_url = @base_url || @client.base_url
534
+
535
+ options = {
536
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
537
+ skip_encoding_path_params: {'nextLink' => next_page_link},
538
+ headers: request_headers.merge(custom_headers || {}),
539
+ base_url: request_url
540
+ }
541
+ promise = @client.make_request_async(:get, path_template, options)
542
+
543
+ promise = promise.then do |result|
544
+ http_response = result.response
545
+ status_code = http_response.status
546
+ response_content = http_response.body
547
+ unless status_code == 200
548
+ error_model = JSON.load(response_content)
549
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
550
+ end
551
+
552
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
553
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
554
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
555
+ # Deserialize Response
556
+ if status_code == 200
557
+ begin
558
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
559
+ result_mapper = Azure::EventHub::Mgmt::V2014_09_01::Models::ConsumerGroupListResult.mapper()
560
+ result.body = @client.deserialize(result_mapper, parsed_response)
561
+ rescue Exception => e
562
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
563
+ end
564
+ end
565
+
566
+ result
567
+ end
568
+
569
+ promise.execute
570
+ end
571
+
572
+ #
573
+ # Gets all the consumer groups in a Namespace. An empty feed is returned if no
574
+ # consumer group exists in the Namespace.
575
+ #
576
+ # @param resource_group_name [String] Name of the resource group within the
577
+ # azure subscription.
578
+ # @param namespace_name [String] The Namespace name
579
+ # @param event_hub_name [String] The Event Hub name
580
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
581
+ # will be added to the HTTP request.
582
+ #
583
+ # @return [ConsumerGroupListResult] which provide lazy access to pages of the
584
+ # response.
585
+ #
586
+ def list_all_as_lazy(resource_group_name, namespace_name, event_hub_name, custom_headers:nil)
587
+ response = list_all_async(resource_group_name, namespace_name, event_hub_name, custom_headers:custom_headers).value!
588
+ unless response.nil?
589
+ page = response.body
590
+ page.next_method = Proc.new do |next_page_link|
591
+ list_all_next_async(next_page_link, custom_headers:custom_headers)
592
+ end
593
+ page
594
+ end
595
+ end
596
+
597
+ end
598
+ end