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
@@ -0,0 +1,90 @@
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
+ module Models
8
+ #
9
+ # Single item in a List or Get AuthorizationRule operation
10
+ #
11
+ class SharedAccessAuthorizationRuleResource < Resource
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [Array<AccessRights>] The rights associated with the rule.
16
+ attr_accessor :rights
17
+
18
+
19
+ #
20
+ # Mapper for SharedAccessAuthorizationRuleResource class as Ruby Hash.
21
+ # This will be used for serialization/deserialization.
22
+ #
23
+ def self.mapper()
24
+ {
25
+ client_side_validation: true,
26
+ required: false,
27
+ serialized_name: 'SharedAccessAuthorizationRuleResource',
28
+ type: {
29
+ name: 'Composite',
30
+ class_name: 'SharedAccessAuthorizationRuleResource',
31
+ model_properties: {
32
+ id: {
33
+ client_side_validation: true,
34
+ required: false,
35
+ read_only: true,
36
+ serialized_name: 'id',
37
+ type: {
38
+ name: 'String'
39
+ }
40
+ },
41
+ name: {
42
+ client_side_validation: true,
43
+ required: false,
44
+ read_only: true,
45
+ serialized_name: 'name',
46
+ type: {
47
+ name: 'String'
48
+ }
49
+ },
50
+ location: {
51
+ client_side_validation: true,
52
+ required: false,
53
+ serialized_name: 'location',
54
+ type: {
55
+ name: 'String'
56
+ }
57
+ },
58
+ type: {
59
+ client_side_validation: true,
60
+ required: false,
61
+ read_only: true,
62
+ serialized_name: 'type',
63
+ type: {
64
+ name: 'String'
65
+ }
66
+ },
67
+ rights: {
68
+ client_side_validation: true,
69
+ required: true,
70
+ serialized_name: 'properties.rights',
71
+ type: {
72
+ name: 'Sequence',
73
+ element: {
74
+ client_side_validation: true,
75
+ required: false,
76
+ serialized_name: 'AccessRightsElementType',
77
+ type: {
78
+ name: 'Enum',
79
+ module: 'AccessRights'
80
+ }
81
+ }
82
+ }
83
+ }
84
+ }
85
+ }
86
+ }
87
+ end
88
+ end
89
+ end
90
+ end
@@ -0,0 +1,70 @@
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
+ module Models
8
+ #
9
+ # SKU parameters supplied to the create Namespace operation
10
+ #
11
+ class Sku
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [SkuName] Name of this SKU. Possible values include: 'Basic',
16
+ # 'Standard'
17
+ attr_accessor :name
18
+
19
+ # @return [SkuTier] The billing tier of this particular SKU. Possible
20
+ # values include: 'Basic', 'Standard', 'Premium'
21
+ attr_accessor :tier
22
+
23
+ # @return [Integer] The Event Hubs throughput units.
24
+ attr_accessor :capacity
25
+
26
+
27
+ #
28
+ # Mapper for Sku class as Ruby Hash.
29
+ # This will be used for serialization/deserialization.
30
+ #
31
+ def self.mapper()
32
+ {
33
+ client_side_validation: true,
34
+ required: false,
35
+ serialized_name: 'Sku',
36
+ type: {
37
+ name: 'Composite',
38
+ class_name: 'Sku',
39
+ model_properties: {
40
+ name: {
41
+ client_side_validation: true,
42
+ required: false,
43
+ serialized_name: 'name',
44
+ type: {
45
+ name: 'String'
46
+ }
47
+ },
48
+ tier: {
49
+ client_side_validation: true,
50
+ required: true,
51
+ serialized_name: 'tier',
52
+ type: {
53
+ name: 'String'
54
+ }
55
+ },
56
+ capacity: {
57
+ client_side_validation: true,
58
+ required: false,
59
+ serialized_name: 'capacity',
60
+ type: {
61
+ name: 'Number'
62
+ }
63
+ }
64
+ }
65
+ }
66
+ }
67
+ end
68
+ end
69
+ end
70
+ end
@@ -0,0 +1,16 @@
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
+ module Models
8
+ #
9
+ # Defines values for SkuName
10
+ #
11
+ module SkuName
12
+ Basic = "Basic"
13
+ Standard = "Standard"
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,17 @@
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
+ module Models
8
+ #
9
+ # Defines values for SkuTier
10
+ #
11
+ module SkuTier
12
+ Basic = "Basic"
13
+ Standard = "Standard"
14
+ Premium = "Premium"
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,89 @@
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
+ module Models
8
+ #
9
+ # Definition of Resource
10
+ #
11
+ class TrackedResource < Resource
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [Hash{String => String}] Resource tags
16
+ attr_accessor :tags
17
+
18
+
19
+ #
20
+ # Mapper for TrackedResource class as Ruby Hash.
21
+ # This will be used for serialization/deserialization.
22
+ #
23
+ def self.mapper()
24
+ {
25
+ client_side_validation: true,
26
+ required: false,
27
+ serialized_name: 'TrackedResource',
28
+ type: {
29
+ name: 'Composite',
30
+ class_name: 'TrackedResource',
31
+ model_properties: {
32
+ id: {
33
+ client_side_validation: true,
34
+ required: false,
35
+ read_only: true,
36
+ serialized_name: 'id',
37
+ type: {
38
+ name: 'String'
39
+ }
40
+ },
41
+ name: {
42
+ client_side_validation: true,
43
+ required: false,
44
+ read_only: true,
45
+ serialized_name: 'name',
46
+ type: {
47
+ name: 'String'
48
+ }
49
+ },
50
+ location: {
51
+ client_side_validation: true,
52
+ required: false,
53
+ serialized_name: 'location',
54
+ type: {
55
+ name: 'String'
56
+ }
57
+ },
58
+ type: {
59
+ client_side_validation: true,
60
+ required: false,
61
+ read_only: true,
62
+ serialized_name: 'type',
63
+ type: {
64
+ name: 'String'
65
+ }
66
+ },
67
+ tags: {
68
+ client_side_validation: true,
69
+ required: false,
70
+ serialized_name: 'tags',
71
+ type: {
72
+ name: 'Dictionary',
73
+ value: {
74
+ client_side_validation: true,
75
+ required: false,
76
+ serialized_name: 'StringElementType',
77
+ type: {
78
+ name: 'String'
79
+ }
80
+ }
81
+ }
82
+ }
83
+ }
84
+ }
85
+ }
86
+ end
87
+ end
88
+ end
89
+ end
@@ -0,0 +1,20 @@
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
+ module Models
8
+ #
9
+ # Defines values for UnavailableReason
10
+ #
11
+ module UnavailableReason
12
+ None = "None"
13
+ InvalidName = "InvalidName"
14
+ SubscriptionIsDisabled = "SubscriptionIsDisabled"
15
+ NameInUse = "NameInUse"
16
+ NameInLockdown = "NameInLockdown"
17
+ TooManyNamespaceInCurrentSubscription = "TooManyNamespaceInCurrentSubscription"
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,9 @@
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 end
7
+ module Azure::EventHub end
8
+ module Azure::EventHub::Mgmt end
9
+ module Azure::EventHub::Mgmt::V2014_09_01 end
@@ -0,0 +1,2044 @@
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 Namespaces
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Namespaces 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
+ # Check the give Namespace name availability.
26
+ #
27
+ # @param parameters [CheckNameAvailabilityParameter] Parameters to check
28
+ # availability of the given Namespace name
29
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
30
+ # will be added to the HTTP request.
31
+ #
32
+ # @return [CheckNameAvailabilityResult] operation results.
33
+ #
34
+ def check_name_availability(parameters, custom_headers:nil)
35
+ response = check_name_availability_async(parameters, custom_headers:custom_headers).value!
36
+ response.body unless response.nil?
37
+ end
38
+
39
+ #
40
+ # Check the give Namespace name availability.
41
+ #
42
+ # @param parameters [CheckNameAvailabilityParameter] Parameters to check
43
+ # availability of the given Namespace name
44
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
45
+ # will be added to the HTTP request.
46
+ #
47
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
48
+ #
49
+ def check_name_availability_with_http_info(parameters, custom_headers:nil)
50
+ check_name_availability_async(parameters, custom_headers:custom_headers).value!
51
+ end
52
+
53
+ #
54
+ # Check the give Namespace name availability.
55
+ #
56
+ # @param parameters [CheckNameAvailabilityParameter] Parameters to check
57
+ # availability of the given Namespace name
58
+ # @param [Hash{String => String}] A hash of custom headers that will be added
59
+ # to the HTTP request.
60
+ #
61
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
62
+ #
63
+ def check_name_availability_async(parameters, custom_headers:nil)
64
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
65
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
66
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
67
+
68
+
69
+ request_headers = {}
70
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
71
+
72
+ # Set Headers
73
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
74
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
75
+
76
+ # Serialize Request
77
+ request_mapper = Azure::EventHub::Mgmt::V2014_09_01::Models::CheckNameAvailabilityParameter.mapper()
78
+ request_content = @client.serialize(request_mapper, parameters)
79
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
80
+
81
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.EventHub/CheckNameAvailability'
82
+
83
+ request_url = @base_url || @client.base_url
84
+
85
+ options = {
86
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
87
+ path_params: {'subscriptionId' => @client.subscription_id},
88
+ query_params: {'api-version' => @client.api_version},
89
+ body: request_content,
90
+ headers: request_headers.merge(custom_headers || {}),
91
+ base_url: request_url
92
+ }
93
+ promise = @client.make_request_async(:post, path_template, options)
94
+
95
+ promise = promise.then do |result|
96
+ http_response = result.response
97
+ status_code = http_response.status
98
+ response_content = http_response.body
99
+ unless status_code == 200
100
+ error_model = JSON.load(response_content)
101
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
102
+ end
103
+
104
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
105
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
106
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
107
+ # Deserialize Response
108
+ if status_code == 200
109
+ begin
110
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
111
+ result_mapper = Azure::EventHub::Mgmt::V2014_09_01::Models::CheckNameAvailabilityResult.mapper()
112
+ result.body = @client.deserialize(result_mapper, parsed_response)
113
+ rescue Exception => e
114
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
115
+ end
116
+ end
117
+
118
+ result
119
+ end
120
+
121
+ promise.execute
122
+ end
123
+
124
+ #
125
+ # Check the give Namespace name availability.
126
+ #
127
+ # @param parameters [CheckNameAvailabilityParameter] Parameters to check
128
+ # availability of the given Namespace name
129
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
130
+ # will be added to the HTTP request.
131
+ #
132
+ # @return [CheckNameAvailabilityResult] operation results.
133
+ #
134
+ def check_name_space_availability(parameters, custom_headers:nil)
135
+ response = check_name_space_availability_async(parameters, custom_headers:custom_headers).value!
136
+ response.body unless response.nil?
137
+ end
138
+
139
+ #
140
+ # Check the give Namespace name availability.
141
+ #
142
+ # @param parameters [CheckNameAvailabilityParameter] Parameters to check
143
+ # availability of the given Namespace name
144
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
145
+ # will be added to the HTTP request.
146
+ #
147
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
148
+ #
149
+ def check_name_space_availability_with_http_info(parameters, custom_headers:nil)
150
+ check_name_space_availability_async(parameters, custom_headers:custom_headers).value!
151
+ end
152
+
153
+ #
154
+ # Check the give Namespace name availability.
155
+ #
156
+ # @param parameters [CheckNameAvailabilityParameter] Parameters to check
157
+ # availability of the given Namespace name
158
+ # @param [Hash{String => String}] A hash of custom headers that will be added
159
+ # to the HTTP request.
160
+ #
161
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
162
+ #
163
+ def check_name_space_availability_async(parameters, custom_headers:nil)
164
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
165
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
166
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
167
+
168
+
169
+ request_headers = {}
170
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
171
+
172
+ # Set Headers
173
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
174
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
175
+
176
+ # Serialize Request
177
+ request_mapper = Azure::EventHub::Mgmt::V2014_09_01::Models::CheckNameAvailabilityParameter.mapper()
178
+ request_content = @client.serialize(request_mapper, parameters)
179
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
180
+
181
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.EventHub/CheckNamespaceAvailability'
182
+
183
+ request_url = @base_url || @client.base_url
184
+
185
+ options = {
186
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
187
+ path_params: {'subscriptionId' => @client.subscription_id},
188
+ query_params: {'api-version' => @client.api_version},
189
+ body: request_content,
190
+ headers: request_headers.merge(custom_headers || {}),
191
+ base_url: request_url
192
+ }
193
+ promise = @client.make_request_async(:post, path_template, options)
194
+
195
+ promise = promise.then do |result|
196
+ http_response = result.response
197
+ status_code = http_response.status
198
+ response_content = http_response.body
199
+ unless status_code == 200
200
+ error_model = JSON.load(response_content)
201
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
202
+ end
203
+
204
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
205
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
206
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
207
+ # Deserialize Response
208
+ if status_code == 200
209
+ begin
210
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
211
+ result_mapper = Azure::EventHub::Mgmt::V2014_09_01::Models::CheckNameAvailabilityResult.mapper()
212
+ result.body = @client.deserialize(result_mapper, parsed_response)
213
+ rescue Exception => e
214
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
215
+ end
216
+ end
217
+
218
+ result
219
+ end
220
+
221
+ promise.execute
222
+ end
223
+
224
+ #
225
+ # Lists all the available Namespaces within a subscription, irrespective of the
226
+ # resource groups.
227
+ #
228
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
229
+ # will be added to the HTTP request.
230
+ #
231
+ # @return [Array<NamespaceResource>] operation results.
232
+ #
233
+ def list_by_subscription(custom_headers:nil)
234
+ first_page = list_by_subscription_as_lazy(custom_headers:custom_headers)
235
+ first_page.get_all_items
236
+ end
237
+
238
+ #
239
+ # Lists all the available Namespaces within a subscription, irrespective of the
240
+ # resource groups.
241
+ #
242
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
243
+ # will be added to the HTTP request.
244
+ #
245
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
246
+ #
247
+ def list_by_subscription_with_http_info(custom_headers:nil)
248
+ list_by_subscription_async(custom_headers:custom_headers).value!
249
+ end
250
+
251
+ #
252
+ # Lists all the available Namespaces within a subscription, irrespective of the
253
+ # resource groups.
254
+ #
255
+ # @param [Hash{String => String}] A hash of custom headers that will be added
256
+ # to the HTTP request.
257
+ #
258
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
259
+ #
260
+ def list_by_subscription_async(custom_headers:nil)
261
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
262
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
263
+
264
+
265
+ request_headers = {}
266
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
267
+
268
+ # Set Headers
269
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
270
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
271
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.EventHub/namespaces'
272
+
273
+ request_url = @base_url || @client.base_url
274
+
275
+ options = {
276
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
277
+ path_params: {'subscriptionId' => @client.subscription_id},
278
+ query_params: {'api-version' => @client.api_version},
279
+ headers: request_headers.merge(custom_headers || {}),
280
+ base_url: request_url
281
+ }
282
+ promise = @client.make_request_async(:get, path_template, options)
283
+
284
+ promise = promise.then do |result|
285
+ http_response = result.response
286
+ status_code = http_response.status
287
+ response_content = http_response.body
288
+ unless status_code == 200
289
+ error_model = JSON.load(response_content)
290
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
291
+ end
292
+
293
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
294
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
295
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
296
+ # Deserialize Response
297
+ if status_code == 200
298
+ begin
299
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
300
+ result_mapper = Azure::EventHub::Mgmt::V2014_09_01::Models::NamespaceListResult.mapper()
301
+ result.body = @client.deserialize(result_mapper, parsed_response)
302
+ rescue Exception => e
303
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
304
+ end
305
+ end
306
+
307
+ result
308
+ end
309
+
310
+ promise.execute
311
+ end
312
+
313
+ #
314
+ # Lists the available Namespaces within a resource group.
315
+ #
316
+ # @param resource_group_name [String] Name of the resource group within the
317
+ # azure subscription.
318
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
319
+ # will be added to the HTTP request.
320
+ #
321
+ # @return [Array<NamespaceResource>] operation results.
322
+ #
323
+ def list_by_resource_group(resource_group_name, custom_headers:nil)
324
+ first_page = list_by_resource_group_as_lazy(resource_group_name, custom_headers:custom_headers)
325
+ first_page.get_all_items
326
+ end
327
+
328
+ #
329
+ # Lists the available Namespaces within a resource group.
330
+ #
331
+ # @param resource_group_name [String] Name of the resource group within the
332
+ # azure subscription.
333
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
334
+ # will be added to the HTTP request.
335
+ #
336
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
337
+ #
338
+ def list_by_resource_group_with_http_info(resource_group_name, custom_headers:nil)
339
+ list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
340
+ end
341
+
342
+ #
343
+ # Lists the available Namespaces within a resource group.
344
+ #
345
+ # @param resource_group_name [String] Name of the resource group within the
346
+ # azure subscription.
347
+ # @param [Hash{String => String}] A hash of custom headers that will be added
348
+ # to the HTTP request.
349
+ #
350
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
351
+ #
352
+ def list_by_resource_group_async(resource_group_name, custom_headers:nil)
353
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
354
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
355
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
356
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
357
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
358
+
359
+
360
+ request_headers = {}
361
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
362
+
363
+ # Set Headers
364
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
365
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
366
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces'
367
+
368
+ request_url = @base_url || @client.base_url
369
+
370
+ options = {
371
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
372
+ path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
373
+ query_params: {'api-version' => @client.api_version},
374
+ headers: request_headers.merge(custom_headers || {}),
375
+ base_url: request_url
376
+ }
377
+ promise = @client.make_request_async(:get, path_template, options)
378
+
379
+ promise = promise.then do |result|
380
+ http_response = result.response
381
+ status_code = http_response.status
382
+ response_content = http_response.body
383
+ unless status_code == 200
384
+ error_model = JSON.load(response_content)
385
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
386
+ end
387
+
388
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
389
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
390
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
391
+ # Deserialize Response
392
+ if status_code == 200
393
+ begin
394
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
395
+ result_mapper = Azure::EventHub::Mgmt::V2014_09_01::Models::NamespaceListResult.mapper()
396
+ result.body = @client.deserialize(result_mapper, parsed_response)
397
+ rescue Exception => e
398
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
399
+ end
400
+ end
401
+
402
+ result
403
+ end
404
+
405
+ promise.execute
406
+ end
407
+
408
+ #
409
+ # Creates or updates a namespace. Once created, this namespace's resource
410
+ # manifest is immutable. This operation is idempotent.
411
+ #
412
+ # @param resource_group_name [String] Name of the resource group within the
413
+ # azure subscription.
414
+ # @param namespace_name [String] The Namespace name
415
+ # @param parameters [NamespaceCreateOrUpdateParameters] Parameters for creating
416
+ # a namespace resource.
417
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
418
+ # will be added to the HTTP request.
419
+ #
420
+ # @return [NamespaceResource] operation results.
421
+ #
422
+ def create_or_update(resource_group_name, namespace_name, parameters, custom_headers:nil)
423
+ response = create_or_update_async(resource_group_name, namespace_name, parameters, custom_headers:custom_headers).value!
424
+ response.body unless response.nil?
425
+ end
426
+
427
+ #
428
+ # @param resource_group_name [String] Name of the resource group within the
429
+ # azure subscription.
430
+ # @param namespace_name [String] The Namespace name
431
+ # @param parameters [NamespaceCreateOrUpdateParameters] Parameters for creating
432
+ # a namespace resource.
433
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
434
+ # will be added to the HTTP request.
435
+ #
436
+ # @return [Concurrent::Promise] promise which provides async access to http
437
+ # response.
438
+ #
439
+ def create_or_update_async(resource_group_name, namespace_name, parameters, custom_headers:nil)
440
+ # Send request
441
+ promise = begin_create_or_update_async(resource_group_name, namespace_name, parameters, custom_headers:custom_headers)
442
+
443
+ promise = promise.then do |response|
444
+ # Defining deserialization method.
445
+ deserialize_method = lambda do |parsed_response|
446
+ result_mapper = Azure::EventHub::Mgmt::V2014_09_01::Models::NamespaceResource.mapper()
447
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
448
+ end
449
+
450
+ # Waiting for response.
451
+ @client.get_long_running_operation_result(response, deserialize_method)
452
+ end
453
+
454
+ promise
455
+ end
456
+
457
+ #
458
+ # Deletes an existing namespace. This operation also removes all associated
459
+ # resources under the namespace.
460
+ #
461
+ # @param resource_group_name [String] Name of the resource group within the
462
+ # azure subscription.
463
+ # @param namespace_name [String] The Namespace name
464
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
465
+ # will be added to the HTTP request.
466
+ #
467
+ def delete(resource_group_name, namespace_name, custom_headers:nil)
468
+ response = delete_async(resource_group_name, namespace_name, custom_headers:custom_headers).value!
469
+ nil
470
+ end
471
+
472
+ #
473
+ # @param resource_group_name [String] Name of the resource group within the
474
+ # azure subscription.
475
+ # @param namespace_name [String] The Namespace name
476
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
477
+ # will be added to the HTTP request.
478
+ #
479
+ # @return [Concurrent::Promise] promise which provides async access to http
480
+ # response.
481
+ #
482
+ def delete_async(resource_group_name, namespace_name, custom_headers:nil)
483
+ # Send request
484
+ promise = begin_delete_async(resource_group_name, namespace_name, custom_headers:custom_headers)
485
+
486
+ promise = promise.then do |response|
487
+ # Defining deserialization method.
488
+ deserialize_method = lambda do |parsed_response|
489
+ end
490
+
491
+ # Waiting for response.
492
+ @client.get_long_running_operation_result(response, deserialize_method)
493
+ end
494
+
495
+ promise
496
+ end
497
+
498
+ #
499
+ # Gets the description of the specified namespace.
500
+ #
501
+ # @param resource_group_name [String] Name of the resource group within the
502
+ # azure subscription.
503
+ # @param namespace_name [String] The Namespace name
504
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
505
+ # will be added to the HTTP request.
506
+ #
507
+ # @return [NamespaceResource] operation results.
508
+ #
509
+ def get(resource_group_name, namespace_name, custom_headers:nil)
510
+ response = get_async(resource_group_name, namespace_name, custom_headers:custom_headers).value!
511
+ response.body unless response.nil?
512
+ end
513
+
514
+ #
515
+ # Gets the description of the specified namespace.
516
+ #
517
+ # @param resource_group_name [String] Name of the resource group within the
518
+ # azure subscription.
519
+ # @param namespace_name [String] The Namespace name
520
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
521
+ # will be added to the HTTP request.
522
+ #
523
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
524
+ #
525
+ def get_with_http_info(resource_group_name, namespace_name, custom_headers:nil)
526
+ get_async(resource_group_name, namespace_name, custom_headers:custom_headers).value!
527
+ end
528
+
529
+ #
530
+ # Gets the description of the specified namespace.
531
+ #
532
+ # @param resource_group_name [String] Name of the resource group within the
533
+ # azure subscription.
534
+ # @param namespace_name [String] The Namespace name
535
+ # @param [Hash{String => String}] A hash of custom headers that will be added
536
+ # to the HTTP request.
537
+ #
538
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
539
+ #
540
+ def get_async(resource_group_name, namespace_name, custom_headers:nil)
541
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
542
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
543
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
544
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
545
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
546
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
547
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
548
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
549
+
550
+
551
+ request_headers = {}
552
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
553
+
554
+ # Set Headers
555
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
556
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
557
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}'
558
+
559
+ request_url = @base_url || @client.base_url
560
+
561
+ options = {
562
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
563
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'subscriptionId' => @client.subscription_id},
564
+ query_params: {'api-version' => @client.api_version},
565
+ headers: request_headers.merge(custom_headers || {}),
566
+ base_url: request_url
567
+ }
568
+ promise = @client.make_request_async(:get, path_template, options)
569
+
570
+ promise = promise.then do |result|
571
+ http_response = result.response
572
+ status_code = http_response.status
573
+ response_content = http_response.body
574
+ unless status_code == 200 || status_code == 201
575
+ error_model = JSON.load(response_content)
576
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
577
+ end
578
+
579
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
580
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
581
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
582
+ # Deserialize Response
583
+ if status_code == 200
584
+ begin
585
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
586
+ result_mapper = Azure::EventHub::Mgmt::V2014_09_01::Models::NamespaceResource.mapper()
587
+ result.body = @client.deserialize(result_mapper, parsed_response)
588
+ rescue Exception => e
589
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
590
+ end
591
+ end
592
+ # Deserialize Response
593
+ if status_code == 201
594
+ begin
595
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
596
+ result_mapper = Azure::EventHub::Mgmt::V2014_09_01::Models::NamespaceResource.mapper()
597
+ result.body = @client.deserialize(result_mapper, parsed_response)
598
+ rescue Exception => e
599
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
600
+ end
601
+ end
602
+
603
+ result
604
+ end
605
+
606
+ promise.execute
607
+ end
608
+
609
+ #
610
+ # Creates or updates a namespace. Once created, this namespace's resource
611
+ # manifest is immutable. This operation is idempotent.
612
+ #
613
+ # @param resource_group_name [String] Name of the resource group within the
614
+ # azure subscription.
615
+ # @param namespace_name [String] The Namespace name
616
+ # @param parameters [NamespaceUpdateParameter] Parameters for updating a
617
+ # namespace resource.
618
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
619
+ # will be added to the HTTP request.
620
+ #
621
+ # @return [NamespaceResource] operation results.
622
+ #
623
+ def update(resource_group_name, namespace_name, parameters, custom_headers:nil)
624
+ response = update_async(resource_group_name, namespace_name, parameters, custom_headers:custom_headers).value!
625
+ response.body unless response.nil?
626
+ end
627
+
628
+ #
629
+ # Creates or updates a namespace. Once created, this namespace's resource
630
+ # manifest is immutable. This operation is idempotent.
631
+ #
632
+ # @param resource_group_name [String] Name of the resource group within the
633
+ # azure subscription.
634
+ # @param namespace_name [String] The Namespace name
635
+ # @param parameters [NamespaceUpdateParameter] Parameters for updating a
636
+ # namespace resource.
637
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
638
+ # will be added to the HTTP request.
639
+ #
640
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
641
+ #
642
+ def update_with_http_info(resource_group_name, namespace_name, parameters, custom_headers:nil)
643
+ update_async(resource_group_name, namespace_name, parameters, custom_headers:custom_headers).value!
644
+ end
645
+
646
+ #
647
+ # Creates or updates a namespace. Once created, this namespace's resource
648
+ # manifest is immutable. This operation is idempotent.
649
+ #
650
+ # @param resource_group_name [String] Name of the resource group within the
651
+ # azure subscription.
652
+ # @param namespace_name [String] The Namespace name
653
+ # @param parameters [NamespaceUpdateParameter] Parameters for updating a
654
+ # namespace resource.
655
+ # @param [Hash{String => String}] A hash of custom headers that will be added
656
+ # to the HTTP request.
657
+ #
658
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
659
+ #
660
+ def update_async(resource_group_name, namespace_name, parameters, custom_headers:nil)
661
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
662
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
663
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
664
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
665
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
666
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
667
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
668
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
669
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
670
+
671
+
672
+ request_headers = {}
673
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
674
+
675
+ # Set Headers
676
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
677
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
678
+
679
+ # Serialize Request
680
+ request_mapper = Azure::EventHub::Mgmt::V2014_09_01::Models::NamespaceUpdateParameter.mapper()
681
+ request_content = @client.serialize(request_mapper, parameters)
682
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
683
+
684
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}'
685
+
686
+ request_url = @base_url || @client.base_url
687
+
688
+ options = {
689
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
690
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'subscriptionId' => @client.subscription_id},
691
+ query_params: {'api-version' => @client.api_version},
692
+ body: request_content,
693
+ headers: request_headers.merge(custom_headers || {}),
694
+ base_url: request_url
695
+ }
696
+ promise = @client.make_request_async(:patch, path_template, options)
697
+
698
+ promise = promise.then do |result|
699
+ http_response = result.response
700
+ status_code = http_response.status
701
+ response_content = http_response.body
702
+ unless status_code == 201 || status_code == 200 || status_code == 202
703
+ error_model = JSON.load(response_content)
704
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
705
+ end
706
+
707
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
708
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
709
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
710
+ # Deserialize Response
711
+ if status_code == 201
712
+ begin
713
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
714
+ result_mapper = Azure::EventHub::Mgmt::V2014_09_01::Models::NamespaceResource.mapper()
715
+ result.body = @client.deserialize(result_mapper, parsed_response)
716
+ rescue Exception => e
717
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
718
+ end
719
+ end
720
+ # Deserialize Response
721
+ if status_code == 200
722
+ begin
723
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
724
+ result_mapper = Azure::EventHub::Mgmt::V2014_09_01::Models::NamespaceResource.mapper()
725
+ result.body = @client.deserialize(result_mapper, parsed_response)
726
+ rescue Exception => e
727
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
728
+ end
729
+ end
730
+
731
+ result
732
+ end
733
+
734
+ promise.execute
735
+ end
736
+
737
+ #
738
+ # Gets a list of authorization rules for a Namespace.
739
+ #
740
+ # @param resource_group_name [String] Name of the resource group within the
741
+ # azure subscription.
742
+ # @param namespace_name [String] The Namespace name
743
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
744
+ # will be added to the HTTP request.
745
+ #
746
+ # @return [Array<SharedAccessAuthorizationRuleResource>] operation results.
747
+ #
748
+ def list_authorization_rules(resource_group_name, namespace_name, custom_headers:nil)
749
+ first_page = list_authorization_rules_as_lazy(resource_group_name, namespace_name, custom_headers:custom_headers)
750
+ first_page.get_all_items
751
+ end
752
+
753
+ #
754
+ # Gets a list of authorization rules for a Namespace.
755
+ #
756
+ # @param resource_group_name [String] Name of the resource group within the
757
+ # azure subscription.
758
+ # @param namespace_name [String] The Namespace name
759
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
760
+ # will be added to the HTTP request.
761
+ #
762
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
763
+ #
764
+ def list_authorization_rules_with_http_info(resource_group_name, namespace_name, custom_headers:nil)
765
+ list_authorization_rules_async(resource_group_name, namespace_name, custom_headers:custom_headers).value!
766
+ end
767
+
768
+ #
769
+ # Gets a list of authorization rules for a Namespace.
770
+ #
771
+ # @param resource_group_name [String] Name of the resource group within the
772
+ # azure subscription.
773
+ # @param namespace_name [String] The Namespace name
774
+ # @param [Hash{String => String}] A hash of custom headers that will be added
775
+ # to the HTTP request.
776
+ #
777
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
778
+ #
779
+ def list_authorization_rules_async(resource_group_name, namespace_name, custom_headers:nil)
780
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
781
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
782
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
783
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
784
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
785
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
786
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
787
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
788
+
789
+
790
+ request_headers = {}
791
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
792
+
793
+ # Set Headers
794
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
795
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
796
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/AuthorizationRules'
797
+
798
+ request_url = @base_url || @client.base_url
799
+
800
+ options = {
801
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
802
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'subscriptionId' => @client.subscription_id},
803
+ query_params: {'api-version' => @client.api_version},
804
+ headers: request_headers.merge(custom_headers || {}),
805
+ base_url: request_url
806
+ }
807
+ promise = @client.make_request_async(:get, path_template, options)
808
+
809
+ promise = promise.then do |result|
810
+ http_response = result.response
811
+ status_code = http_response.status
812
+ response_content = http_response.body
813
+ unless status_code == 200
814
+ error_model = JSON.load(response_content)
815
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
816
+ end
817
+
818
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
819
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
820
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
821
+ # Deserialize Response
822
+ if status_code == 200
823
+ begin
824
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
825
+ result_mapper = Azure::EventHub::Mgmt::V2014_09_01::Models::SharedAccessAuthorizationRuleListResult.mapper()
826
+ result.body = @client.deserialize(result_mapper, parsed_response)
827
+ rescue Exception => e
828
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
829
+ end
830
+ end
831
+
832
+ result
833
+ end
834
+
835
+ promise.execute
836
+ end
837
+
838
+ #
839
+ # Gets a list of authorization rules for a Namespace.
840
+ #
841
+ # @param resource_group_name [String] Name of the resource group within the
842
+ # azure subscription.
843
+ # @param namespace_name [String] The Namespace name
844
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
845
+ # will be added to the HTTP request.
846
+ #
847
+ # @return [Array<SharedAccessAuthorizationRuleResource>] operation results.
848
+ #
849
+ def list_post_authorization_rules(resource_group_name, namespace_name, custom_headers:nil)
850
+ first_page = list_post_authorization_rules_as_lazy(resource_group_name, namespace_name, custom_headers:custom_headers)
851
+ first_page.get_all_items
852
+ end
853
+
854
+ #
855
+ # Gets a list of authorization rules for a Namespace.
856
+ #
857
+ # @param resource_group_name [String] Name of the resource group within the
858
+ # azure subscription.
859
+ # @param namespace_name [String] The Namespace name
860
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
861
+ # will be added to the HTTP request.
862
+ #
863
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
864
+ #
865
+ def list_post_authorization_rules_with_http_info(resource_group_name, namespace_name, custom_headers:nil)
866
+ list_post_authorization_rules_async(resource_group_name, namespace_name, custom_headers:custom_headers).value!
867
+ end
868
+
869
+ #
870
+ # Gets a list of authorization rules for a Namespace.
871
+ #
872
+ # @param resource_group_name [String] Name of the resource group within the
873
+ # azure subscription.
874
+ # @param namespace_name [String] The Namespace name
875
+ # @param [Hash{String => String}] A hash of custom headers that will be added
876
+ # to the HTTP request.
877
+ #
878
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
879
+ #
880
+ def list_post_authorization_rules_async(resource_group_name, namespace_name, custom_headers:nil)
881
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
882
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
883
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
884
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
885
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
886
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
887
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
888
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
889
+
890
+
891
+ request_headers = {}
892
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
893
+
894
+ # Set Headers
895
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
896
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
897
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/AuthorizationRules'
898
+
899
+ request_url = @base_url || @client.base_url
900
+
901
+ options = {
902
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
903
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'subscriptionId' => @client.subscription_id},
904
+ query_params: {'api-version' => @client.api_version},
905
+ headers: request_headers.merge(custom_headers || {}),
906
+ base_url: request_url
907
+ }
908
+ promise = @client.make_request_async(:post, path_template, options)
909
+
910
+ promise = promise.then do |result|
911
+ http_response = result.response
912
+ status_code = http_response.status
913
+ response_content = http_response.body
914
+ unless status_code == 200
915
+ error_model = JSON.load(response_content)
916
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
917
+ end
918
+
919
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
920
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
921
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
922
+ # Deserialize Response
923
+ if status_code == 200
924
+ begin
925
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
926
+ result_mapper = Azure::EventHub::Mgmt::V2014_09_01::Models::SharedAccessAuthorizationRuleListResult.mapper()
927
+ result.body = @client.deserialize(result_mapper, parsed_response)
928
+ rescue Exception => e
929
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
930
+ end
931
+ end
932
+
933
+ result
934
+ end
935
+
936
+ promise.execute
937
+ end
938
+
939
+ #
940
+ # Creates or updates an AuthorizationRule for a Namespace.
941
+ #
942
+ # @param resource_group_name [String] Name of the resource group within the
943
+ # azure subscription.
944
+ # @param namespace_name [String] The Namespace name
945
+ # @param authorization_rule_name [String] The authorization rule name.
946
+ # @param parameters [SharedAccessAuthorizationRuleCreateOrUpdateParameters] The
947
+ # shared access AuthorizationRule.
948
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
949
+ # will be added to the HTTP request.
950
+ #
951
+ # @return [SharedAccessAuthorizationRuleResource] operation results.
952
+ #
953
+ def create_or_update_authorization_rule(resource_group_name, namespace_name, authorization_rule_name, parameters, custom_headers:nil)
954
+ response = create_or_update_authorization_rule_async(resource_group_name, namespace_name, authorization_rule_name, parameters, custom_headers:custom_headers).value!
955
+ response.body unless response.nil?
956
+ end
957
+
958
+ #
959
+ # Creates or updates an AuthorizationRule for a Namespace.
960
+ #
961
+ # @param resource_group_name [String] Name of the resource group within the
962
+ # azure subscription.
963
+ # @param namespace_name [String] The Namespace name
964
+ # @param authorization_rule_name [String] The authorization rule name.
965
+ # @param parameters [SharedAccessAuthorizationRuleCreateOrUpdateParameters] The
966
+ # shared access AuthorizationRule.
967
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
968
+ # will be added to the HTTP request.
969
+ #
970
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
971
+ #
972
+ def create_or_update_authorization_rule_with_http_info(resource_group_name, namespace_name, authorization_rule_name, parameters, custom_headers:nil)
973
+ create_or_update_authorization_rule_async(resource_group_name, namespace_name, authorization_rule_name, parameters, custom_headers:custom_headers).value!
974
+ end
975
+
976
+ #
977
+ # Creates or updates an AuthorizationRule for a Namespace.
978
+ #
979
+ # @param resource_group_name [String] Name of the resource group within the
980
+ # azure subscription.
981
+ # @param namespace_name [String] The Namespace name
982
+ # @param authorization_rule_name [String] The authorization rule name.
983
+ # @param parameters [SharedAccessAuthorizationRuleCreateOrUpdateParameters] The
984
+ # shared access AuthorizationRule.
985
+ # @param [Hash{String => String}] A hash of custom headers that will be added
986
+ # to the HTTP request.
987
+ #
988
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
989
+ #
990
+ def create_or_update_authorization_rule_async(resource_group_name, namespace_name, authorization_rule_name, parameters, custom_headers:nil)
991
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
992
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
993
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
994
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
995
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
996
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
997
+ fail ArgumentError, 'authorization_rule_name is nil' if authorization_rule_name.nil?
998
+ fail ArgumentError, "'authorization_rule_name' should satisfy the constraint - 'MaxLength': '50'" if !authorization_rule_name.nil? && authorization_rule_name.length > 50
999
+ fail ArgumentError, "'authorization_rule_name' should satisfy the constraint - 'MinLength': '1'" if !authorization_rule_name.nil? && authorization_rule_name.length < 1
1000
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
1001
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1002
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1003
+
1004
+
1005
+ request_headers = {}
1006
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1007
+
1008
+ # Set Headers
1009
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1010
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1011
+
1012
+ # Serialize Request
1013
+ request_mapper = Azure::EventHub::Mgmt::V2014_09_01::Models::SharedAccessAuthorizationRuleCreateOrUpdateParameters.mapper()
1014
+ request_content = @client.serialize(request_mapper, parameters)
1015
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1016
+
1017
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}'
1018
+
1019
+ request_url = @base_url || @client.base_url
1020
+
1021
+ options = {
1022
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1023
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'authorizationRuleName' => authorization_rule_name,'subscriptionId' => @client.subscription_id},
1024
+ query_params: {'api-version' => @client.api_version},
1025
+ body: request_content,
1026
+ headers: request_headers.merge(custom_headers || {}),
1027
+ base_url: request_url
1028
+ }
1029
+ promise = @client.make_request_async(:put, path_template, options)
1030
+
1031
+ promise = promise.then do |result|
1032
+ http_response = result.response
1033
+ status_code = http_response.status
1034
+ response_content = http_response.body
1035
+ unless status_code == 200
1036
+ error_model = JSON.load(response_content)
1037
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1038
+ end
1039
+
1040
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1041
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1042
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1043
+ # Deserialize Response
1044
+ if status_code == 200
1045
+ begin
1046
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1047
+ result_mapper = Azure::EventHub::Mgmt::V2014_09_01::Models::SharedAccessAuthorizationRuleResource.mapper()
1048
+ result.body = @client.deserialize(result_mapper, parsed_response)
1049
+ rescue Exception => e
1050
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1051
+ end
1052
+ end
1053
+
1054
+ result
1055
+ end
1056
+
1057
+ promise.execute
1058
+ end
1059
+
1060
+ #
1061
+ # Deletes an AuthorizationRule for a Namespace.
1062
+ #
1063
+ # @param resource_group_name [String] Name of the resource group within the
1064
+ # azure subscription.
1065
+ # @param namespace_name [String] The Namespace name
1066
+ # @param authorization_rule_name [String] The authorization rule name.
1067
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1068
+ # will be added to the HTTP request.
1069
+ #
1070
+ #
1071
+ def delete_authorization_rule(resource_group_name, namespace_name, authorization_rule_name, custom_headers:nil)
1072
+ response = delete_authorization_rule_async(resource_group_name, namespace_name, authorization_rule_name, custom_headers:custom_headers).value!
1073
+ nil
1074
+ end
1075
+
1076
+ #
1077
+ # Deletes an AuthorizationRule for a Namespace.
1078
+ #
1079
+ # @param resource_group_name [String] Name of the resource group within the
1080
+ # azure subscription.
1081
+ # @param namespace_name [String] The Namespace name
1082
+ # @param authorization_rule_name [String] The authorization rule name.
1083
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1084
+ # will be added to the HTTP request.
1085
+ #
1086
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1087
+ #
1088
+ def delete_authorization_rule_with_http_info(resource_group_name, namespace_name, authorization_rule_name, custom_headers:nil)
1089
+ delete_authorization_rule_async(resource_group_name, namespace_name, authorization_rule_name, custom_headers:custom_headers).value!
1090
+ end
1091
+
1092
+ #
1093
+ # Deletes an AuthorizationRule for a Namespace.
1094
+ #
1095
+ # @param resource_group_name [String] Name of the resource group within the
1096
+ # azure subscription.
1097
+ # @param namespace_name [String] The Namespace name
1098
+ # @param authorization_rule_name [String] The authorization rule name.
1099
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1100
+ # to the HTTP request.
1101
+ #
1102
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1103
+ #
1104
+ def delete_authorization_rule_async(resource_group_name, namespace_name, authorization_rule_name, custom_headers:nil)
1105
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1106
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1107
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1108
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
1109
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
1110
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
1111
+ fail ArgumentError, 'authorization_rule_name is nil' if authorization_rule_name.nil?
1112
+ fail ArgumentError, "'authorization_rule_name' should satisfy the constraint - 'MaxLength': '50'" if !authorization_rule_name.nil? && authorization_rule_name.length > 50
1113
+ fail ArgumentError, "'authorization_rule_name' should satisfy the constraint - 'MinLength': '1'" if !authorization_rule_name.nil? && authorization_rule_name.length < 1
1114
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1115
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1116
+
1117
+
1118
+ request_headers = {}
1119
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1120
+
1121
+ # Set Headers
1122
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1123
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1124
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}'
1125
+
1126
+ request_url = @base_url || @client.base_url
1127
+
1128
+ options = {
1129
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1130
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'authorizationRuleName' => authorization_rule_name,'subscriptionId' => @client.subscription_id},
1131
+ query_params: {'api-version' => @client.api_version},
1132
+ headers: request_headers.merge(custom_headers || {}),
1133
+ base_url: request_url
1134
+ }
1135
+ promise = @client.make_request_async(:delete, path_template, options)
1136
+
1137
+ promise = promise.then do |result|
1138
+ http_response = result.response
1139
+ status_code = http_response.status
1140
+ response_content = http_response.body
1141
+ unless status_code == 204 || status_code == 200
1142
+ error_model = JSON.load(response_content)
1143
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1144
+ end
1145
+
1146
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1147
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1148
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1149
+
1150
+ result
1151
+ end
1152
+
1153
+ promise.execute
1154
+ end
1155
+
1156
+ #
1157
+ # Gets an AuthorizationRule for a Namespace by rule name.
1158
+ #
1159
+ # @param resource_group_name [String] Name of the resource group within the
1160
+ # azure subscription.
1161
+ # @param namespace_name [String] The Namespace name
1162
+ # @param authorization_rule_name [String] The authorization rule name.
1163
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1164
+ # will be added to the HTTP request.
1165
+ #
1166
+ # @return [SharedAccessAuthorizationRuleResource] operation results.
1167
+ #
1168
+ def get_authorization_rule(resource_group_name, namespace_name, authorization_rule_name, custom_headers:nil)
1169
+ response = get_authorization_rule_async(resource_group_name, namespace_name, authorization_rule_name, custom_headers:custom_headers).value!
1170
+ response.body unless response.nil?
1171
+ end
1172
+
1173
+ #
1174
+ # Gets an AuthorizationRule for a Namespace by rule name.
1175
+ #
1176
+ # @param resource_group_name [String] Name of the resource group within the
1177
+ # azure subscription.
1178
+ # @param namespace_name [String] The Namespace name
1179
+ # @param authorization_rule_name [String] The authorization rule name.
1180
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1181
+ # will be added to the HTTP request.
1182
+ #
1183
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1184
+ #
1185
+ def get_authorization_rule_with_http_info(resource_group_name, namespace_name, authorization_rule_name, custom_headers:nil)
1186
+ get_authorization_rule_async(resource_group_name, namespace_name, authorization_rule_name, custom_headers:custom_headers).value!
1187
+ end
1188
+
1189
+ #
1190
+ # Gets an AuthorizationRule for a Namespace by rule name.
1191
+ #
1192
+ # @param resource_group_name [String] Name of the resource group within the
1193
+ # azure subscription.
1194
+ # @param namespace_name [String] The Namespace name
1195
+ # @param authorization_rule_name [String] The authorization rule name.
1196
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1197
+ # to the HTTP request.
1198
+ #
1199
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1200
+ #
1201
+ def get_authorization_rule_async(resource_group_name, namespace_name, authorization_rule_name, custom_headers:nil)
1202
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1203
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1204
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1205
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
1206
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
1207
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
1208
+ fail ArgumentError, 'authorization_rule_name is nil' if authorization_rule_name.nil?
1209
+ fail ArgumentError, "'authorization_rule_name' should satisfy the constraint - 'MaxLength': '50'" if !authorization_rule_name.nil? && authorization_rule_name.length > 50
1210
+ fail ArgumentError, "'authorization_rule_name' should satisfy the constraint - 'MinLength': '1'" if !authorization_rule_name.nil? && authorization_rule_name.length < 1
1211
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1212
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1213
+
1214
+
1215
+ request_headers = {}
1216
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1217
+
1218
+ # Set Headers
1219
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1220
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1221
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}'
1222
+
1223
+ request_url = @base_url || @client.base_url
1224
+
1225
+ options = {
1226
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1227
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'authorizationRuleName' => authorization_rule_name,'subscriptionId' => @client.subscription_id},
1228
+ query_params: {'api-version' => @client.api_version},
1229
+ headers: request_headers.merge(custom_headers || {}),
1230
+ base_url: request_url
1231
+ }
1232
+ promise = @client.make_request_async(:get, path_template, options)
1233
+
1234
+ promise = promise.then do |result|
1235
+ http_response = result.response
1236
+ status_code = http_response.status
1237
+ response_content = http_response.body
1238
+ unless status_code == 200
1239
+ error_model = JSON.load(response_content)
1240
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1241
+ end
1242
+
1243
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1244
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1245
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1246
+ # Deserialize Response
1247
+ if status_code == 200
1248
+ begin
1249
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1250
+ result_mapper = Azure::EventHub::Mgmt::V2014_09_01::Models::SharedAccessAuthorizationRuleResource.mapper()
1251
+ result.body = @client.deserialize(result_mapper, parsed_response)
1252
+ rescue Exception => e
1253
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1254
+ end
1255
+ end
1256
+
1257
+ result
1258
+ end
1259
+
1260
+ promise.execute
1261
+ end
1262
+
1263
+ #
1264
+ # Gets an AuthorizationRule for a Namespace by rule name.
1265
+ #
1266
+ # @param resource_group_name [String] Name of the resource group within the
1267
+ # azure subscription.
1268
+ # @param namespace_name [String] The Namespace name
1269
+ # @param authorization_rule_name [String] The authorization rule name.
1270
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1271
+ # will be added to the HTTP request.
1272
+ #
1273
+ # @return [SharedAccessAuthorizationRulePostResource] operation results.
1274
+ #
1275
+ def post_authorization_rule(resource_group_name, namespace_name, authorization_rule_name, custom_headers:nil)
1276
+ response = post_authorization_rule_async(resource_group_name, namespace_name, authorization_rule_name, custom_headers:custom_headers).value!
1277
+ response.body unless response.nil?
1278
+ end
1279
+
1280
+ #
1281
+ # Gets an AuthorizationRule for a Namespace by rule name.
1282
+ #
1283
+ # @param resource_group_name [String] Name of the resource group within the
1284
+ # azure subscription.
1285
+ # @param namespace_name [String] The Namespace name
1286
+ # @param authorization_rule_name [String] The authorization rule name.
1287
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1288
+ # will be added to the HTTP request.
1289
+ #
1290
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1291
+ #
1292
+ def post_authorization_rule_with_http_info(resource_group_name, namespace_name, authorization_rule_name, custom_headers:nil)
1293
+ post_authorization_rule_async(resource_group_name, namespace_name, authorization_rule_name, custom_headers:custom_headers).value!
1294
+ end
1295
+
1296
+ #
1297
+ # Gets an AuthorizationRule for a Namespace by rule name.
1298
+ #
1299
+ # @param resource_group_name [String] Name of the resource group within the
1300
+ # azure subscription.
1301
+ # @param namespace_name [String] The Namespace name
1302
+ # @param authorization_rule_name [String] The authorization rule name.
1303
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1304
+ # to the HTTP request.
1305
+ #
1306
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1307
+ #
1308
+ def post_authorization_rule_async(resource_group_name, namespace_name, authorization_rule_name, custom_headers:nil)
1309
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1310
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1311
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1312
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
1313
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
1314
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
1315
+ fail ArgumentError, 'authorization_rule_name is nil' if authorization_rule_name.nil?
1316
+ fail ArgumentError, "'authorization_rule_name' should satisfy the constraint - 'MaxLength': '50'" if !authorization_rule_name.nil? && authorization_rule_name.length > 50
1317
+ fail ArgumentError, "'authorization_rule_name' should satisfy the constraint - 'MinLength': '1'" if !authorization_rule_name.nil? && authorization_rule_name.length < 1
1318
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1319
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1320
+
1321
+
1322
+ request_headers = {}
1323
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1324
+
1325
+ # Set Headers
1326
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1327
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1328
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}'
1329
+
1330
+ request_url = @base_url || @client.base_url
1331
+
1332
+ options = {
1333
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1334
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'authorizationRuleName' => authorization_rule_name,'subscriptionId' => @client.subscription_id},
1335
+ query_params: {'api-version' => @client.api_version},
1336
+ headers: request_headers.merge(custom_headers || {}),
1337
+ base_url: request_url
1338
+ }
1339
+ promise = @client.make_request_async(:post, path_template, options)
1340
+
1341
+ promise = promise.then do |result|
1342
+ http_response = result.response
1343
+ status_code = http_response.status
1344
+ response_content = http_response.body
1345
+ unless status_code == 200
1346
+ error_model = JSON.load(response_content)
1347
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1348
+ end
1349
+
1350
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1351
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1352
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1353
+ # Deserialize Response
1354
+ if status_code == 200
1355
+ begin
1356
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1357
+ result_mapper = Azure::EventHub::Mgmt::V2014_09_01::Models::SharedAccessAuthorizationRulePostResource.mapper()
1358
+ result.body = @client.deserialize(result_mapper, parsed_response)
1359
+ rescue Exception => e
1360
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1361
+ end
1362
+ end
1363
+
1364
+ result
1365
+ end
1366
+
1367
+ promise.execute
1368
+ end
1369
+
1370
+ #
1371
+ # Creates or updates a namespace. Once created, this namespace's resource
1372
+ # manifest is immutable. This operation is idempotent.
1373
+ #
1374
+ # @param resource_group_name [String] Name of the resource group within the
1375
+ # azure subscription.
1376
+ # @param namespace_name [String] The Namespace name
1377
+ # @param parameters [NamespaceCreateOrUpdateParameters] Parameters for creating
1378
+ # a namespace resource.
1379
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1380
+ # will be added to the HTTP request.
1381
+ #
1382
+ # @return [NamespaceResource] operation results.
1383
+ #
1384
+ def begin_create_or_update(resource_group_name, namespace_name, parameters, custom_headers:nil)
1385
+ response = begin_create_or_update_async(resource_group_name, namespace_name, parameters, custom_headers:custom_headers).value!
1386
+ response.body unless response.nil?
1387
+ end
1388
+
1389
+ #
1390
+ # Creates or updates a namespace. Once created, this namespace's resource
1391
+ # manifest is immutable. This operation is idempotent.
1392
+ #
1393
+ # @param resource_group_name [String] Name of the resource group within the
1394
+ # azure subscription.
1395
+ # @param namespace_name [String] The Namespace name
1396
+ # @param parameters [NamespaceCreateOrUpdateParameters] Parameters for creating
1397
+ # a namespace resource.
1398
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1399
+ # will be added to the HTTP request.
1400
+ #
1401
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1402
+ #
1403
+ def begin_create_or_update_with_http_info(resource_group_name, namespace_name, parameters, custom_headers:nil)
1404
+ begin_create_or_update_async(resource_group_name, namespace_name, parameters, custom_headers:custom_headers).value!
1405
+ end
1406
+
1407
+ #
1408
+ # Creates or updates a namespace. Once created, this namespace's resource
1409
+ # manifest is immutable. This operation is idempotent.
1410
+ #
1411
+ # @param resource_group_name [String] Name of the resource group within the
1412
+ # azure subscription.
1413
+ # @param namespace_name [String] The Namespace name
1414
+ # @param parameters [NamespaceCreateOrUpdateParameters] Parameters for creating
1415
+ # a namespace resource.
1416
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1417
+ # to the HTTP request.
1418
+ #
1419
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1420
+ #
1421
+ def begin_create_or_update_async(resource_group_name, namespace_name, parameters, custom_headers:nil)
1422
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1423
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1424
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1425
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
1426
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
1427
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
1428
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
1429
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1430
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1431
+
1432
+
1433
+ request_headers = {}
1434
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1435
+
1436
+ # Set Headers
1437
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1438
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1439
+
1440
+ # Serialize Request
1441
+ request_mapper = Azure::EventHub::Mgmt::V2014_09_01::Models::NamespaceCreateOrUpdateParameters.mapper()
1442
+ request_content = @client.serialize(request_mapper, parameters)
1443
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1444
+
1445
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}'
1446
+
1447
+ request_url = @base_url || @client.base_url
1448
+
1449
+ options = {
1450
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1451
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'subscriptionId' => @client.subscription_id},
1452
+ query_params: {'api-version' => @client.api_version},
1453
+ body: request_content,
1454
+ headers: request_headers.merge(custom_headers || {}),
1455
+ base_url: request_url
1456
+ }
1457
+ promise = @client.make_request_async(:put, path_template, options)
1458
+
1459
+ promise = promise.then do |result|
1460
+ http_response = result.response
1461
+ status_code = http_response.status
1462
+ response_content = http_response.body
1463
+ unless status_code == 201 || status_code == 200 || status_code == 202
1464
+ error_model = JSON.load(response_content)
1465
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1466
+ end
1467
+
1468
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1469
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1470
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1471
+ # Deserialize Response
1472
+ if status_code == 201
1473
+ begin
1474
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1475
+ result_mapper = Azure::EventHub::Mgmt::V2014_09_01::Models::NamespaceResource.mapper()
1476
+ result.body = @client.deserialize(result_mapper, parsed_response)
1477
+ rescue Exception => e
1478
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1479
+ end
1480
+ end
1481
+ # Deserialize Response
1482
+ if status_code == 200
1483
+ begin
1484
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1485
+ result_mapper = Azure::EventHub::Mgmt::V2014_09_01::Models::NamespaceResource.mapper()
1486
+ result.body = @client.deserialize(result_mapper, parsed_response)
1487
+ rescue Exception => e
1488
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1489
+ end
1490
+ end
1491
+
1492
+ result
1493
+ end
1494
+
1495
+ promise.execute
1496
+ end
1497
+
1498
+ #
1499
+ # Deletes an existing namespace. This operation also removes all associated
1500
+ # resources under the namespace.
1501
+ #
1502
+ # @param resource_group_name [String] Name of the resource group within the
1503
+ # azure subscription.
1504
+ # @param namespace_name [String] The Namespace name
1505
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1506
+ # will be added to the HTTP request.
1507
+ #
1508
+ #
1509
+ def begin_delete(resource_group_name, namespace_name, custom_headers:nil)
1510
+ response = begin_delete_async(resource_group_name, namespace_name, custom_headers:custom_headers).value!
1511
+ nil
1512
+ end
1513
+
1514
+ #
1515
+ # Deletes an existing namespace. This operation also removes all associated
1516
+ # resources under the namespace.
1517
+ #
1518
+ # @param resource_group_name [String] Name of the resource group within the
1519
+ # azure subscription.
1520
+ # @param namespace_name [String] The Namespace name
1521
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1522
+ # will be added to the HTTP request.
1523
+ #
1524
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1525
+ #
1526
+ def begin_delete_with_http_info(resource_group_name, namespace_name, custom_headers:nil)
1527
+ begin_delete_async(resource_group_name, namespace_name, custom_headers:custom_headers).value!
1528
+ end
1529
+
1530
+ #
1531
+ # Deletes an existing namespace. This operation also removes all associated
1532
+ # resources under the namespace.
1533
+ #
1534
+ # @param resource_group_name [String] Name of the resource group within the
1535
+ # azure subscription.
1536
+ # @param namespace_name [String] The Namespace name
1537
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1538
+ # to the HTTP request.
1539
+ #
1540
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1541
+ #
1542
+ def begin_delete_async(resource_group_name, namespace_name, custom_headers:nil)
1543
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1544
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1545
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1546
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
1547
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
1548
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
1549
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1550
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1551
+
1552
+
1553
+ request_headers = {}
1554
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1555
+
1556
+ # Set Headers
1557
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1558
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1559
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}'
1560
+
1561
+ request_url = @base_url || @client.base_url
1562
+
1563
+ options = {
1564
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1565
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'subscriptionId' => @client.subscription_id},
1566
+ query_params: {'api-version' => @client.api_version},
1567
+ headers: request_headers.merge(custom_headers || {}),
1568
+ base_url: request_url
1569
+ }
1570
+ promise = @client.make_request_async(:delete, path_template, options)
1571
+
1572
+ promise = promise.then do |result|
1573
+ http_response = result.response
1574
+ status_code = http_response.status
1575
+ response_content = http_response.body
1576
+ unless status_code == 204 || status_code == 200 || status_code == 202
1577
+ error_model = JSON.load(response_content)
1578
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1579
+ end
1580
+
1581
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1582
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1583
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1584
+
1585
+ result
1586
+ end
1587
+
1588
+ promise.execute
1589
+ end
1590
+
1591
+ #
1592
+ # Lists all the available Namespaces within a subscription, irrespective of the
1593
+ # resource groups.
1594
+ #
1595
+ # @param next_page_link [String] The NextLink from the previous successful call
1596
+ # to List operation.
1597
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1598
+ # will be added to the HTTP request.
1599
+ #
1600
+ # @return [NamespaceListResult] operation results.
1601
+ #
1602
+ def list_by_subscription_next(next_page_link, custom_headers:nil)
1603
+ response = list_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value!
1604
+ response.body unless response.nil?
1605
+ end
1606
+
1607
+ #
1608
+ # Lists all the available Namespaces within a subscription, irrespective of the
1609
+ # resource groups.
1610
+ #
1611
+ # @param next_page_link [String] The NextLink from the previous successful call
1612
+ # to List operation.
1613
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1614
+ # will be added to the HTTP request.
1615
+ #
1616
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1617
+ #
1618
+ def list_by_subscription_next_with_http_info(next_page_link, custom_headers:nil)
1619
+ list_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value!
1620
+ end
1621
+
1622
+ #
1623
+ # Lists all the available Namespaces within a subscription, irrespective of the
1624
+ # resource groups.
1625
+ #
1626
+ # @param next_page_link [String] The NextLink from the previous successful call
1627
+ # to List operation.
1628
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1629
+ # to the HTTP request.
1630
+ #
1631
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1632
+ #
1633
+ def list_by_subscription_next_async(next_page_link, custom_headers:nil)
1634
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1635
+
1636
+
1637
+ request_headers = {}
1638
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1639
+
1640
+ # Set Headers
1641
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1642
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1643
+ path_template = '{nextLink}'
1644
+
1645
+ request_url = @base_url || @client.base_url
1646
+
1647
+ options = {
1648
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1649
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1650
+ headers: request_headers.merge(custom_headers || {}),
1651
+ base_url: request_url
1652
+ }
1653
+ promise = @client.make_request_async(:get, path_template, options)
1654
+
1655
+ promise = promise.then do |result|
1656
+ http_response = result.response
1657
+ status_code = http_response.status
1658
+ response_content = http_response.body
1659
+ unless status_code == 200
1660
+ error_model = JSON.load(response_content)
1661
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1662
+ end
1663
+
1664
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1665
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1666
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1667
+ # Deserialize Response
1668
+ if status_code == 200
1669
+ begin
1670
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1671
+ result_mapper = Azure::EventHub::Mgmt::V2014_09_01::Models::NamespaceListResult.mapper()
1672
+ result.body = @client.deserialize(result_mapper, parsed_response)
1673
+ rescue Exception => e
1674
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1675
+ end
1676
+ end
1677
+
1678
+ result
1679
+ end
1680
+
1681
+ promise.execute
1682
+ end
1683
+
1684
+ #
1685
+ # Lists the available Namespaces within a resource group.
1686
+ #
1687
+ # @param next_page_link [String] The NextLink from the previous successful call
1688
+ # to List operation.
1689
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1690
+ # will be added to the HTTP request.
1691
+ #
1692
+ # @return [NamespaceListResult] operation results.
1693
+ #
1694
+ def list_by_resource_group_next(next_page_link, custom_headers:nil)
1695
+ response = list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
1696
+ response.body unless response.nil?
1697
+ end
1698
+
1699
+ #
1700
+ # Lists the available Namespaces within a resource group.
1701
+ #
1702
+ # @param next_page_link [String] The NextLink from the previous successful call
1703
+ # to List operation.
1704
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1705
+ # will be added to the HTTP request.
1706
+ #
1707
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1708
+ #
1709
+ def list_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil)
1710
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
1711
+ end
1712
+
1713
+ #
1714
+ # Lists the available Namespaces within a resource group.
1715
+ #
1716
+ # @param next_page_link [String] The NextLink from the previous successful call
1717
+ # to List operation.
1718
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1719
+ # to the HTTP request.
1720
+ #
1721
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1722
+ #
1723
+ def list_by_resource_group_next_async(next_page_link, custom_headers:nil)
1724
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1725
+
1726
+
1727
+ request_headers = {}
1728
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1729
+
1730
+ # Set Headers
1731
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1732
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1733
+ path_template = '{nextLink}'
1734
+
1735
+ request_url = @base_url || @client.base_url
1736
+
1737
+ options = {
1738
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1739
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1740
+ headers: request_headers.merge(custom_headers || {}),
1741
+ base_url: request_url
1742
+ }
1743
+ promise = @client.make_request_async(:get, path_template, options)
1744
+
1745
+ promise = promise.then do |result|
1746
+ http_response = result.response
1747
+ status_code = http_response.status
1748
+ response_content = http_response.body
1749
+ unless status_code == 200
1750
+ error_model = JSON.load(response_content)
1751
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1752
+ end
1753
+
1754
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1755
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1756
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1757
+ # Deserialize Response
1758
+ if status_code == 200
1759
+ begin
1760
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1761
+ result_mapper = Azure::EventHub::Mgmt::V2014_09_01::Models::NamespaceListResult.mapper()
1762
+ result.body = @client.deserialize(result_mapper, parsed_response)
1763
+ rescue Exception => e
1764
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1765
+ end
1766
+ end
1767
+
1768
+ result
1769
+ end
1770
+
1771
+ promise.execute
1772
+ end
1773
+
1774
+ #
1775
+ # Gets a list of authorization rules for a Namespace.
1776
+ #
1777
+ # @param next_page_link [String] The NextLink from the previous successful call
1778
+ # to List operation.
1779
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1780
+ # will be added to the HTTP request.
1781
+ #
1782
+ # @return [SharedAccessAuthorizationRuleListResult] operation results.
1783
+ #
1784
+ def list_authorization_rules_next(next_page_link, custom_headers:nil)
1785
+ response = list_authorization_rules_next_async(next_page_link, custom_headers:custom_headers).value!
1786
+ response.body unless response.nil?
1787
+ end
1788
+
1789
+ #
1790
+ # Gets a list of authorization rules for a Namespace.
1791
+ #
1792
+ # @param next_page_link [String] The NextLink from the previous successful call
1793
+ # to List operation.
1794
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1795
+ # will be added to the HTTP request.
1796
+ #
1797
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1798
+ #
1799
+ def list_authorization_rules_next_with_http_info(next_page_link, custom_headers:nil)
1800
+ list_authorization_rules_next_async(next_page_link, custom_headers:custom_headers).value!
1801
+ end
1802
+
1803
+ #
1804
+ # Gets a list of authorization rules for a Namespace.
1805
+ #
1806
+ # @param next_page_link [String] The NextLink from the previous successful call
1807
+ # to List operation.
1808
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1809
+ # to the HTTP request.
1810
+ #
1811
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1812
+ #
1813
+ def list_authorization_rules_next_async(next_page_link, custom_headers:nil)
1814
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1815
+
1816
+
1817
+ request_headers = {}
1818
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1819
+
1820
+ # Set Headers
1821
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1822
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1823
+ path_template = '{nextLink}'
1824
+
1825
+ request_url = @base_url || @client.base_url
1826
+
1827
+ options = {
1828
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1829
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1830
+ headers: request_headers.merge(custom_headers || {}),
1831
+ base_url: request_url
1832
+ }
1833
+ promise = @client.make_request_async(:get, path_template, options)
1834
+
1835
+ promise = promise.then do |result|
1836
+ http_response = result.response
1837
+ status_code = http_response.status
1838
+ response_content = http_response.body
1839
+ unless status_code == 200
1840
+ error_model = JSON.load(response_content)
1841
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1842
+ end
1843
+
1844
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1845
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1846
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1847
+ # Deserialize Response
1848
+ if status_code == 200
1849
+ begin
1850
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1851
+ result_mapper = Azure::EventHub::Mgmt::V2014_09_01::Models::SharedAccessAuthorizationRuleListResult.mapper()
1852
+ result.body = @client.deserialize(result_mapper, parsed_response)
1853
+ rescue Exception => e
1854
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1855
+ end
1856
+ end
1857
+
1858
+ result
1859
+ end
1860
+
1861
+ promise.execute
1862
+ end
1863
+
1864
+ #
1865
+ # Gets a list of authorization rules for a Namespace.
1866
+ #
1867
+ # @param next_page_link [String] The NextLink from the previous successful call
1868
+ # to List operation.
1869
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1870
+ # will be added to the HTTP request.
1871
+ #
1872
+ # @return [SharedAccessAuthorizationRuleListResult] operation results.
1873
+ #
1874
+ def list_post_authorization_rules_next(next_page_link, custom_headers:nil)
1875
+ response = list_post_authorization_rules_next_async(next_page_link, custom_headers:custom_headers).value!
1876
+ response.body unless response.nil?
1877
+ end
1878
+
1879
+ #
1880
+ # Gets a list of authorization rules for a Namespace.
1881
+ #
1882
+ # @param next_page_link [String] The NextLink from the previous successful call
1883
+ # to List operation.
1884
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1885
+ # will be added to the HTTP request.
1886
+ #
1887
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1888
+ #
1889
+ def list_post_authorization_rules_next_with_http_info(next_page_link, custom_headers:nil)
1890
+ list_post_authorization_rules_next_async(next_page_link, custom_headers:custom_headers).value!
1891
+ end
1892
+
1893
+ #
1894
+ # Gets a list of authorization rules for a Namespace.
1895
+ #
1896
+ # @param next_page_link [String] The NextLink from the previous successful call
1897
+ # to List operation.
1898
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1899
+ # to the HTTP request.
1900
+ #
1901
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1902
+ #
1903
+ def list_post_authorization_rules_next_async(next_page_link, custom_headers:nil)
1904
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1905
+
1906
+
1907
+ request_headers = {}
1908
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1909
+
1910
+ # Set Headers
1911
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1912
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1913
+ path_template = '{nextLink}'
1914
+
1915
+ request_url = @base_url || @client.base_url
1916
+
1917
+ options = {
1918
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1919
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1920
+ headers: request_headers.merge(custom_headers || {}),
1921
+ base_url: request_url
1922
+ }
1923
+ promise = @client.make_request_async(:post, path_template, options)
1924
+
1925
+ promise = promise.then do |result|
1926
+ http_response = result.response
1927
+ status_code = http_response.status
1928
+ response_content = http_response.body
1929
+ unless status_code == 200
1930
+ error_model = JSON.load(response_content)
1931
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1932
+ end
1933
+
1934
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1935
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1936
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1937
+ # Deserialize Response
1938
+ if status_code == 200
1939
+ begin
1940
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1941
+ result_mapper = Azure::EventHub::Mgmt::V2014_09_01::Models::SharedAccessAuthorizationRuleListResult.mapper()
1942
+ result.body = @client.deserialize(result_mapper, parsed_response)
1943
+ rescue Exception => e
1944
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1945
+ end
1946
+ end
1947
+
1948
+ result
1949
+ end
1950
+
1951
+ promise.execute
1952
+ end
1953
+
1954
+ #
1955
+ # Lists all the available Namespaces within a subscription, irrespective of the
1956
+ # resource groups.
1957
+ #
1958
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1959
+ # will be added to the HTTP request.
1960
+ #
1961
+ # @return [NamespaceListResult] which provide lazy access to pages of the
1962
+ # response.
1963
+ #
1964
+ def list_by_subscription_as_lazy(custom_headers:nil)
1965
+ response = list_by_subscription_async(custom_headers:custom_headers).value!
1966
+ unless response.nil?
1967
+ page = response.body
1968
+ page.next_method = Proc.new do |next_page_link|
1969
+ list_by_subscription_next_async(next_page_link, custom_headers:custom_headers)
1970
+ end
1971
+ page
1972
+ end
1973
+ end
1974
+
1975
+ #
1976
+ # Lists the available Namespaces within a resource group.
1977
+ #
1978
+ # @param resource_group_name [String] Name of the resource group within the
1979
+ # azure subscription.
1980
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1981
+ # will be added to the HTTP request.
1982
+ #
1983
+ # @return [NamespaceListResult] which provide lazy access to pages of the
1984
+ # response.
1985
+ #
1986
+ def list_by_resource_group_as_lazy(resource_group_name, custom_headers:nil)
1987
+ response = list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
1988
+ unless response.nil?
1989
+ page = response.body
1990
+ page.next_method = Proc.new do |next_page_link|
1991
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers)
1992
+ end
1993
+ page
1994
+ end
1995
+ end
1996
+
1997
+ #
1998
+ # Gets a list of authorization rules for a Namespace.
1999
+ #
2000
+ # @param resource_group_name [String] Name of the resource group within the
2001
+ # azure subscription.
2002
+ # @param namespace_name [String] The Namespace name
2003
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2004
+ # will be added to the HTTP request.
2005
+ #
2006
+ # @return [SharedAccessAuthorizationRuleListResult] which provide lazy access
2007
+ # to pages of the response.
2008
+ #
2009
+ def list_authorization_rules_as_lazy(resource_group_name, namespace_name, custom_headers:nil)
2010
+ response = list_authorization_rules_async(resource_group_name, namespace_name, custom_headers:custom_headers).value!
2011
+ unless response.nil?
2012
+ page = response.body
2013
+ page.next_method = Proc.new do |next_page_link|
2014
+ list_authorization_rules_next_async(next_page_link, custom_headers:custom_headers)
2015
+ end
2016
+ page
2017
+ end
2018
+ end
2019
+
2020
+ #
2021
+ # Gets a list of authorization rules for a Namespace.
2022
+ #
2023
+ # @param resource_group_name [String] Name of the resource group within the
2024
+ # azure subscription.
2025
+ # @param namespace_name [String] The Namespace name
2026
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2027
+ # will be added to the HTTP request.
2028
+ #
2029
+ # @return [SharedAccessAuthorizationRuleListResult] which provide lazy access
2030
+ # to pages of the response.
2031
+ #
2032
+ def list_post_authorization_rules_as_lazy(resource_group_name, namespace_name, custom_headers:nil)
2033
+ response = list_post_authorization_rules_async(resource_group_name, namespace_name, custom_headers:custom_headers).value!
2034
+ unless response.nil?
2035
+ page = response.body
2036
+ page.next_method = Proc.new do |next_page_link|
2037
+ list_post_authorization_rules_next_async(next_page_link, custom_headers:custom_headers)
2038
+ end
2039
+ page
2040
+ end
2041
+ end
2042
+
2043
+ end
2044
+ end