azure_mgmt_data_factory 0.18.3 → 0.18.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2017-09-01-preview/generated/azure_mgmt_data_factory/data_factory_management_client.rb +1 -1
  3. data/lib/2018-06-01/generated/azure_mgmt_data_factory.rb +129 -115
  4. data/lib/2018-06-01/generated/azure_mgmt_data_factory/data_factory_management_client.rb +9 -1
  5. data/lib/2018-06-01/generated/azure_mgmt_data_factory/exposure_control.rb +114 -0
  6. data/lib/2018-06-01/generated/azure_mgmt_data_factory/managed_private_endpoints.rb +611 -0
  7. data/lib/2018-06-01/generated/azure_mgmt_data_factory/managed_virtual_networks.rb +486 -0
  8. data/lib/2018-06-01/generated/azure_mgmt_data_factory/models/az_power_shell_setup.rb +61 -0
  9. data/lib/2018-06-01/generated/azure_mgmt_data_factory/models/azure_blob_fslinked_service.rb +14 -0
  10. data/lib/2018-06-01/generated/azure_mgmt_data_factory/models/azure_blob_storage_linked_service.rb +14 -0
  11. data/lib/2018-06-01/generated/azure_mgmt_data_factory/models/azure_data_lake_store_linked_service.rb +14 -0
  12. data/lib/2018-06-01/generated/azure_mgmt_data_factory/models/azure_databricks_linked_service.rb +12 -0
  13. data/lib/2018-06-01/generated/azure_mgmt_data_factory/models/azure_file_storage_linked_service.rb +12 -0
  14. data/lib/2018-06-01/generated/azure_mgmt_data_factory/models/azure_file_storage_write_settings.rb +81 -0
  15. data/lib/2018-06-01/generated/azure_mgmt_data_factory/models/azure_sql_database_linked_service.rb +14 -0
  16. data/lib/2018-06-01/generated/azure_mgmt_data_factory/models/azure_sql_dwlinked_service.rb +14 -0
  17. data/lib/2018-06-01/generated/azure_mgmt_data_factory/models/azure_sql_milinked_service.rb +14 -0
  18. data/lib/2018-06-01/generated/azure_mgmt_data_factory/models/connection_state_properties.rb +71 -0
  19. data/lib/2018-06-01/generated/azure_mgmt_data_factory/models/copy_sink.rb +1 -0
  20. data/lib/2018-06-01/generated/azure_mgmt_data_factory/models/cosmos_db_sql_api_source.rb +12 -0
  21. data/lib/2018-06-01/generated/azure_mgmt_data_factory/models/custom_setup_base.rb +1 -0
  22. data/lib/2018-06-01/generated/azure_mgmt_data_factory/models/data_flow_staging_info.rb +3 -2
  23. data/lib/2018-06-01/generated/azure_mgmt_data_factory/models/exposure_control_batch_request.rb +56 -0
  24. data/lib/2018-06-01/generated/azure_mgmt_data_factory/models/exposure_control_batch_response.rb +56 -0
  25. data/lib/2018-06-01/generated/azure_mgmt_data_factory/models/hdfs_read_settings.rb +13 -0
  26. data/lib/2018-06-01/generated/azure_mgmt_data_factory/models/managed_private_endpoint.rb +135 -0
  27. data/lib/2018-06-01/generated/azure_mgmt_data_factory/models/managed_private_endpoint_list_response.rb +100 -0
  28. data/lib/2018-06-01/generated/azure_mgmt_data_factory/models/managed_private_endpoint_resource.rb +83 -0
  29. data/lib/2018-06-01/generated/azure_mgmt_data_factory/models/managed_virtual_network.rb +78 -0
  30. data/lib/2018-06-01/generated/azure_mgmt_data_factory/models/managed_virtual_network_list_response.rb +100 -0
  31. data/lib/2018-06-01/generated/azure_mgmt_data_factory/models/managed_virtual_network_resource.rb +83 -0
  32. data/lib/2018-06-01/generated/azure_mgmt_data_factory/models/odata_linked_service.rb +14 -0
  33. data/lib/2018-06-01/generated/azure_mgmt_data_factory/models/quick_books_linked_service.rb +19 -6
  34. data/lib/2018-06-01/generated/azure_mgmt_data_factory/models/rest_service_linked_service.rb +14 -0
  35. data/lib/2018-06-01/generated/azure_mgmt_data_factory/models/rest_sink.rb +180 -0
  36. data/lib/2018-06-01/generated/azure_mgmt_data_factory/models/salesforce_marketing_cloud_linked_service.rb +14 -1
  37. data/lib/2018-06-01/generated/azure_mgmt_data_factory/models/sap_open_hub_linked_service.rb +51 -3
  38. data/lib/2018-06-01/generated/azure_mgmt_data_factory/models/sap_open_hub_source.rb +26 -0
  39. data/lib/2018-06-01/generated/azure_mgmt_data_factory/models/sap_table_source.rb +13 -0
  40. data/lib/2018-06-01/generated/azure_mgmt_data_factory/models/square_linked_service.rb +15 -3
  41. data/lib/2018-06-01/generated/azure_mgmt_data_factory/models/store_write_settings.rb +1 -0
  42. data/lib/2018-06-01/generated/azure_mgmt_data_factory/models/web_hook_activity.rb +3 -3
  43. data/lib/2018-06-01/generated/azure_mgmt_data_factory/models/xero_linked_service.rb +13 -1
  44. data/lib/2018-06-01/generated/azure_mgmt_data_factory/models/xml_read_settings.rb +24 -0
  45. data/lib/2018-06-01/generated/azure_mgmt_data_factory/models/zoho_linked_service.rb +13 -1
  46. data/lib/2018-06-01/generated/azure_mgmt_data_factory/trigger_runs.rb +100 -0
  47. data/lib/profiles/latest/modules/datafactory_profile_module.rb +431 -379
  48. data/lib/version.rb +1 -1
  49. metadata +16 -2
