azure_mgmt_relay 0.14.0 → 0.15.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (77) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2016-07-01/generated/azure_mgmt_relay.rb +55 -0
  3. data/lib/2016-07-01/generated/azure_mgmt_relay/hybrid_connections.rb +1269 -0
  4. data/lib/{generated → 2016-07-01/generated}/azure_mgmt_relay/models/access_rights.rb +1 -1
  5. data/lib/2016-07-01/generated/azure_mgmt_relay/models/authorization_rule.rb +78 -0
  6. data/lib/2016-07-01/generated/azure_mgmt_relay/models/authorization_rule_keys.rb +88 -0
  7. data/lib/2016-07-01/generated/azure_mgmt_relay/models/authorization_rule_list_result.rb +96 -0
  8. data/lib/2016-07-01/generated/azure_mgmt_relay/models/check_name_availability.rb +47 -0
  9. data/lib/2016-07-01/generated/azure_mgmt_relay/models/check_name_availability_result.rb +71 -0
  10. data/lib/{generated → 2016-07-01/generated}/azure_mgmt_relay/models/error_response.rb +1 -1
  11. data/lib/2016-07-01/generated/azure_mgmt_relay/models/hybrid_connection.rb +120 -0
  12. data/lib/2016-07-01/generated/azure_mgmt_relay/models/hybrid_connection_list_result.rb +95 -0
  13. data/lib/2016-07-01/generated/azure_mgmt_relay/models/operation.rb +56 -0
  14. data/lib/2016-07-01/generated/azure_mgmt_relay/models/operation_display.rb +68 -0
  15. data/lib/2016-07-01/generated/azure_mgmt_relay/models/operation_list_result.rb +99 -0
  16. data/lib/2016-07-01/generated/azure_mgmt_relay/models/policy_key.rb +16 -0
  17. data/lib/2016-07-01/generated/azure_mgmt_relay/models/regenerate_keys_parameters.rb +45 -0
  18. data/lib/2016-07-01/generated/azure_mgmt_relay/models/relay_namespace.rb +148 -0
  19. data/lib/2016-07-01/generated/azure_mgmt_relay/models/relay_namespace_list_result.rb +95 -0
  20. data/lib/2016-07-01/generated/azure_mgmt_relay/models/relay_namespace_update_parameter.rb +64 -0
  21. data/lib/{generated → 2016-07-01/generated}/azure_mgmt_relay/models/relaytype.rb +1 -1
  22. data/lib/2016-07-01/generated/azure_mgmt_relay/models/resource.rb +67 -0
  23. data/lib/2016-07-01/generated/azure_mgmt_relay/models/sku.rb +59 -0
  24. data/lib/2016-07-01/generated/azure_mgmt_relay/models/tracked_resource.rb +85 -0
  25. data/lib/{generated → 2016-07-01/generated}/azure_mgmt_relay/models/unavailable_reason.rb +1 -1
  26. data/lib/2016-07-01/generated/azure_mgmt_relay/models/wcf_relay.rb +149 -0
  27. data/lib/2016-07-01/generated/azure_mgmt_relay/models/wcf_relays_list_result.rb +95 -0
  28. data/lib/2016-07-01/generated/azure_mgmt_relay/module_definition.rb +9 -0
  29. data/lib/2016-07-01/generated/azure_mgmt_relay/namespaces.rb +1725 -0
  30. data/lib/2016-07-01/generated/azure_mgmt_relay/operations.rb +214 -0
  31. data/lib/2016-07-01/generated/azure_mgmt_relay/relay_management_client.rb +143 -0
  32. data/lib/{generated → 2016-07-01/generated}/azure_mgmt_relay/version.rb +2 -2
  33. data/lib/2016-07-01/generated/azure_mgmt_relay/wcfrelays.rb +1263 -0
  34. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_relay.rb +34 -34
  35. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_relay/hybrid_connections.rb +14 -14
  36. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_relay/models/access_keys.rb +1 -1
  37. data/lib/2017-04-01/generated/azure_mgmt_relay/models/access_rights.rb +17 -0
  38. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_relay/models/authorization_rule.rb +1 -1
  39. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_relay/models/authorization_rule_list_result.rb +1 -1
  40. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_relay/models/check_name_availability.rb +1 -1
  41. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_relay/models/check_name_availability_result.rb +1 -1
  42. data/lib/2017-04-01/generated/azure_mgmt_relay/models/error_response.rb +55 -0
  43. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_relay/models/hybrid_connection.rb +1 -1
  44. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_relay/models/hybrid_connection_list_result.rb +1 -1
  45. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_relay/models/key_type.rb +1 -1
  46. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_relay/models/operation.rb +1 -1
  47. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_relay/models/operation_display.rb +1 -1
  48. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_relay/models/operation_list_result.rb +1 -1
  49. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_relay/models/provisioning_state_enum.rb +1 -1
  50. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_relay/models/regenerate_access_key_parameters.rb +1 -1
  51. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_relay/models/relay_namespace.rb +1 -1
  52. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_relay/models/relay_namespace_list_result.rb +1 -1
  53. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_relay/models/relay_update_parameters.rb +1 -1
  54. data/lib/2017-04-01/generated/azure_mgmt_relay/models/relaytype.rb +16 -0
  55. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_relay/models/resource.rb +1 -1
  56. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_relay/models/resource_namespace_patch.rb +1 -1
  57. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_relay/models/sku.rb +1 -1
  58. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_relay/models/sku_tier.rb +1 -1
  59. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_relay/models/tracked_resource.rb +1 -1
  60. data/lib/2017-04-01/generated/azure_mgmt_relay/models/unavailable_reason.rb +20 -0
  61. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_relay/models/wcf_relay.rb +1 -1
  62. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_relay/models/wcf_relays_list_result.rb +1 -1
  63. data/lib/2017-04-01/generated/azure_mgmt_relay/module_definition.rb +9 -0
  64. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_relay/namespaces.rb +23 -23
  65. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_relay/operations.rb +3 -3
  66. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_relay/relay_management_client.rb +3 -3
  67. data/lib/{generated/azure_mgmt_relay/module_definition.rb → 2017-04-01/generated/azure_mgmt_relay/version.rb} +3 -3
  68. data/lib/{generated → 2017-04-01/generated}/azure_mgmt_relay/wcfrelays.rb +14 -14
  69. data/lib/azure_mgmt_relay.rb +3 -4
  70. data/lib/module_definition.rb +7 -0
  71. data/lib/profiles/common/configurable.rb +73 -0
  72. data/lib/profiles/common/default.rb +68 -0
  73. data/lib/profiles/latest/modules/relay_profile_module.rb +156 -0
  74. data/lib/profiles/latest/relay_latest_profile_client.rb +33 -0
  75. data/lib/profiles/latest/relay_module_definition.rb +9 -0
  76. data/lib/version.rb +7 -0
  77. metadata +76 -37
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1a8d54386adff35429f6befdbd6f4619b7989889
4
- data.tar.gz: f206ed8fd10f92dd758b728d7011022515f94224
3
+ metadata.gz: b2147dbec5fd849409e3c34ae00cd548bf2cc712
4
+ data.tar.gz: d47ab9c3effcfe453818d34077044e2a949237a7
5
5
  SHA512:
6
- metadata.gz: 116ebe602a9565eb44fa7e17fb0573ed5d7096dc94be15cff0039280505652649732303221bd1427058e6270c1a2d964606a314565cfdd49caf96e5aead0e135
7
- data.tar.gz: 0db333c184185bf495dc5976155a9257d845adb37f5edf9d87f9ac84dcbb504001f2c9da6dafd66c7be2cfdec336057e092fe721e3a7e4faac362ed23324d7d5
6
+ metadata.gz: 233d3a3885c2b7fb78330a954b802fdf9f8ea728202c4d0ced22a7635c176eb09d4b721bbbd09d8b47672d886f9b1aac0c4bb0a0b002fb7c7dd18eb122af3645
7
+ data.tar.gz: 80809f6cc2cd853e9b1739b3edf22a3b23be19a3d4cb21f5886381b8c130c4dbb70208373d98cff72727c488b8116c5a3f51eddac425039544014e9bd0399891
@@ -0,0 +1,55 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ require 'uri'
7
+ require 'cgi'
8
+ require 'date'
9
+ require 'json'
10
+ require 'base64'
11
+ require 'erb'
12
+ require 'securerandom'
13
+ require 'time'
14
+ require 'timeliness'
15
+ require 'faraday'
16
+ require 'faraday-cookie_jar'
17
+ require 'concurrent'
18
+ require 'ms_rest'
19
+ require '2016-07-01/generated/azure_mgmt_relay/module_definition'
20
+ require 'ms_rest_azure'
21
+
22
+ module Azure::Relay::Mgmt::V2016_07_01
23
+ autoload :Operations, '2016-07-01/generated/azure_mgmt_relay/operations.rb'
24
+ autoload :Namespaces, '2016-07-01/generated/azure_mgmt_relay/namespaces.rb'
25
+ autoload :HybridConnections, '2016-07-01/generated/azure_mgmt_relay/hybrid_connections.rb'
26
+ autoload :WCFRelays, '2016-07-01/generated/azure_mgmt_relay/wcfrelays.rb'
27
+ autoload :RelayManagementClient, '2016-07-01/generated/azure_mgmt_relay/relay_management_client.rb'
28
+
29
+ module Models
30
+ autoload :AuthorizationRuleListResult, '2016-07-01/generated/azure_mgmt_relay/models/authorization_rule_list_result.rb'
31
+ autoload :RelayNamespaceListResult, '2016-07-01/generated/azure_mgmt_relay/models/relay_namespace_list_result.rb'
32
+ autoload :Resource, '2016-07-01/generated/azure_mgmt_relay/models/resource.rb'
33
+ autoload :OperationDisplay, '2016-07-01/generated/azure_mgmt_relay/models/operation_display.rb'
34
+ autoload :HybridConnectionListResult, '2016-07-01/generated/azure_mgmt_relay/models/hybrid_connection_list_result.rb'
35
+ autoload :RelayNamespaceUpdateParameter, '2016-07-01/generated/azure_mgmt_relay/models/relay_namespace_update_parameter.rb'
36
+ autoload :WcfRelaysListResult, '2016-07-01/generated/azure_mgmt_relay/models/wcf_relays_list_result.rb'
37
+ autoload :AuthorizationRuleKeys, '2016-07-01/generated/azure_mgmt_relay/models/authorization_rule_keys.rb'
38
+ autoload :Operation, '2016-07-01/generated/azure_mgmt_relay/models/operation.rb'
39
+ autoload :RegenerateKeysParameters, '2016-07-01/generated/azure_mgmt_relay/models/regenerate_keys_parameters.rb'
40
+ autoload :OperationListResult, '2016-07-01/generated/azure_mgmt_relay/models/operation_list_result.rb'
41
+ autoload :ErrorResponse, '2016-07-01/generated/azure_mgmt_relay/models/error_response.rb'
42
+ autoload :CheckNameAvailability, '2016-07-01/generated/azure_mgmt_relay/models/check_name_availability.rb'
43
+ autoload :Sku, '2016-07-01/generated/azure_mgmt_relay/models/sku.rb'
44
+ autoload :CheckNameAvailabilityResult, '2016-07-01/generated/azure_mgmt_relay/models/check_name_availability_result.rb'
45
+ autoload :TrackedResource, '2016-07-01/generated/azure_mgmt_relay/models/tracked_resource.rb'
46
+ autoload :HybridConnection, '2016-07-01/generated/azure_mgmt_relay/models/hybrid_connection.rb'
47
+ autoload :WcfRelay, '2016-07-01/generated/azure_mgmt_relay/models/wcf_relay.rb'
48
+ autoload :RelayNamespace, '2016-07-01/generated/azure_mgmt_relay/models/relay_namespace.rb'
49
+ autoload :AuthorizationRule, '2016-07-01/generated/azure_mgmt_relay/models/authorization_rule.rb'
50
+ autoload :Relaytype, '2016-07-01/generated/azure_mgmt_relay/models/relaytype.rb'
51
+ autoload :AccessRights, '2016-07-01/generated/azure_mgmt_relay/models/access_rights.rb'
52
+ autoload :PolicyKey, '2016-07-01/generated/azure_mgmt_relay/models/policy_key.rb'
53
+ autoload :UnavailableReason, '2016-07-01/generated/azure_mgmt_relay/models/unavailable_reason.rb'
54
+ end
55
+ end
@@ -0,0 +1,1269 @@
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::Relay::Mgmt::V2016_07_01
7
+ #
8
+ # Use these API to manage Azure Relay resources through Azure Resources
9
+ # Manager.
10
+ #
11
+ class HybridConnections
12
+ include MsRestAzure
13
+
14
+ #
15
+ # Creates and initializes a new instance of the HybridConnections class.
16
+ # @param client service class for accessing basic functionality.
17
+ #
18
+ def initialize(client)
19
+ @client = client
20
+ end
21
+
22
+ # @return [RelayManagementClient] reference to the RelayManagementClient
23
+ attr_reader :client
24
+
25
+ #
26
+ # Lists the HybridConnection within the namespace.
27
+ #
28
+ # @param resource_group_name [String] Name of the Resource group within the
29
+ # Azure subscription.
30
+ # @param namespace_name [String] The Namespace Name
31
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
32
+ # will be added to the HTTP request.
33
+ #
34
+ # @return [Array<HybridConnection>] operation results.
35
+ #
36
+ def list_by_namespace(resource_group_name, namespace_name, custom_headers = nil)
37
+ first_page = list_by_namespace_as_lazy(resource_group_name, namespace_name, custom_headers)
38
+ first_page.get_all_items
39
+ end
40
+
41
+ #
42
+ # Lists the HybridConnection within the namespace.
43
+ #
44
+ # @param resource_group_name [String] Name of the Resource group within the
45
+ # Azure subscription.
46
+ # @param namespace_name [String] The Namespace Name
47
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
48
+ # will be added to the HTTP request.
49
+ #
50
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
51
+ #
52
+ def list_by_namespace_with_http_info(resource_group_name, namespace_name, custom_headers = nil)
53
+ list_by_namespace_async(resource_group_name, namespace_name, custom_headers).value!
54
+ end
55
+
56
+ #
57
+ # Lists the HybridConnection within the namespace.
58
+ #
59
+ # @param resource_group_name [String] Name of the Resource group within the
60
+ # Azure subscription.
61
+ # @param namespace_name [String] The Namespace Name
62
+ # @param [Hash{String => String}] A hash of custom headers that will be added
63
+ # to the HTTP request.
64
+ #
65
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
66
+ #
67
+ def list_by_namespace_async(resource_group_name, namespace_name, custom_headers = nil)
68
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
69
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
70
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
71
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
72
+
73
+
74
+ request_headers = {}
75
+
76
+ # Set Headers
77
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
78
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
79
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/HybridConnections'
80
+
81
+ request_url = @base_url || @client.base_url
82
+
83
+ options = {
84
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
85
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'subscriptionId' => @client.subscription_id},
86
+ query_params: {'api-version' => @client.api_version},
87
+ headers: request_headers.merge(custom_headers || {}),
88
+ base_url: request_url
89
+ }
90
+ promise = @client.make_request_async(:get, path_template, options)
91
+
92
+ promise = promise.then do |result|
93
+ http_response = result.response
94
+ status_code = http_response.status
95
+ response_content = http_response.body
96
+ unless status_code == 200
97
+ error_model = JSON.load(response_content)
98
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
99
+ end
100
+
101
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
102
+ # Deserialize Response
103
+ if status_code == 200
104
+ begin
105
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
106
+ result_mapper = Azure::Relay::Mgmt::V2016_07_01::Models::HybridConnectionListResult.mapper()
107
+ result.body = @client.deserialize(result_mapper, parsed_response)
108
+ rescue Exception => e
109
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
110
+ end
111
+ end
112
+
113
+ result
114
+ end
115
+
116
+ promise.execute
117
+ end
118
+
119
+ #
120
+ # Creates or Updates a service HybridConnection. This operation is idempotent.
121
+ #
122
+ # @param resource_group_name [String] Name of the Resource group within the
123
+ # Azure subscription.
124
+ # @param namespace_name [String] The Namespace Name
125
+ # @param hybrid_connection_name [String] The hybrid connection name.
126
+ # @param parameters [HybridConnection] Parameters supplied to create a
127
+ # HybridConnection.
128
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
129
+ # will be added to the HTTP request.
130
+ #
131
+ # @return [HybridConnection] operation results.
132
+ #
133
+ def create_or_update(resource_group_name, namespace_name, hybrid_connection_name, parameters, custom_headers = nil)
134
+ response = create_or_update_async(resource_group_name, namespace_name, hybrid_connection_name, parameters, custom_headers).value!
135
+ response.body unless response.nil?
136
+ end
137
+
138
+ #
139
+ # Creates or Updates a service HybridConnection. This operation is idempotent.
140
+ #
141
+ # @param resource_group_name [String] Name of the Resource group within the
142
+ # Azure subscription.
143
+ # @param namespace_name [String] The Namespace Name
144
+ # @param hybrid_connection_name [String] The hybrid connection name.
145
+ # @param parameters [HybridConnection] Parameters supplied to create a
146
+ # HybridConnection.
147
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
148
+ # will be added to the HTTP request.
149
+ #
150
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
151
+ #
152
+ def create_or_update_with_http_info(resource_group_name, namespace_name, hybrid_connection_name, parameters, custom_headers = nil)
153
+ create_or_update_async(resource_group_name, namespace_name, hybrid_connection_name, parameters, custom_headers).value!
154
+ end
155
+
156
+ #
157
+ # Creates or Updates a service HybridConnection. This operation is idempotent.
158
+ #
159
+ # @param resource_group_name [String] Name of the Resource group within the
160
+ # Azure subscription.
161
+ # @param namespace_name [String] The Namespace Name
162
+ # @param hybrid_connection_name [String] The hybrid connection name.
163
+ # @param parameters [HybridConnection] Parameters supplied to create a
164
+ # HybridConnection.
165
+ # @param [Hash{String => String}] A hash of custom headers that will be added
166
+ # to the HTTP request.
167
+ #
168
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
169
+ #
170
+ def create_or_update_async(resource_group_name, namespace_name, hybrid_connection_name, parameters, custom_headers = nil)
171
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
172
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
173
+ fail ArgumentError, 'hybrid_connection_name is nil' if hybrid_connection_name.nil?
174
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
175
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
176
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
177
+
178
+
179
+ request_headers = {}
180
+
181
+ # Set Headers
182
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
183
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
184
+
185
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
186
+
187
+ # Serialize Request
188
+ request_mapper = Azure::Relay::Mgmt::V2016_07_01::Models::HybridConnection.mapper()
189
+ request_content = @client.serialize(request_mapper, parameters)
190
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
191
+
192
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/HybridConnections/{hybridConnectionName}'
193
+
194
+ request_url = @base_url || @client.base_url
195
+
196
+ options = {
197
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
198
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'hybridConnectionName' => hybrid_connection_name,'subscriptionId' => @client.subscription_id},
199
+ query_params: {'api-version' => @client.api_version},
200
+ body: request_content,
201
+ headers: request_headers.merge(custom_headers || {}),
202
+ base_url: request_url
203
+ }
204
+ promise = @client.make_request_async(:put, path_template, options)
205
+
206
+ promise = promise.then do |result|
207
+ http_response = result.response
208
+ status_code = http_response.status
209
+ response_content = http_response.body
210
+ unless status_code == 200
211
+ error_model = JSON.load(response_content)
212
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
213
+ end
214
+
215
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
216
+ # Deserialize Response
217
+ if status_code == 200
218
+ begin
219
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
220
+ result_mapper = Azure::Relay::Mgmt::V2016_07_01::Models::HybridConnection.mapper()
221
+ result.body = @client.deserialize(result_mapper, parsed_response)
222
+ rescue Exception => e
223
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
224
+ end
225
+ end
226
+
227
+ result
228
+ end
229
+
230
+ promise.execute
231
+ end
232
+
233
+ #
234
+ # Deletes a HybridConnection .
235
+ #
236
+ # @param resource_group_name [String] Name of the Resource group within the
237
+ # Azure subscription.
238
+ # @param namespace_name [String] The Namespace Name
239
+ # @param hybrid_connection_name [String] The hybrid connection name.
240
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
241
+ # will be added to the HTTP request.
242
+ #
243
+ #
244
+ def delete(resource_group_name, namespace_name, hybrid_connection_name, custom_headers = nil)
245
+ response = delete_async(resource_group_name, namespace_name, hybrid_connection_name, custom_headers).value!
246
+ nil
247
+ end
248
+
249
+ #
250
+ # Deletes a HybridConnection .
251
+ #
252
+ # @param resource_group_name [String] Name of the Resource group within the
253
+ # Azure subscription.
254
+ # @param namespace_name [String] The Namespace Name
255
+ # @param hybrid_connection_name [String] The hybrid connection name.
256
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
257
+ # will be added to the HTTP request.
258
+ #
259
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
260
+ #
261
+ def delete_with_http_info(resource_group_name, namespace_name, hybrid_connection_name, custom_headers = nil)
262
+ delete_async(resource_group_name, namespace_name, hybrid_connection_name, custom_headers).value!
263
+ end
264
+
265
+ #
266
+ # Deletes a HybridConnection .
267
+ #
268
+ # @param resource_group_name [String] Name of the Resource group within the
269
+ # Azure subscription.
270
+ # @param namespace_name [String] The Namespace Name
271
+ # @param hybrid_connection_name [String] The hybrid connection name.
272
+ # @param [Hash{String => String}] A hash of custom headers that will be added
273
+ # to the HTTP request.
274
+ #
275
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
276
+ #
277
+ def delete_async(resource_group_name, namespace_name, hybrid_connection_name, custom_headers = nil)
278
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
279
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
280
+ fail ArgumentError, 'hybrid_connection_name is nil' if hybrid_connection_name.nil?
281
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
282
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
283
+
284
+
285
+ request_headers = {}
286
+
287
+ # Set Headers
288
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
289
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
290
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/HybridConnections/{hybridConnectionName}'
291
+
292
+ request_url = @base_url || @client.base_url
293
+
294
+ options = {
295
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
296
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'hybridConnectionName' => hybrid_connection_name,'subscriptionId' => @client.subscription_id},
297
+ query_params: {'api-version' => @client.api_version},
298
+ headers: request_headers.merge(custom_headers || {}),
299
+ base_url: request_url
300
+ }
301
+ promise = @client.make_request_async(:delete, path_template, options)
302
+
303
+ promise = promise.then do |result|
304
+ http_response = result.response
305
+ status_code = http_response.status
306
+ response_content = http_response.body
307
+ unless status_code == 200 || status_code == 204
308
+ error_model = JSON.load(response_content)
309
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
310
+ end
311
+
312
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
313
+
314
+ result
315
+ end
316
+
317
+ promise.execute
318
+ end
319
+
320
+ #
321
+ # Returns the description for the specified HybridConnection.
322
+ #
323
+ # @param resource_group_name [String] Name of the Resource group within the
324
+ # Azure subscription.
325
+ # @param namespace_name [String] The Namespace Name
326
+ # @param hybrid_connection_name [String] The hybrid connection name.
327
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
328
+ # will be added to the HTTP request.
329
+ #
330
+ # @return [HybridConnection] operation results.
331
+ #
332
+ def get(resource_group_name, namespace_name, hybrid_connection_name, custom_headers = nil)
333
+ response = get_async(resource_group_name, namespace_name, hybrid_connection_name, custom_headers).value!
334
+ response.body unless response.nil?
335
+ end
336
+
337
+ #
338
+ # Returns the description for the specified HybridConnection.
339
+ #
340
+ # @param resource_group_name [String] Name of the Resource group within the
341
+ # Azure subscription.
342
+ # @param namespace_name [String] The Namespace Name
343
+ # @param hybrid_connection_name [String] The hybrid connection name.
344
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
345
+ # will be added to the HTTP request.
346
+ #
347
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
348
+ #
349
+ def get_with_http_info(resource_group_name, namespace_name, hybrid_connection_name, custom_headers = nil)
350
+ get_async(resource_group_name, namespace_name, hybrid_connection_name, custom_headers).value!
351
+ end
352
+
353
+ #
354
+ # Returns the description for the specified HybridConnection.
355
+ #
356
+ # @param resource_group_name [String] Name of the Resource group within the
357
+ # Azure subscription.
358
+ # @param namespace_name [String] The Namespace Name
359
+ # @param hybrid_connection_name [String] The hybrid connection name.
360
+ # @param [Hash{String => String}] A hash of custom headers that will be added
361
+ # to the HTTP request.
362
+ #
363
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
364
+ #
365
+ def get_async(resource_group_name, namespace_name, hybrid_connection_name, custom_headers = nil)
366
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
367
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
368
+ fail ArgumentError, 'hybrid_connection_name is nil' if hybrid_connection_name.nil?
369
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
370
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
371
+
372
+
373
+ request_headers = {}
374
+
375
+ # Set Headers
376
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
377
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
378
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/HybridConnections/{hybridConnectionName}'
379
+
380
+ request_url = @base_url || @client.base_url
381
+
382
+ options = {
383
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
384
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'hybridConnectionName' => hybrid_connection_name,'subscriptionId' => @client.subscription_id},
385
+ query_params: {'api-version' => @client.api_version},
386
+ headers: request_headers.merge(custom_headers || {}),
387
+ base_url: request_url
388
+ }
389
+ promise = @client.make_request_async(:get, path_template, options)
390
+
391
+ promise = promise.then do |result|
392
+ http_response = result.response
393
+ status_code = http_response.status
394
+ response_content = http_response.body
395
+ unless status_code == 200
396
+ error_model = JSON.load(response_content)
397
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
398
+ end
399
+
400
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
401
+ # Deserialize Response
402
+ if status_code == 200
403
+ begin
404
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
405
+ result_mapper = Azure::Relay::Mgmt::V2016_07_01::Models::HybridConnection.mapper()
406
+ result.body = @client.deserialize(result_mapper, parsed_response)
407
+ rescue Exception => e
408
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
409
+ end
410
+ end
411
+
412
+ result
413
+ end
414
+
415
+ promise.execute
416
+ end
417
+
418
+ #
419
+ # Authorization rules for a HybridConnection.
420
+ #
421
+ # @param resource_group_name [String] Name of the Resource group within the
422
+ # Azure subscription.
423
+ # @param namespace_name [String] The Namespace Name
424
+ # @param hybrid_connection_name [String] The hybrid connection name.
425
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
426
+ # will be added to the HTTP request.
427
+ #
428
+ # @return [Array<AuthorizationRule>] operation results.
429
+ #
430
+ def list_authorization_rules(resource_group_name, namespace_name, hybrid_connection_name, custom_headers = nil)
431
+ first_page = list_authorization_rules_as_lazy(resource_group_name, namespace_name, hybrid_connection_name, custom_headers)
432
+ first_page.get_all_items
433
+ end
434
+
435
+ #
436
+ # Authorization rules for a HybridConnection.
437
+ #
438
+ # @param resource_group_name [String] Name of the Resource group within the
439
+ # Azure subscription.
440
+ # @param namespace_name [String] The Namespace Name
441
+ # @param hybrid_connection_name [String] The hybrid connection name.
442
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
443
+ # will be added to the HTTP request.
444
+ #
445
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
446
+ #
447
+ def list_authorization_rules_with_http_info(resource_group_name, namespace_name, hybrid_connection_name, custom_headers = nil)
448
+ list_authorization_rules_async(resource_group_name, namespace_name, hybrid_connection_name, custom_headers).value!
449
+ end
450
+
451
+ #
452
+ # Authorization rules for a HybridConnection.
453
+ #
454
+ # @param resource_group_name [String] Name of the Resource group within the
455
+ # Azure subscription.
456
+ # @param namespace_name [String] The Namespace Name
457
+ # @param hybrid_connection_name [String] The hybrid connection name.
458
+ # @param [Hash{String => String}] A hash of custom headers that will be added
459
+ # to the HTTP request.
460
+ #
461
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
462
+ #
463
+ def list_authorization_rules_async(resource_group_name, namespace_name, hybrid_connection_name, custom_headers = nil)
464
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
465
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
466
+ fail ArgumentError, 'hybrid_connection_name is nil' if hybrid_connection_name.nil?
467
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
468
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
469
+
470
+
471
+ request_headers = {}
472
+
473
+ # Set Headers
474
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
475
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
476
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/HybridConnections/{hybridConnectionName}/authorizationRules'
477
+
478
+ request_url = @base_url || @client.base_url
479
+
480
+ options = {
481
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
482
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'hybridConnectionName' => hybrid_connection_name,'subscriptionId' => @client.subscription_id},
483
+ query_params: {'api-version' => @client.api_version},
484
+ headers: request_headers.merge(custom_headers || {}),
485
+ base_url: request_url
486
+ }
487
+ promise = @client.make_request_async(:get, path_template, options)
488
+
489
+ promise = promise.then do |result|
490
+ http_response = result.response
491
+ status_code = http_response.status
492
+ response_content = http_response.body
493
+ unless status_code == 200
494
+ error_model = JSON.load(response_content)
495
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
496
+ end
497
+
498
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
499
+ # Deserialize Response
500
+ if status_code == 200
501
+ begin
502
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
503
+ result_mapper = Azure::Relay::Mgmt::V2016_07_01::Models::AuthorizationRuleListResult.mapper()
504
+ result.body = @client.deserialize(result_mapper, parsed_response)
505
+ rescue Exception => e
506
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
507
+ end
508
+ end
509
+
510
+ result
511
+ end
512
+
513
+ promise.execute
514
+ end
515
+
516
+ #
517
+ # Creates or Updates an authorization rule for a HybridConnection
518
+ #
519
+ # @param resource_group_name [String] Name of the Resource group within the
520
+ # Azure subscription.
521
+ # @param namespace_name [String] The Namespace Name
522
+ # @param hybrid_connection_name [String] The hybrid connection name.
523
+ # @param authorization_rule_name [String] The authorizationRule name.
524
+ # @param parameters [AuthorizationRule] The authorization rule parameters
525
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
526
+ # will be added to the HTTP request.
527
+ #
528
+ # @return [AuthorizationRule] operation results.
529
+ #
530
+ def create_or_update_authorization_rule(resource_group_name, namespace_name, hybrid_connection_name, authorization_rule_name, parameters, custom_headers = nil)
531
+ response = create_or_update_authorization_rule_async(resource_group_name, namespace_name, hybrid_connection_name, authorization_rule_name, parameters, custom_headers).value!
532
+ response.body unless response.nil?
533
+ end
534
+
535
+ #
536
+ # Creates or Updates an authorization rule for a HybridConnection
537
+ #
538
+ # @param resource_group_name [String] Name of the Resource group within the
539
+ # Azure subscription.
540
+ # @param namespace_name [String] The Namespace Name
541
+ # @param hybrid_connection_name [String] The hybrid connection name.
542
+ # @param authorization_rule_name [String] The authorizationRule name.
543
+ # @param parameters [AuthorizationRule] The authorization rule parameters
544
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
545
+ # will be added to the HTTP request.
546
+ #
547
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
548
+ #
549
+ def create_or_update_authorization_rule_with_http_info(resource_group_name, namespace_name, hybrid_connection_name, authorization_rule_name, parameters, custom_headers = nil)
550
+ create_or_update_authorization_rule_async(resource_group_name, namespace_name, hybrid_connection_name, authorization_rule_name, parameters, custom_headers).value!
551
+ end
552
+
553
+ #
554
+ # Creates or Updates an authorization rule for a HybridConnection
555
+ #
556
+ # @param resource_group_name [String] Name of the Resource group within the
557
+ # Azure subscription.
558
+ # @param namespace_name [String] The Namespace Name
559
+ # @param hybrid_connection_name [String] The hybrid connection name.
560
+ # @param authorization_rule_name [String] The authorizationRule name.
561
+ # @param parameters [AuthorizationRule] The authorization rule parameters
562
+ # @param [Hash{String => String}] A hash of custom headers that will be added
563
+ # to the HTTP request.
564
+ #
565
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
566
+ #
567
+ def create_or_update_authorization_rule_async(resource_group_name, namespace_name, hybrid_connection_name, authorization_rule_name, parameters, custom_headers = nil)
568
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
569
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
570
+ fail ArgumentError, 'hybrid_connection_name is nil' if hybrid_connection_name.nil?
571
+ fail ArgumentError, 'authorization_rule_name is nil' if authorization_rule_name.nil?
572
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
573
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
574
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
575
+
576
+
577
+ request_headers = {}
578
+
579
+ # Set Headers
580
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
581
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
582
+
583
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
584
+
585
+ # Serialize Request
586
+ request_mapper = Azure::Relay::Mgmt::V2016_07_01::Models::AuthorizationRule.mapper()
587
+ request_content = @client.serialize(request_mapper, parameters)
588
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
589
+
590
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/HybridConnections/{hybridConnectionName}/authorizationRules/{authorizationRuleName}'
591
+
592
+ request_url = @base_url || @client.base_url
593
+
594
+ options = {
595
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
596
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'hybridConnectionName' => hybrid_connection_name,'authorizationRuleName' => authorization_rule_name,'subscriptionId' => @client.subscription_id},
597
+ query_params: {'api-version' => @client.api_version},
598
+ body: request_content,
599
+ headers: request_headers.merge(custom_headers || {}),
600
+ base_url: request_url
601
+ }
602
+ promise = @client.make_request_async(:put, path_template, options)
603
+
604
+ promise = promise.then do |result|
605
+ http_response = result.response
606
+ status_code = http_response.status
607
+ response_content = http_response.body
608
+ unless status_code == 200
609
+ error_model = JSON.load(response_content)
610
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
611
+ end
612
+
613
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
614
+ # Deserialize Response
615
+ if status_code == 200
616
+ begin
617
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
618
+ result_mapper = Azure::Relay::Mgmt::V2016_07_01::Models::AuthorizationRule.mapper()
619
+ result.body = @client.deserialize(result_mapper, parsed_response)
620
+ rescue Exception => e
621
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
622
+ end
623
+ end
624
+
625
+ result
626
+ end
627
+
628
+ promise.execute
629
+ end
630
+
631
+ #
632
+ # Deletes a HybridConnection authorization rule
633
+ #
634
+ # @param resource_group_name [String] Name of the Resource group within the
635
+ # Azure subscription.
636
+ # @param namespace_name [String] The Namespace Name
637
+ # @param hybrid_connection_name [String] The hybrid connection name.
638
+ # @param authorization_rule_name [String] The authorizationRule name.
639
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
640
+ # will be added to the HTTP request.
641
+ #
642
+ #
643
+ def delete_authorization_rule(resource_group_name, namespace_name, hybrid_connection_name, authorization_rule_name, custom_headers = nil)
644
+ response = delete_authorization_rule_async(resource_group_name, namespace_name, hybrid_connection_name, authorization_rule_name, custom_headers).value!
645
+ nil
646
+ end
647
+
648
+ #
649
+ # Deletes a HybridConnection authorization rule
650
+ #
651
+ # @param resource_group_name [String] Name of the Resource group within the
652
+ # Azure subscription.
653
+ # @param namespace_name [String] The Namespace Name
654
+ # @param hybrid_connection_name [String] The hybrid connection name.
655
+ # @param authorization_rule_name [String] The authorizationRule name.
656
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
657
+ # will be added to the HTTP request.
658
+ #
659
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
660
+ #
661
+ def delete_authorization_rule_with_http_info(resource_group_name, namespace_name, hybrid_connection_name, authorization_rule_name, custom_headers = nil)
662
+ delete_authorization_rule_async(resource_group_name, namespace_name, hybrid_connection_name, authorization_rule_name, custom_headers).value!
663
+ end
664
+
665
+ #
666
+ # Deletes a HybridConnection authorization rule
667
+ #
668
+ # @param resource_group_name [String] Name of the Resource group within the
669
+ # Azure subscription.
670
+ # @param namespace_name [String] The Namespace Name
671
+ # @param hybrid_connection_name [String] The hybrid connection name.
672
+ # @param authorization_rule_name [String] The authorizationRule name.
673
+ # @param [Hash{String => String}] A hash of custom headers that will be added
674
+ # to the HTTP request.
675
+ #
676
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
677
+ #
678
+ def delete_authorization_rule_async(resource_group_name, namespace_name, hybrid_connection_name, authorization_rule_name, custom_headers = nil)
679
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
680
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
681
+ fail ArgumentError, 'hybrid_connection_name is nil' if hybrid_connection_name.nil?
682
+ fail ArgumentError, 'authorization_rule_name is nil' if authorization_rule_name.nil?
683
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
684
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
685
+
686
+
687
+ request_headers = {}
688
+
689
+ # Set Headers
690
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
691
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
692
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/HybridConnections/{hybridConnectionName}/authorizationRules/{authorizationRuleName}'
693
+
694
+ request_url = @base_url || @client.base_url
695
+
696
+ options = {
697
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
698
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'hybridConnectionName' => hybrid_connection_name,'authorizationRuleName' => authorization_rule_name,'subscriptionId' => @client.subscription_id},
699
+ query_params: {'api-version' => @client.api_version},
700
+ headers: request_headers.merge(custom_headers || {}),
701
+ base_url: request_url
702
+ }
703
+ promise = @client.make_request_async(:delete, path_template, options)
704
+
705
+ promise = promise.then do |result|
706
+ http_response = result.response
707
+ status_code = http_response.status
708
+ response_content = http_response.body
709
+ unless status_code == 200 || status_code == 204
710
+ error_model = JSON.load(response_content)
711
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
712
+ end
713
+
714
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
715
+
716
+ result
717
+ end
718
+
719
+ promise.execute
720
+ end
721
+
722
+ #
723
+ # HybridConnection authorizationRule for a HybridConnection by name.
724
+ #
725
+ # @param resource_group_name [String] Name of the Resource group within the
726
+ # Azure subscription.
727
+ # @param namespace_name [String] The Namespace Name
728
+ # @param hybrid_connection_name [String] The hybrid connection name.
729
+ # @param authorization_rule_name [String] The authorizationRule name.
730
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
731
+ # will be added to the HTTP request.
732
+ #
733
+ # @return [AuthorizationRule] operation results.
734
+ #
735
+ def get_authorization_rule(resource_group_name, namespace_name, hybrid_connection_name, authorization_rule_name, custom_headers = nil)
736
+ response = get_authorization_rule_async(resource_group_name, namespace_name, hybrid_connection_name, authorization_rule_name, custom_headers).value!
737
+ response.body unless response.nil?
738
+ end
739
+
740
+ #
741
+ # HybridConnection authorizationRule for a HybridConnection by name.
742
+ #
743
+ # @param resource_group_name [String] Name of the Resource group within the
744
+ # Azure subscription.
745
+ # @param namespace_name [String] The Namespace Name
746
+ # @param hybrid_connection_name [String] The hybrid connection name.
747
+ # @param authorization_rule_name [String] The authorizationRule name.
748
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
749
+ # will be added to the HTTP request.
750
+ #
751
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
752
+ #
753
+ def get_authorization_rule_with_http_info(resource_group_name, namespace_name, hybrid_connection_name, authorization_rule_name, custom_headers = nil)
754
+ get_authorization_rule_async(resource_group_name, namespace_name, hybrid_connection_name, authorization_rule_name, custom_headers).value!
755
+ end
756
+
757
+ #
758
+ # HybridConnection authorizationRule for a HybridConnection by name.
759
+ #
760
+ # @param resource_group_name [String] Name of the Resource group within the
761
+ # Azure subscription.
762
+ # @param namespace_name [String] The Namespace Name
763
+ # @param hybrid_connection_name [String] The hybrid connection name.
764
+ # @param authorization_rule_name [String] The authorizationRule name.
765
+ # @param [Hash{String => String}] A hash of custom headers that will be added
766
+ # to the HTTP request.
767
+ #
768
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
769
+ #
770
+ def get_authorization_rule_async(resource_group_name, namespace_name, hybrid_connection_name, authorization_rule_name, custom_headers = nil)
771
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
772
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
773
+ fail ArgumentError, 'hybrid_connection_name is nil' if hybrid_connection_name.nil?
774
+ fail ArgumentError, 'authorization_rule_name is nil' if authorization_rule_name.nil?
775
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
776
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
777
+
778
+
779
+ request_headers = {}
780
+
781
+ # Set Headers
782
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
783
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
784
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/HybridConnections/{hybridConnectionName}/authorizationRules/{authorizationRuleName}'
785
+
786
+ request_url = @base_url || @client.base_url
787
+
788
+ options = {
789
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
790
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'hybridConnectionName' => hybrid_connection_name,'authorizationRuleName' => authorization_rule_name,'subscriptionId' => @client.subscription_id},
791
+ query_params: {'api-version' => @client.api_version},
792
+ headers: request_headers.merge(custom_headers || {}),
793
+ base_url: request_url
794
+ }
795
+ promise = @client.make_request_async(:get, path_template, options)
796
+
797
+ promise = promise.then do |result|
798
+ http_response = result.response
799
+ status_code = http_response.status
800
+ response_content = http_response.body
801
+ unless status_code == 200
802
+ error_model = JSON.load(response_content)
803
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
804
+ end
805
+
806
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
807
+ # Deserialize Response
808
+ if status_code == 200
809
+ begin
810
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
811
+ result_mapper = Azure::Relay::Mgmt::V2016_07_01::Models::AuthorizationRule.mapper()
812
+ result.body = @client.deserialize(result_mapper, parsed_response)
813
+ rescue Exception => e
814
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
815
+ end
816
+ end
817
+
818
+ result
819
+ end
820
+
821
+ promise.execute
822
+ end
823
+
824
+ #
825
+ # Primary and Secondary ConnectionStrings to the HybridConnection.
826
+ #
827
+ # @param resource_group_name [String] Name of the Resource group within the
828
+ # Azure subscription.
829
+ # @param namespace_name [String] The Namespace Name
830
+ # @param hybrid_connection_name [String] The hybrid connection name.
831
+ # @param authorization_rule_name [String] The authorizationRule name.
832
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
833
+ # will be added to the HTTP request.
834
+ #
835
+ # @return [AuthorizationRuleKeys] operation results.
836
+ #
837
+ def list_keys(resource_group_name, namespace_name, hybrid_connection_name, authorization_rule_name, custom_headers = nil)
838
+ response = list_keys_async(resource_group_name, namespace_name, hybrid_connection_name, authorization_rule_name, custom_headers).value!
839
+ response.body unless response.nil?
840
+ end
841
+
842
+ #
843
+ # Primary and Secondary ConnectionStrings to the HybridConnection.
844
+ #
845
+ # @param resource_group_name [String] Name of the Resource group within the
846
+ # Azure subscription.
847
+ # @param namespace_name [String] The Namespace Name
848
+ # @param hybrid_connection_name [String] The hybrid connection name.
849
+ # @param authorization_rule_name [String] The authorizationRule name.
850
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
851
+ # will be added to the HTTP request.
852
+ #
853
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
854
+ #
855
+ def list_keys_with_http_info(resource_group_name, namespace_name, hybrid_connection_name, authorization_rule_name, custom_headers = nil)
856
+ list_keys_async(resource_group_name, namespace_name, hybrid_connection_name, authorization_rule_name, custom_headers).value!
857
+ end
858
+
859
+ #
860
+ # Primary and Secondary ConnectionStrings to the HybridConnection.
861
+ #
862
+ # @param resource_group_name [String] Name of the Resource group within the
863
+ # Azure subscription.
864
+ # @param namespace_name [String] The Namespace Name
865
+ # @param hybrid_connection_name [String] The hybrid connection name.
866
+ # @param authorization_rule_name [String] The authorizationRule name.
867
+ # @param [Hash{String => String}] A hash of custom headers that will be added
868
+ # to the HTTP request.
869
+ #
870
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
871
+ #
872
+ def list_keys_async(resource_group_name, namespace_name, hybrid_connection_name, authorization_rule_name, custom_headers = nil)
873
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
874
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
875
+ fail ArgumentError, 'hybrid_connection_name is nil' if hybrid_connection_name.nil?
876
+ fail ArgumentError, 'authorization_rule_name is nil' if authorization_rule_name.nil?
877
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
878
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
879
+
880
+
881
+ request_headers = {}
882
+
883
+ # Set Headers
884
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
885
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
886
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/HybridConnections/{hybridConnectionName}/authorizationRules/{authorizationRuleName}/ListKeys'
887
+
888
+ request_url = @base_url || @client.base_url
889
+
890
+ options = {
891
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
892
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'hybridConnectionName' => hybrid_connection_name,'authorizationRuleName' => authorization_rule_name,'subscriptionId' => @client.subscription_id},
893
+ query_params: {'api-version' => @client.api_version},
894
+ headers: request_headers.merge(custom_headers || {}),
895
+ base_url: request_url
896
+ }
897
+ promise = @client.make_request_async(:post, path_template, options)
898
+
899
+ promise = promise.then do |result|
900
+ http_response = result.response
901
+ status_code = http_response.status
902
+ response_content = http_response.body
903
+ unless status_code == 200
904
+ error_model = JSON.load(response_content)
905
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
906
+ end
907
+
908
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
909
+ # Deserialize Response
910
+ if status_code == 200
911
+ begin
912
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
913
+ result_mapper = Azure::Relay::Mgmt::V2016_07_01::Models::AuthorizationRuleKeys.mapper()
914
+ result.body = @client.deserialize(result_mapper, parsed_response)
915
+ rescue Exception => e
916
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
917
+ end
918
+ end
919
+
920
+ result
921
+ end
922
+
923
+ promise.execute
924
+ end
925
+
926
+ #
927
+ # Regenerates the Primary or Secondary ConnectionStrings to the
928
+ # HybridConnection
929
+ #
930
+ # @param resource_group_name [String] Name of the Resource group within the
931
+ # Azure subscription.
932
+ # @param namespace_name [String] The Namespace Name
933
+ # @param hybrid_connection_name [String] The hybrid connection name.
934
+ # @param authorization_rule_name [String] The authorizationRule name.
935
+ # @param parameters [RegenerateKeysParameters] Parameters supplied to
936
+ # regenerate Auth Rule.
937
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
938
+ # will be added to the HTTP request.
939
+ #
940
+ # @return [AuthorizationRuleKeys] operation results.
941
+ #
942
+ def regenerate_keys(resource_group_name, namespace_name, hybrid_connection_name, authorization_rule_name, parameters, custom_headers = nil)
943
+ response = regenerate_keys_async(resource_group_name, namespace_name, hybrid_connection_name, authorization_rule_name, parameters, custom_headers).value!
944
+ response.body unless response.nil?
945
+ end
946
+
947
+ #
948
+ # Regenerates the Primary or Secondary ConnectionStrings to the
949
+ # HybridConnection
950
+ #
951
+ # @param resource_group_name [String] Name of the Resource group within the
952
+ # Azure subscription.
953
+ # @param namespace_name [String] The Namespace Name
954
+ # @param hybrid_connection_name [String] The hybrid connection name.
955
+ # @param authorization_rule_name [String] The authorizationRule name.
956
+ # @param parameters [RegenerateKeysParameters] Parameters supplied to
957
+ # regenerate Auth Rule.
958
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
959
+ # will be added to the HTTP request.
960
+ #
961
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
962
+ #
963
+ def regenerate_keys_with_http_info(resource_group_name, namespace_name, hybrid_connection_name, authorization_rule_name, parameters, custom_headers = nil)
964
+ regenerate_keys_async(resource_group_name, namespace_name, hybrid_connection_name, authorization_rule_name, parameters, custom_headers).value!
965
+ end
966
+
967
+ #
968
+ # Regenerates the Primary or Secondary ConnectionStrings to the
969
+ # HybridConnection
970
+ #
971
+ # @param resource_group_name [String] Name of the Resource group within the
972
+ # Azure subscription.
973
+ # @param namespace_name [String] The Namespace Name
974
+ # @param hybrid_connection_name [String] The hybrid connection name.
975
+ # @param authorization_rule_name [String] The authorizationRule name.
976
+ # @param parameters [RegenerateKeysParameters] Parameters supplied to
977
+ # regenerate Auth Rule.
978
+ # @param [Hash{String => String}] A hash of custom headers that will be added
979
+ # to the HTTP request.
980
+ #
981
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
982
+ #
983
+ def regenerate_keys_async(resource_group_name, namespace_name, hybrid_connection_name, authorization_rule_name, parameters, custom_headers = nil)
984
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
985
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
986
+ fail ArgumentError, 'hybrid_connection_name is nil' if hybrid_connection_name.nil?
987
+ fail ArgumentError, 'authorization_rule_name is nil' if authorization_rule_name.nil?
988
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
989
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
990
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
991
+
992
+
993
+ request_headers = {}
994
+
995
+ # Set Headers
996
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
997
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
998
+
999
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1000
+
1001
+ # Serialize Request
1002
+ request_mapper = Azure::Relay::Mgmt::V2016_07_01::Models::RegenerateKeysParameters.mapper()
1003
+ request_content = @client.serialize(request_mapper, parameters)
1004
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1005
+
1006
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/HybridConnections/{hybridConnectionName}/authorizationRules/{authorizationRuleName}/regenerateKeys'
1007
+
1008
+ request_url = @base_url || @client.base_url
1009
+
1010
+ options = {
1011
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1012
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'hybridConnectionName' => hybrid_connection_name,'authorizationRuleName' => authorization_rule_name,'subscriptionId' => @client.subscription_id},
1013
+ query_params: {'api-version' => @client.api_version},
1014
+ body: request_content,
1015
+ headers: request_headers.merge(custom_headers || {}),
1016
+ base_url: request_url
1017
+ }
1018
+ promise = @client.make_request_async(:post, path_template, options)
1019
+
1020
+ promise = promise.then do |result|
1021
+ http_response = result.response
1022
+ status_code = http_response.status
1023
+ response_content = http_response.body
1024
+ unless status_code == 200
1025
+ error_model = JSON.load(response_content)
1026
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1027
+ end
1028
+
1029
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1030
+ # Deserialize Response
1031
+ if status_code == 200
1032
+ begin
1033
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1034
+ result_mapper = Azure::Relay::Mgmt::V2016_07_01::Models::AuthorizationRuleKeys.mapper()
1035
+ result.body = @client.deserialize(result_mapper, parsed_response)
1036
+ rescue Exception => e
1037
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1038
+ end
1039
+ end
1040
+
1041
+ result
1042
+ end
1043
+
1044
+ promise.execute
1045
+ end
1046
+
1047
+ #
1048
+ # Lists the HybridConnection within the namespace.
1049
+ #
1050
+ # @param next_page_link [String] The NextLink from the previous successful call
1051
+ # to List operation.
1052
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1053
+ # will be added to the HTTP request.
1054
+ #
1055
+ # @return [HybridConnectionListResult] operation results.
1056
+ #
1057
+ def list_by_namespace_next(next_page_link, custom_headers = nil)
1058
+ response = list_by_namespace_next_async(next_page_link, custom_headers).value!
1059
+ response.body unless response.nil?
1060
+ end
1061
+
1062
+ #
1063
+ # Lists the HybridConnection within the namespace.
1064
+ #
1065
+ # @param next_page_link [String] The NextLink from the previous successful call
1066
+ # to List operation.
1067
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1068
+ # will be added to the HTTP request.
1069
+ #
1070
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1071
+ #
1072
+ def list_by_namespace_next_with_http_info(next_page_link, custom_headers = nil)
1073
+ list_by_namespace_next_async(next_page_link, custom_headers).value!
1074
+ end
1075
+
1076
+ #
1077
+ # Lists the HybridConnection within the namespace.
1078
+ #
1079
+ # @param next_page_link [String] The NextLink from the previous successful call
1080
+ # to List operation.
1081
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1082
+ # to the HTTP request.
1083
+ #
1084
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1085
+ #
1086
+ def list_by_namespace_next_async(next_page_link, custom_headers = nil)
1087
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1088
+
1089
+
1090
+ request_headers = {}
1091
+
1092
+ # Set Headers
1093
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1094
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1095
+ path_template = '{nextLink}'
1096
+
1097
+ request_url = @base_url || @client.base_url
1098
+
1099
+ options = {
1100
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1101
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1102
+ headers: request_headers.merge(custom_headers || {}),
1103
+ base_url: request_url
1104
+ }
1105
+ promise = @client.make_request_async(:get, path_template, options)
1106
+
1107
+ promise = promise.then do |result|
1108
+ http_response = result.response
1109
+ status_code = http_response.status
1110
+ response_content = http_response.body
1111
+ unless status_code == 200
1112
+ error_model = JSON.load(response_content)
1113
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1114
+ end
1115
+
1116
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1117
+ # Deserialize Response
1118
+ if status_code == 200
1119
+ begin
1120
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1121
+ result_mapper = Azure::Relay::Mgmt::V2016_07_01::Models::HybridConnectionListResult.mapper()
1122
+ result.body = @client.deserialize(result_mapper, parsed_response)
1123
+ rescue Exception => e
1124
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1125
+ end
1126
+ end
1127
+
1128
+ result
1129
+ end
1130
+
1131
+ promise.execute
1132
+ end
1133
+
1134
+ #
1135
+ # Authorization rules for a HybridConnection.
1136
+ #
1137
+ # @param next_page_link [String] The NextLink from the previous successful call
1138
+ # to List operation.
1139
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1140
+ # will be added to the HTTP request.
1141
+ #
1142
+ # @return [AuthorizationRuleListResult] operation results.
1143
+ #
1144
+ def list_authorization_rules_next(next_page_link, custom_headers = nil)
1145
+ response = list_authorization_rules_next_async(next_page_link, custom_headers).value!
1146
+ response.body unless response.nil?
1147
+ end
1148
+
1149
+ #
1150
+ # Authorization rules for a HybridConnection.
1151
+ #
1152
+ # @param next_page_link [String] The NextLink from the previous successful call
1153
+ # to List operation.
1154
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1155
+ # will be added to the HTTP request.
1156
+ #
1157
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1158
+ #
1159
+ def list_authorization_rules_next_with_http_info(next_page_link, custom_headers = nil)
1160
+ list_authorization_rules_next_async(next_page_link, custom_headers).value!
1161
+ end
1162
+
1163
+ #
1164
+ # Authorization rules for a HybridConnection.
1165
+ #
1166
+ # @param next_page_link [String] The NextLink from the previous successful call
1167
+ # to List operation.
1168
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1169
+ # to the HTTP request.
1170
+ #
1171
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1172
+ #
1173
+ def list_authorization_rules_next_async(next_page_link, custom_headers = nil)
1174
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1175
+
1176
+
1177
+ request_headers = {}
1178
+
1179
+ # Set Headers
1180
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1181
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1182
+ path_template = '{nextLink}'
1183
+
1184
+ request_url = @base_url || @client.base_url
1185
+
1186
+ options = {
1187
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1188
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1189
+ headers: request_headers.merge(custom_headers || {}),
1190
+ base_url: request_url
1191
+ }
1192
+ promise = @client.make_request_async(:get, path_template, options)
1193
+
1194
+ promise = promise.then do |result|
1195
+ http_response = result.response
1196
+ status_code = http_response.status
1197
+ response_content = http_response.body
1198
+ unless status_code == 200
1199
+ error_model = JSON.load(response_content)
1200
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1201
+ end
1202
+
1203
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1204
+ # Deserialize Response
1205
+ if status_code == 200
1206
+ begin
1207
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1208
+ result_mapper = Azure::Relay::Mgmt::V2016_07_01::Models::AuthorizationRuleListResult.mapper()
1209
+ result.body = @client.deserialize(result_mapper, parsed_response)
1210
+ rescue Exception => e
1211
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1212
+ end
1213
+ end
1214
+
1215
+ result
1216
+ end
1217
+
1218
+ promise.execute
1219
+ end
1220
+
1221
+ #
1222
+ # Lists the HybridConnection within the namespace.
1223
+ #
1224
+ # @param resource_group_name [String] Name of the Resource group within the
1225
+ # Azure subscription.
1226
+ # @param namespace_name [String] The Namespace Name
1227
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1228
+ # will be added to the HTTP request.
1229
+ #
1230
+ # @return [HybridConnectionListResult] which provide lazy access to pages of
1231
+ # the response.
1232
+ #
1233
+ def list_by_namespace_as_lazy(resource_group_name, namespace_name, custom_headers = nil)
1234
+ response = list_by_namespace_async(resource_group_name, namespace_name, custom_headers).value!
1235
+ unless response.nil?
1236
+ page = response.body
1237
+ page.next_method = Proc.new do |next_page_link|
1238
+ list_by_namespace_next_async(next_page_link, custom_headers)
1239
+ end
1240
+ page
1241
+ end
1242
+ end
1243
+
1244
+ #
1245
+ # Authorization rules for a HybridConnection.
1246
+ #
1247
+ # @param resource_group_name [String] Name of the Resource group within the
1248
+ # Azure subscription.
1249
+ # @param namespace_name [String] The Namespace Name
1250
+ # @param hybrid_connection_name [String] The hybrid connection name.
1251
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1252
+ # will be added to the HTTP request.
1253
+ #
1254
+ # @return [AuthorizationRuleListResult] which provide lazy access to pages of
1255
+ # the response.
1256
+ #
1257
+ def list_authorization_rules_as_lazy(resource_group_name, namespace_name, hybrid_connection_name, custom_headers = nil)
1258
+ response = list_authorization_rules_async(resource_group_name, namespace_name, hybrid_connection_name, custom_headers).value!
1259
+ unless response.nil?
1260
+ page = response.body
1261
+ page.next_method = Proc.new do |next_page_link|
1262
+ list_authorization_rules_next_async(next_page_link, custom_headers)
1263
+ end
1264
+ page
1265
+ end
1266
+ end
1267
+
1268
+ end
1269
+ end