@@ -0,0 +1,486 @@
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::DataFactory::Mgmt::V2018_06_01
7
+ #
8
+ # The Azure Data Factory V2 management API provides a RESTful set of web
9
+ # services that interact with Azure Data Factory V2 services.
10
+ #
11
+ class ManagedVirtualNetworks
12
+ include MsRestAzure
13
+
14
+ #
15
+ # Creates and initializes a new instance of the ManagedVirtualNetworks class.
16
+ # @param client service class for accessing basic functionality.
17
+ #
18
+ def initialize(client)
19
+ @client = client
20
+ end
21
+
22
+ # @return [DataFactoryManagementClient] reference to the DataFactoryManagementClient
23
+ attr_reader :client
24
+
25
+ #
26
+ # Lists managed Virtual Networks.
27
+ #
28
+ # @param resource_group_name [String] The resource group name.
29
+ # @param factory_name [String] The factory name.
30
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
31
+ # will be added to the HTTP request.
32
+ #
33
+ # @return [Array<ManagedVirtualNetworkResource>] operation results.
34
+ #
35
+ def list_by_factory(resource_group_name, factory_name, custom_headers:nil)
36
+ first_page = list_by_factory_as_lazy(resource_group_name, factory_name, custom_headers:custom_headers)
37
+ first_page.get_all_items
38
+ end
39
+
40
+ #
41
+ # Lists managed Virtual Networks.
42
+ #
43
+ # @param resource_group_name [String] The resource group name.
44
+ # @param factory_name [String] The factory name.
45
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
46
+ # will be added to the HTTP request.
47
+ #
48
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
49
+ #
50
+ def list_by_factory_with_http_info(resource_group_name, factory_name, custom_headers:nil)
51
+ list_by_factory_async(resource_group_name, factory_name, custom_headers:custom_headers).value!
52
+ end
53
+
54
+ #
55
+ # Lists managed Virtual Networks.
56
+ #
57
+ # @param resource_group_name [String] The resource group name.
58
+ # @param factory_name [String] The factory name.
59
+ # @param [Hash{String => String}] A hash of custom headers that will be added
60
+ # to the HTTP request.
61
+ #
62
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
63
+ #
64
+ def list_by_factory_async(resource_group_name, factory_name, custom_headers:nil)
65
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
66
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
67
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
68
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
69
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
70
+ fail ArgumentError, 'factory_name is nil' if factory_name.nil?
71
+ fail ArgumentError, "'factory_name' should satisfy the constraint - 'MaxLength': '63'" if !factory_name.nil? && factory_name.length > 63
72
+ fail ArgumentError, "'factory_name' should satisfy the constraint - 'MinLength': '3'" if !factory_name.nil? && factory_name.length < 3
73
+ fail ArgumentError, "'factory_name' should satisfy the constraint - 'Pattern': '^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$'" if !factory_name.nil? && factory_name.match(Regexp.new('^^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$$')).nil?
74
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
75
+
76
+
77
+ request_headers = {}
78
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
79
+
80
+ # Set Headers
81
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
82
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
83
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/managedVirtualNetworks'
84
+
85
+ request_url = @base_url || @client.base_url
86
+
87
+ options = {
88
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
89
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'factoryName' => factory_name},
90
+ query_params: {'api-version' => @client.api_version},
91
+ headers: request_headers.merge(custom_headers || {}),
92
+ base_url: request_url
93
+ }
94
+ promise = @client.make_request_async(:get, path_template, options)
95
+
96
+ promise = promise.then do |result|
97
+ http_response = result.response
98
+ status_code = http_response.status
99
+ response_content = http_response.body
100
+ unless status_code == 200
101
+ error_model = JSON.load(response_content)
102
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
103
+ end
104
+
105
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
106
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
107
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
108
+ # Deserialize Response
109
+ if status_code == 200
110
+ begin
111
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
112
+ result_mapper = Azure::DataFactory::Mgmt::V2018_06_01::Models::ManagedVirtualNetworkListResponse.mapper()
113
+ result.body = @client.deserialize(result_mapper, parsed_response)
114
+ rescue Exception => e
115
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
116
+ end
117
+ end
118
+
119
+ result
120
+ end
121
+
122
+ promise.execute
123
+ end
124
+
125
+ #
126
+ # Creates or updates a managed Virtual Network.
127
+ #
128
+ # @param resource_group_name [String] The resource group name.
129
+ # @param factory_name [String] The factory name.
130
+ # @param managed_virtual_network_name [String] Managed virtual network name
131
+ # @param managed_virtual_network [ManagedVirtualNetworkResource] Managed
132
+ # Virtual Network resource definition.
133
+ # @param if_match [String] ETag of the managed Virtual Network entity. Should
134
+ # only be specified for update, for which it should match existing entity or
135
+ # can be * for unconditional update.
136
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
137
+ # will be added to the HTTP request.
138
+ #
139
+ # @return [ManagedVirtualNetworkResource] operation results.
140
+ #
141
+ def create_or_update(resource_group_name, factory_name, managed_virtual_network_name, managed_virtual_network, if_match:nil, custom_headers:nil)
142
+ response = create_or_update_async(resource_group_name, factory_name, managed_virtual_network_name, managed_virtual_network, if_match:if_match, custom_headers:custom_headers).value!
143
+ response.body unless response.nil?
144
+ end
145
+
146
+ #
147
+ # Creates or updates a managed Virtual Network.
148
+ #
149
+ # @param resource_group_name [String] The resource group name.
150
+ # @param factory_name [String] The factory name.
151
+ # @param managed_virtual_network_name [String] Managed virtual network name
152
+ # @param managed_virtual_network [ManagedVirtualNetworkResource] Managed
153
+ # Virtual Network resource definition.
154
+ # @param if_match [String] ETag of the managed Virtual Network entity. Should
155
+ # only be specified for update, for which it should match existing entity or
156
+ # can be * for unconditional update.
157
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
158
+ # will be added to the HTTP request.
159
+ #
160
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
161
+ #
162
+ def create_or_update_with_http_info(resource_group_name, factory_name, managed_virtual_network_name, managed_virtual_network, if_match:nil, custom_headers:nil)
163
+ create_or_update_async(resource_group_name, factory_name, managed_virtual_network_name, managed_virtual_network, if_match:if_match, custom_headers:custom_headers).value!
164
+ end
165
+
166
+ #
167
+ # Creates or updates a managed Virtual Network.
168
+ #
169
+ # @param resource_group_name [String] The resource group name.
170
+ # @param factory_name [String] The factory name.
171
+ # @param managed_virtual_network_name [String] Managed virtual network name
172
+ # @param managed_virtual_network [ManagedVirtualNetworkResource] Managed
173
+ # Virtual Network resource definition.
174
+ # @param if_match [String] ETag of the managed Virtual Network entity. Should
175
+ # only be specified for update, for which it should match existing entity or
176
+ # can be * for unconditional update.
177
+ # @param [Hash{String => String}] A hash of custom headers that will be added
178
+ # to the HTTP request.
179
+ #
180
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
181
+ #
182
+ def create_or_update_async(resource_group_name, factory_name, managed_virtual_network_name, managed_virtual_network, if_match:nil, custom_headers:nil)
183
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
184
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
185
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
186
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
187
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
188
+ fail ArgumentError, 'factory_name is nil' if factory_name.nil?
189
+ fail ArgumentError, "'factory_name' should satisfy the constraint - 'MaxLength': '63'" if !factory_name.nil? && factory_name.length > 63
190
+ fail ArgumentError, "'factory_name' should satisfy the constraint - 'MinLength': '3'" if !factory_name.nil? && factory_name.length < 3
191
+ fail ArgumentError, "'factory_name' should satisfy the constraint - 'Pattern': '^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$'" if !factory_name.nil? && factory_name.match(Regexp.new('^^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$$')).nil?
192
+ fail ArgumentError, 'managed_virtual_network_name is nil' if managed_virtual_network_name.nil?
193
+ fail ArgumentError, "'managed_virtual_network_name' should satisfy the constraint - 'MaxLength': '127'" if !managed_virtual_network_name.nil? && managed_virtual_network_name.length > 127
194
+ fail ArgumentError, "'managed_virtual_network_name' should satisfy the constraint - 'MinLength': '1'" if !managed_virtual_network_name.nil? && managed_virtual_network_name.length < 1
195
+ fail ArgumentError, "'managed_virtual_network_name' should satisfy the constraint - 'Pattern': '^([_A-Za-z0-9]|([_A-Za-z0-9][-_A-Za-z0-9]{0,125}[_A-Za-z0-9]))$'" if !managed_virtual_network_name.nil? && managed_virtual_network_name.match(Regexp.new('^^([_A-Za-z0-9]|([_A-Za-z0-9][-_A-Za-z0-9]{0,125}[_A-Za-z0-9]))$$')).nil?
196
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
197
+ fail ArgumentError, 'managed_virtual_network is nil' if managed_virtual_network.nil?
198
+
199
+
200
+ request_headers = {}
201
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
202
+
203
+ # Set Headers
204
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
205
+ request_headers['If-Match'] = if_match unless if_match.nil?
206
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
207
+
208
+ # Serialize Request
209
+ request_mapper = Azure::DataFactory::Mgmt::V2018_06_01::Models::ManagedVirtualNetworkResource.mapper()
210
+ request_content = @client.serialize(request_mapper, managed_virtual_network)
211
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
212
+
213
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/managedVirtualNetworks/{managedVirtualNetworkName}'
214
+
215
+ request_url = @base_url || @client.base_url
216
+
217
+ options = {
218
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
219
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'factoryName' => factory_name,'managedVirtualNetworkName' => managed_virtual_network_name},
220
+ query_params: {'api-version' => @client.api_version},
221
+ body: request_content,
222
+ headers: request_headers.merge(custom_headers || {}),
223
+ base_url: request_url
224
+ }
225
+ promise = @client.make_request_async(:put, path_template, options)
226
+
227
+ promise = promise.then do |result|
228
+ http_response = result.response
229
+ status_code = http_response.status
230
+ response_content = http_response.body
231
+ unless status_code == 200
232
+ error_model = JSON.load(response_content)
233
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
234
+ end
235
+
236
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
237
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
238
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
239
+ # Deserialize Response
240
+ if status_code == 200
241
+ begin
242
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
243
+ result_mapper = Azure::DataFactory::Mgmt::V2018_06_01::Models::ManagedVirtualNetworkResource.mapper()
244
+ result.body = @client.deserialize(result_mapper, parsed_response)
245
+ rescue Exception => e
246
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
247
+ end
248
+ end
249
+
250
+ result
251
+ end
252
+
253
+ promise.execute
254
+ end
255
+
256
+ #
257
+ # Gets a managed Virtual Network.
258
+ #
259
+ # @param resource_group_name [String] The resource group name.
260
+ # @param factory_name [String] The factory name.
261
+ # @param managed_virtual_network_name [String] Managed virtual network name
262
+ # @param if_none_match [String] ETag of the managed Virtual Network entity.
263
+ # Should only be specified for get. If the ETag matches the existing entity
264
+ # tag, or if * was provided, then no content will be returned.
265
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
266
+ # will be added to the HTTP request.
267
+ #
268
+ # @return [ManagedVirtualNetworkResource] operation results.
269
+ #
270
+ def get(resource_group_name, factory_name, managed_virtual_network_name, if_none_match:nil, custom_headers:nil)
271
+ response = get_async(resource_group_name, factory_name, managed_virtual_network_name, if_none_match:if_none_match, custom_headers:custom_headers).value!
272
+ response.body unless response.nil?
273
+ end
274
+
275
+ #
276
+ # Gets a managed Virtual Network.
277
+ #
278
+ # @param resource_group_name [String] The resource group name.
279
+ # @param factory_name [String] The factory name.
280
+ # @param managed_virtual_network_name [String] Managed virtual network name
281
+ # @param if_none_match [String] ETag of the managed Virtual Network entity.
282
+ # Should only be specified for get. If the ETag matches the existing entity
283
+ # tag, or if * was provided, then no content will be returned.
284
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
285
+ # will be added to the HTTP request.
286
+ #
287
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
288
+ #
289
+ def get_with_http_info(resource_group_name, factory_name, managed_virtual_network_name, if_none_match:nil, custom_headers:nil)
290
+ get_async(resource_group_name, factory_name, managed_virtual_network_name, if_none_match:if_none_match, custom_headers:custom_headers).value!
291
+ end
292
+
293
+ #
294
+ # Gets a managed Virtual Network.
295
+ #
296
+ # @param resource_group_name [String] The resource group name.
297
+ # @param factory_name [String] The factory name.
298
+ # @param managed_virtual_network_name [String] Managed virtual network name
299
+ # @param if_none_match [String] ETag of the managed Virtual Network entity.
300
+ # Should only be specified for get. If the ETag matches the existing entity
301
+ # tag, or if * was provided, then no content will be returned.
302
+ # @param [Hash{String => String}] A hash of custom headers that will be added
303
+ # to the HTTP request.
304
+ #
305
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
306
+ #
307
+ def get_async(resource_group_name, factory_name, managed_virtual_network_name, if_none_match:nil, custom_headers:nil)
308
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
309
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
310
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
311
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
312
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
313
+ fail ArgumentError, 'factory_name is nil' if factory_name.nil?
314
+ fail ArgumentError, "'factory_name' should satisfy the constraint - 'MaxLength': '63'" if !factory_name.nil? && factory_name.length > 63
315
+ fail ArgumentError, "'factory_name' should satisfy the constraint - 'MinLength': '3'" if !factory_name.nil? && factory_name.length < 3
316
+ fail ArgumentError, "'factory_name' should satisfy the constraint - 'Pattern': '^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$'" if !factory_name.nil? && factory_name.match(Regexp.new('^^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$$')).nil?
317
+ fail ArgumentError, 'managed_virtual_network_name is nil' if managed_virtual_network_name.nil?
318
+ fail ArgumentError, "'managed_virtual_network_name' should satisfy the constraint - 'MaxLength': '127'" if !managed_virtual_network_name.nil? && managed_virtual_network_name.length > 127
319
+ fail ArgumentError, "'managed_virtual_network_name' should satisfy the constraint - 'MinLength': '1'" if !managed_virtual_network_name.nil? && managed_virtual_network_name.length < 1
320
+ fail ArgumentError, "'managed_virtual_network_name' should satisfy the constraint - 'Pattern': '^([_A-Za-z0-9]|([_A-Za-z0-9][-_A-Za-z0-9]{0,125}[_A-Za-z0-9]))$'" if !managed_virtual_network_name.nil? && managed_virtual_network_name.match(Regexp.new('^^([_A-Za-z0-9]|([_A-Za-z0-9][-_A-Za-z0-9]{0,125}[_A-Za-z0-9]))$$')).nil?
321
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
322
+
323
+
324
+ request_headers = {}
325
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
326
+
327
+ # Set Headers
328
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
329
+ request_headers['If-None-Match'] = if_none_match unless if_none_match.nil?
330
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
331
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/managedVirtualNetworks/{managedVirtualNetworkName}'
332
+
333
+ request_url = @base_url || @client.base_url
334
+
335
+ options = {
336
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
337
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'factoryName' => factory_name,'managedVirtualNetworkName' => managed_virtual_network_name},
338
+ query_params: {'api-version' => @client.api_version},
339
+ headers: request_headers.merge(custom_headers || {}),
340
+ base_url: request_url
341
+ }
342
+ promise = @client.make_request_async(:get, path_template, options)
343
+
344
+ promise = promise.then do |result|
345
+ http_response = result.response
346
+ status_code = http_response.status
347
+ response_content = http_response.body
348
+ unless status_code == 200
349
+ error_model = JSON.load(response_content)
350
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
351
+ end
352
+
353
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
354
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
355
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
356
+ # Deserialize Response
357
+ if status_code == 200
358
+ begin
359
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
360
+ result_mapper = Azure::DataFactory::Mgmt::V2018_06_01::Models::ManagedVirtualNetworkResource.mapper()
361
+ result.body = @client.deserialize(result_mapper, parsed_response)
362
+ rescue Exception => e
363
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
364
+ end
365
+ end
366
+
367
+ result
368
+ end
369
+
370
+ promise.execute
371
+ end
372
+
373
+ #
374
+ # Lists managed Virtual Networks.
375
+ #
376
+ # @param next_page_link [String] The NextLink from the previous successful call
377
+ # to List operation.
378
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
379
+ # will be added to the HTTP request.
380
+ #
381
+ # @return [ManagedVirtualNetworkListResponse] operation results.
382
+ #
383
+ def list_by_factory_next(next_page_link, custom_headers:nil)
384
+ response = list_by_factory_next_async(next_page_link, custom_headers:custom_headers).value!
385
+ response.body unless response.nil?
386
+ end
387
+
388
+ #
389
+ # Lists managed Virtual Networks.
390
+ #
391
+ # @param next_page_link [String] The NextLink from the previous successful call
392
+ # to List operation.
393
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
394
+ # will be added to the HTTP request.
395
+ #
396
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
397
+ #
398
+ def list_by_factory_next_with_http_info(next_page_link, custom_headers:nil)
399
+ list_by_factory_next_async(next_page_link, custom_headers:custom_headers).value!
400
+ end
401
+
402
+ #
403
+ # Lists managed Virtual Networks.
404
+ #
405
+ # @param next_page_link [String] The NextLink from the previous successful call
406
+ # to List operation.
407
+ # @param [Hash{String => String}] A hash of custom headers that will be added
408
+ # to the HTTP request.
409
+ #
410
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
411
+ #
412
+ def list_by_factory_next_async(next_page_link, custom_headers:nil)
413
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
414
+
415
+
416
+ request_headers = {}
417
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
418
+
419
+ # Set Headers
420
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
421
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
422
+ path_template = '{nextLink}'
423
+
424
+ request_url = @base_url || @client.base_url
425
+
426
+ options = {
427
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
428
+ skip_encoding_path_params: {'nextLink' => next_page_link},
429
+ headers: request_headers.merge(custom_headers || {}),
430
+ base_url: request_url
431
+ }
432
+ promise = @client.make_request_async(:get, path_template, options)
433
+
434
+ promise = promise.then do |result|
435
+ http_response = result.response
436
+ status_code = http_response.status
437
+ response_content = http_response.body
438
+ unless status_code == 200
439
+ error_model = JSON.load(response_content)
440
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
441
+ end
442
+
443
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
444
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
445
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
446
+ # Deserialize Response
447
+ if status_code == 200
448
+ begin
449
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
450
+ result_mapper = Azure::DataFactory::Mgmt::V2018_06_01::Models::ManagedVirtualNetworkListResponse.mapper()
451
+ result.body = @client.deserialize(result_mapper, parsed_response)
452
+ rescue Exception => e
453
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
454
+ end
455
+ end
456
+
457
+ result
458
+ end
459
+
460
+ promise.execute
461
+ end
462
+
463
+ #
464
+ # Lists managed Virtual Networks.
465
+ #
466
+ # @param resource_group_name [String] The resource group name.
467
+ # @param factory_name [String] The factory name.
468
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
469
+ # will be added to the HTTP request.
470
+ #
471
+ # @return [ManagedVirtualNetworkListResponse] which provide lazy access to
472
+ # pages of the response.
473
+ #
474
+ def list_by_factory_as_lazy(resource_group_name, factory_name, custom_headers:nil)
475
+ response = list_by_factory_async(resource_group_name, factory_name, custom_headers:custom_headers).value!
476
+ unless response.nil?
477
+ page = response.body
478
+ page.next_method = Proc.new do |next_page_link|
479
+ list_by_factory_next_async(next_page_link, custom_headers:custom_headers)
480
+ end
481
+ page
482
+ end
483
+ end
484
+
485
+ end
486
+ end