azure_mgmt_devtestlabs 0.15.2 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs.rb +70 -62
  3. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/arm_templates.rb +21 -18
  4. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/artifact_sources.rb +39 -37
  5. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/artifacts.rb +27 -25
  6. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/costs.rb +12 -12
  7. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/custom_images.rb +41 -38
  8. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/dev_test_labs_client.rb +12 -1
  9. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/disks.rb +61 -60
  10. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/environments.rb +41 -38
  11. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/formulas.rb +37 -34
  12. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/gallery_images.rb +15 -13
  13. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/global_schedules.rb +74 -70
  14. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/labs.rb +113 -109
  15. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/cost_threshold_properties.rb +1 -1
  16. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/http_status_code.rb +56 -0
  17. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/identity_properties.rb +1 -1
  18. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/operation_error.rb +57 -0
  19. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/operation_metadata.rb +59 -0
  20. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/operation_metadata_display.rb +80 -0
  21. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/operation_result.rb +82 -0
  22. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/models/provider_operation_result.rb +101 -0
  23. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/notification_channels.rb +45 -44
  24. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/operations.rb +117 -0
  25. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/policies.rb +39 -37
  26. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/policy_sets.rb +6 -7
  27. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/provider_operations.rb +215 -0
  28. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/schedules.rb +64 -59
  29. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/secrets.rb +33 -30
  30. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/service_runners.rb +33 -30
  31. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/users.rb +43 -41
  32. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/virtual_machine_schedules.rb +49 -46
  33. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/virtual_machines.rb +113 -110
  34. data/lib/2016-05-15/generated/azure_mgmt_devtestlabs/virtual_networks.rb +47 -45
  35. data/lib/profiles/latest/devtestlabs_latest_profile_client.rb +28 -9
  36. data/lib/profiles/latest/devtestlabs_module_definition.rb +0 -1
  37. data/lib/profiles/latest/modules/devtestlabs_profile_module.rb +589 -542
  38. data/lib/version.rb +1 -1
  39. metadata +10 -2
@@ -38,8 +38,8 @@ module Azure::DevTestLabs::Mgmt::V2016_05_15
38
38
  #
39
39
  # @return [Array<NotificationChannel>] operation results.
40
40
  #
41
- def list(resource_group_name, lab_name, expand = nil, filter = nil, top = nil, orderby = nil, custom_headers = nil)
42
- first_page = list_as_lazy(resource_group_name, lab_name, expand, filter, top, orderby, custom_headers)
41
+ def list(resource_group_name, lab_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil)
42
+ first_page = list_as_lazy(resource_group_name, lab_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers)
43
43
  first_page.get_all_items
44
44
  end
45
45
 
@@ -60,8 +60,8 @@ module Azure::DevTestLabs::Mgmt::V2016_05_15
60
60
  #
61
61
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
62
62
  #
63
- def list_with_http_info(resource_group_name, lab_name, expand = nil, filter = nil, top = nil, orderby = nil, custom_headers = nil)
64
- list_async(resource_group_name, lab_name, expand, filter, top, orderby, custom_headers).value!
63
+ def list_with_http_info(resource_group_name, lab_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil)
64
+ list_async(resource_group_name, lab_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers).value!
65
65
  end
66
66
 
67
67
  #
@@ -81,7 +81,7 @@ module Azure::DevTestLabs::Mgmt::V2016_05_15
81
81
  #
82
82
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
83
83
  #
84
- def list_async(resource_group_name, lab_name, expand = nil, filter = nil, top = nil, orderby = nil, custom_headers = nil)
84
+ def list_async(resource_group_name, lab_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil)
85
85
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
86
86
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
87
87
  fail ArgumentError, 'lab_name is nil' if lab_name.nil?
@@ -89,6 +89,7 @@ module Azure::DevTestLabs::Mgmt::V2016_05_15
89
89
 
90
90
 
91
91
  request_headers = {}
92
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
92
93
 
93
94
  # Set Headers
94
95
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
@@ -146,8 +147,8 @@ module Azure::DevTestLabs::Mgmt::V2016_05_15
146
147
  #
147
148
  # @return [NotificationChannel] operation results.
148
149
  #
149
- def get(resource_group_name, lab_name, name, expand = nil, custom_headers = nil)
150
- response = get_async(resource_group_name, lab_name, name, expand, custom_headers).value!
150
+ def get(resource_group_name, lab_name, name, expand:nil, custom_headers:nil)
151
+ response = get_async(resource_group_name, lab_name, name, expand:expand, custom_headers:custom_headers).value!
151
152
  response.body unless response.nil?
152
153
  end
153
154
 
@@ -164,8 +165,8 @@ module Azure::DevTestLabs::Mgmt::V2016_05_15
164
165
  #
165
166
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
166
167
  #
167
- def get_with_http_info(resource_group_name, lab_name, name, expand = nil, custom_headers = nil)
168
- get_async(resource_group_name, lab_name, name, expand, custom_headers).value!
168
+ def get_with_http_info(resource_group_name, lab_name, name, expand:nil, custom_headers:nil)
169
+ get_async(resource_group_name, lab_name, name, expand:expand, custom_headers:custom_headers).value!
169
170
  end
170
171
 
171
172
  #
@@ -181,7 +182,7 @@ module Azure::DevTestLabs::Mgmt::V2016_05_15
181
182
  #
182
183
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
183
184
  #
184
- def get_async(resource_group_name, lab_name, name, expand = nil, custom_headers = nil)
185
+ def get_async(resource_group_name, lab_name, name, expand:nil, custom_headers:nil)
185
186
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
186
187
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
187
188
  fail ArgumentError, 'lab_name is nil' if lab_name.nil?
@@ -190,6 +191,7 @@ module Azure::DevTestLabs::Mgmt::V2016_05_15
190
191
 
191
192
 
192
193
  request_headers = {}
194
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
193
195
 
194
196
  # Set Headers
195
197
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
@@ -246,8 +248,8 @@ module Azure::DevTestLabs::Mgmt::V2016_05_15
246
248
  #
247
249
  # @return [NotificationChannel] operation results.
248
250
  #
249
- def create_or_update(resource_group_name, lab_name, name, notification_channel, custom_headers = nil)
250
- response = create_or_update_async(resource_group_name, lab_name, name, notification_channel, custom_headers).value!
251
+ def create_or_update(resource_group_name, lab_name, name, notification_channel, custom_headers:nil)
252
+ response = create_or_update_async(resource_group_name, lab_name, name, notification_channel, custom_headers:custom_headers).value!
251
253
  response.body unless response.nil?
252
254
  end
253
255
 
@@ -263,8 +265,8 @@ module Azure::DevTestLabs::Mgmt::V2016_05_15
263
265
  #
264
266
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
265
267
  #
266
- def create_or_update_with_http_info(resource_group_name, lab_name, name, notification_channel, custom_headers = nil)
267
- create_or_update_async(resource_group_name, lab_name, name, notification_channel, custom_headers).value!
268
+ def create_or_update_with_http_info(resource_group_name, lab_name, name, notification_channel, custom_headers:nil)
269
+ create_or_update_async(resource_group_name, lab_name, name, notification_channel, custom_headers:custom_headers).value!
268
270
  end
269
271
 
270
272
  #
@@ -279,7 +281,7 @@ module Azure::DevTestLabs::Mgmt::V2016_05_15
279
281
  #
280
282
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
281
283
  #
282
- def create_or_update_async(resource_group_name, lab_name, name, notification_channel, custom_headers = nil)
284
+ def create_or_update_async(resource_group_name, lab_name, name, notification_channel, custom_headers:nil)
283
285
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
284
286
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
285
287
  fail ArgumentError, 'lab_name is nil' if lab_name.nil?
@@ -289,13 +291,12 @@ module Azure::DevTestLabs::Mgmt::V2016_05_15
289
291
 
290
292
 
291
293
  request_headers = {}
294
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
292
295
 
293
296
  # Set Headers
294
297
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
295
298
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
296
299
 
297
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
298
-
299
300
  # Serialize Request
300
301
  request_mapper = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::NotificationChannel.mapper()
301
302
  request_content = @client.serialize(request_mapper, notification_channel)
@@ -362,8 +363,8 @@ module Azure::DevTestLabs::Mgmt::V2016_05_15
362
363
  # will be added to the HTTP request.
363
364
  #
364
365
  #
365
- def delete(resource_group_name, lab_name, name, custom_headers = nil)
366
- response = delete_async(resource_group_name, lab_name, name, custom_headers).value!
366
+ def delete(resource_group_name, lab_name, name, custom_headers:nil)
367
+ response = delete_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value!
367
368
  nil
368
369
  end
369
370
 
@@ -378,8 +379,8 @@ module Azure::DevTestLabs::Mgmt::V2016_05_15
378
379
  #
379
380
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
380
381
  #
381
- def delete_with_http_info(resource_group_name, lab_name, name, custom_headers = nil)
382
- delete_async(resource_group_name, lab_name, name, custom_headers).value!
382
+ def delete_with_http_info(resource_group_name, lab_name, name, custom_headers:nil)
383
+ delete_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value!
383
384
  end
384
385
 
385
386
  #
@@ -393,7 +394,7 @@ module Azure::DevTestLabs::Mgmt::V2016_05_15
393
394
  #
394
395
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
395
396
  #
396
- def delete_async(resource_group_name, lab_name, name, custom_headers = nil)
397
+ def delete_async(resource_group_name, lab_name, name, custom_headers:nil)
397
398
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
398
399
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
399
400
  fail ArgumentError, 'lab_name is nil' if lab_name.nil?
@@ -402,6 +403,7 @@ module Azure::DevTestLabs::Mgmt::V2016_05_15
402
403
 
403
404
 
404
405
  request_headers = {}
406
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
405
407
 
406
408
  # Set Headers
407
409
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
@@ -448,8 +450,8 @@ module Azure::DevTestLabs::Mgmt::V2016_05_15
448
450
  #
449
451
  # @return [NotificationChannel] operation results.
450
452
  #
451
- def update(resource_group_name, lab_name, name, notification_channel, custom_headers = nil)
452
- response = update_async(resource_group_name, lab_name, name, notification_channel, custom_headers).value!
453
+ def update(resource_group_name, lab_name, name, notification_channel, custom_headers:nil)
454
+ response = update_async(resource_group_name, lab_name, name, notification_channel, custom_headers:custom_headers).value!
453
455
  response.body unless response.nil?
454
456
  end
455
457
 
@@ -465,8 +467,8 @@ module Azure::DevTestLabs::Mgmt::V2016_05_15
465
467
  #
466
468
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
467
469
  #
468
- def update_with_http_info(resource_group_name, lab_name, name, notification_channel, custom_headers = nil)
469
- update_async(resource_group_name, lab_name, name, notification_channel, custom_headers).value!
470
+ def update_with_http_info(resource_group_name, lab_name, name, notification_channel, custom_headers:nil)
471
+ update_async(resource_group_name, lab_name, name, notification_channel, custom_headers:custom_headers).value!
470
472
  end
471
473
 
472
474
  #
@@ -481,7 +483,7 @@ module Azure::DevTestLabs::Mgmt::V2016_05_15
481
483
  #
482
484
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
483
485
  #
484
- def update_async(resource_group_name, lab_name, name, notification_channel, custom_headers = nil)
486
+ def update_async(resource_group_name, lab_name, name, notification_channel, custom_headers:nil)
485
487
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
486
488
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
487
489
  fail ArgumentError, 'lab_name is nil' if lab_name.nil?
@@ -491,13 +493,12 @@ module Azure::DevTestLabs::Mgmt::V2016_05_15
491
493
 
492
494
 
493
495
  request_headers = {}
496
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
494
497
 
495
498
  # Set Headers
496
499
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
497
500
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
498
501
 
499
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
500
-
501
502
  # Serialize Request
502
503
  request_mapper = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::NotificationChannelFragment.mapper()
503
504
  request_content = @client.serialize(request_mapper, notification_channel)
@@ -556,8 +557,8 @@ module Azure::DevTestLabs::Mgmt::V2016_05_15
556
557
  # will be added to the HTTP request.
557
558
  #
558
559
  #
559
- def notify(resource_group_name, lab_name, name, notify_parameters, custom_headers = nil)
560
- response = notify_async(resource_group_name, lab_name, name, notify_parameters, custom_headers).value!
560
+ def notify(resource_group_name, lab_name, name, notify_parameters, custom_headers:nil)
561
+ response = notify_async(resource_group_name, lab_name, name, notify_parameters, custom_headers:custom_headers).value!
561
562
  nil
562
563
  end
563
564
 
@@ -574,8 +575,8 @@ module Azure::DevTestLabs::Mgmt::V2016_05_15
574
575
  #
575
576
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
576
577
  #
577
- def notify_with_http_info(resource_group_name, lab_name, name, notify_parameters, custom_headers = nil)
578
- notify_async(resource_group_name, lab_name, name, notify_parameters, custom_headers).value!
578
+ def notify_with_http_info(resource_group_name, lab_name, name, notify_parameters, custom_headers:nil)
579
+ notify_async(resource_group_name, lab_name, name, notify_parameters, custom_headers:custom_headers).value!
579
580
  end
580
581
 
581
582
  #
@@ -591,7 +592,7 @@ module Azure::DevTestLabs::Mgmt::V2016_05_15
591
592
  #
592
593
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
593
594
  #
594
- def notify_async(resource_group_name, lab_name, name, notify_parameters, custom_headers = nil)
595
+ def notify_async(resource_group_name, lab_name, name, notify_parameters, custom_headers:nil)
595
596
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
596
597
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
597
598
  fail ArgumentError, 'lab_name is nil' if lab_name.nil?
@@ -601,13 +602,12 @@ module Azure::DevTestLabs::Mgmt::V2016_05_15
601
602
 
602
603
 
603
604
  request_headers = {}
605
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
604
606
 
605
607
  # Set Headers
606
608
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
607
609
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
608
610
 
609
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
610
-
611
611
  # Serialize Request
612
612
  request_mapper = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::NotifyParameters.mapper()
613
613
  request_content = @client.serialize(request_mapper, notify_parameters)
@@ -654,8 +654,8 @@ module Azure::DevTestLabs::Mgmt::V2016_05_15
654
654
  #
655
655
  # @return [ResponseWithContinuationNotificationChannel] operation results.
656
656
  #
657
- def list_next(next_page_link, custom_headers = nil)
658
- response = list_next_async(next_page_link, custom_headers).value!
657
+ def list_next(next_page_link, custom_headers:nil)
658
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
659
659
  response.body unless response.nil?
660
660
  end
661
661
 
@@ -669,8 +669,8 @@ module Azure::DevTestLabs::Mgmt::V2016_05_15
669
669
  #
670
670
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
671
671
  #
672
- def list_next_with_http_info(next_page_link, custom_headers = nil)
673
- list_next_async(next_page_link, custom_headers).value!
672
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
673
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
674
674
  end
675
675
 
676
676
  #
@@ -683,11 +683,12 @@ module Azure::DevTestLabs::Mgmt::V2016_05_15
683
683
  #
684
684
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
685
685
  #
686
- def list_next_async(next_page_link, custom_headers = nil)
686
+ def list_next_async(next_page_link, custom_headers:nil)
687
687
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
688
688
 
689
689
 
690
690
  request_headers = {}
691
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
691
692
 
692
693
  # Set Headers
693
694
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
@@ -749,12 +750,12 @@ module Azure::DevTestLabs::Mgmt::V2016_05_15
749
750
  # @return [ResponseWithContinuationNotificationChannel] which provide lazy
750
751
  # access to pages of the response.
751
752
  #
752
- def list_as_lazy(resource_group_name, lab_name, expand = nil, filter = nil, top = nil, orderby = nil, custom_headers = nil)
753
- response = list_async(resource_group_name, lab_name, expand, filter, top, orderby, custom_headers).value!
753
+ def list_as_lazy(resource_group_name, lab_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil)
754
+ response = list_async(resource_group_name, lab_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers).value!
754
755
  unless response.nil?
755
756
  page = response.body
756
757
  page.next_method = Proc.new do |next_page_link|
757
- list_next_async(next_page_link, custom_headers)
758
+ list_next_async(next_page_link, custom_headers:custom_headers)
758
759
  end
759
760
  page
760
761
  end
@@ -0,0 +1,117 @@
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::DevTestLabs::Mgmt::V2016_05_15
7
+ #
8
+ # The DevTest Labs Client.
9
+ #
10
+ class Operations
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Operations class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [DevTestLabsClient] reference to the DevTestLabsClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Get operation.
26
+ #
27
+ # @param location_name [String] The name of the location.
28
+ # @param name [String] The name of the operation.
29
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
30
+ # will be added to the HTTP request.
31
+ #
32
+ # @return [OperationResult] operation results.
33
+ #
34
+ def get(location_name, name, custom_headers:nil)
35
+ response = get_async(location_name, name, custom_headers:custom_headers).value!
36
+ response.body unless response.nil?
37
+ end
38
+
39
+ #
40
+ # Get operation.
41
+ #
42
+ # @param location_name [String] The name of the location.
43
+ # @param name [String] The name of the operation.
44
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
45
+ # will be added to the HTTP request.
46
+ #
47
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
48
+ #
49
+ def get_with_http_info(location_name, name, custom_headers:nil)
50
+ get_async(location_name, name, custom_headers:custom_headers).value!
51
+ end
52
+
53
+ #
54
+ # Get operation.
55
+ #
56
+ # @param location_name [String] The name of the location.
57
+ # @param name [String] The name of the operation.
58
+ # @param [Hash{String => String}] A hash of custom headers that will be added
59
+ # to the HTTP request.
60
+ #
61
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
62
+ #
63
+ def get_async(location_name, name, custom_headers:nil)
64
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
65
+ fail ArgumentError, 'location_name is nil' if location_name.nil?
66
+ fail ArgumentError, 'name is nil' if name.nil?
67
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
68
+
69
+
70
+ request_headers = {}
71
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
72
+
73
+ # Set Headers
74
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
75
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
76
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.DevTestLab/locations/{locationName}/operations/{name}'
77
+
78
+ request_url = @base_url || @client.base_url
79
+
80
+ options = {
81
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
82
+ path_params: {'subscriptionId' => @client.subscription_id,'locationName' => location_name,'name' => name},
83
+ query_params: {'api-version' => @client.api_version},
84
+ headers: request_headers.merge(custom_headers || {}),
85
+ base_url: request_url
86
+ }
87
+ promise = @client.make_request_async(:get, path_template, options)
88
+
89
+ promise = promise.then do |result|
90
+ http_response = result.response
91
+ status_code = http_response.status
92
+ response_content = http_response.body
93
+ unless status_code == 200
94
+ error_model = JSON.load(response_content)
95
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
96
+ end
97
+
98
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
99
+ # Deserialize Response
100
+ if status_code == 200
101
+ begin
102
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
103
+ result_mapper = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::OperationResult.mapper()
104
+ result.body = @client.deserialize(result_mapper, parsed_response)
105
+ rescue Exception => e
106
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
107
+ end
108
+ end
109
+
110
+ result
111
+ end
112
+
113
+ promise.execute
114
+ end
115
+
116
+ end
117
+ end
@@ -39,8 +39,8 @@ module Azure::DevTestLabs::Mgmt::V2016_05_15
39
39
  #
40
40
  # @return [Array<Policy>] operation results.
41
41
  #
42
- def list(resource_group_name, lab_name, policy_set_name, expand = nil, filter = nil, top = nil, orderby = nil, custom_headers = nil)
43
- first_page = list_as_lazy(resource_group_name, lab_name, policy_set_name, expand, filter, top, orderby, custom_headers)
42
+ def list(resource_group_name, lab_name, policy_set_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil)
43
+ first_page = list_as_lazy(resource_group_name, lab_name, policy_set_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers)
44
44
  first_page.get_all_items
45
45
  end
46
46
 
@@ -62,8 +62,8 @@ module Azure::DevTestLabs::Mgmt::V2016_05_15
62
62
  #
63
63
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
64
64
  #
65
- def list_with_http_info(resource_group_name, lab_name, policy_set_name, expand = nil, filter = nil, top = nil, orderby = nil, custom_headers = nil)
66
- list_async(resource_group_name, lab_name, policy_set_name, expand, filter, top, orderby, custom_headers).value!
65
+ def list_with_http_info(resource_group_name, lab_name, policy_set_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil)
66
+ list_async(resource_group_name, lab_name, policy_set_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers).value!
67
67
  end
68
68
 
69
69
  #
@@ -84,7 +84,7 @@ module Azure::DevTestLabs::Mgmt::V2016_05_15
84
84
  #
85
85
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
86
86
  #
87
- def list_async(resource_group_name, lab_name, policy_set_name, expand = nil, filter = nil, top = nil, orderby = nil, custom_headers = nil)
87
+ def list_async(resource_group_name, lab_name, policy_set_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil)
88
88
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
89
89
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
90
90
  fail ArgumentError, 'lab_name is nil' if lab_name.nil?
@@ -93,6 +93,7 @@ module Azure::DevTestLabs::Mgmt::V2016_05_15
93
93
 
94
94
 
95
95
  request_headers = {}
96
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
96
97
 
97
98
  # Set Headers
98
99
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
@@ -151,8 +152,8 @@ module Azure::DevTestLabs::Mgmt::V2016_05_15
151
152
  #
152
153
  # @return [Policy] operation results.
153
154
  #
154
- def get(resource_group_name, lab_name, policy_set_name, name, expand = nil, custom_headers = nil)
155
- response = get_async(resource_group_name, lab_name, policy_set_name, name, expand, custom_headers).value!
155
+ def get(resource_group_name, lab_name, policy_set_name, name, expand:nil, custom_headers:nil)
156
+ response = get_async(resource_group_name, lab_name, policy_set_name, name, expand:expand, custom_headers:custom_headers).value!
156
157
  response.body unless response.nil?
157
158
  end
158
159
 
@@ -170,8 +171,8 @@ module Azure::DevTestLabs::Mgmt::V2016_05_15
170
171
  #
171
172
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
172
173
  #
173
- def get_with_http_info(resource_group_name, lab_name, policy_set_name, name, expand = nil, custom_headers = nil)
174
- get_async(resource_group_name, lab_name, policy_set_name, name, expand, custom_headers).value!
174
+ def get_with_http_info(resource_group_name, lab_name, policy_set_name, name, expand:nil, custom_headers:nil)
175
+ get_async(resource_group_name, lab_name, policy_set_name, name, expand:expand, custom_headers:custom_headers).value!
175
176
  end
176
177
 
177
178
  #
@@ -188,7 +189,7 @@ module Azure::DevTestLabs::Mgmt::V2016_05_15
188
189
  #
189
190
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
190
191
  #
191
- def get_async(resource_group_name, lab_name, policy_set_name, name, expand = nil, custom_headers = nil)
192
+ def get_async(resource_group_name, lab_name, policy_set_name, name, expand:nil, custom_headers:nil)
192
193
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
193
194
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
194
195
  fail ArgumentError, 'lab_name is nil' if lab_name.nil?
@@ -198,6 +199,7 @@ module Azure::DevTestLabs::Mgmt::V2016_05_15
198
199
 
199
200
 
200
201
  request_headers = {}
202
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
201
203
 
202
204
  # Set Headers
203
205
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
@@ -255,8 +257,8 @@ module Azure::DevTestLabs::Mgmt::V2016_05_15
255
257
  #
256
258
  # @return [Policy] operation results.
257
259
  #
258
- def create_or_update(resource_group_name, lab_name, policy_set_name, name, policy, custom_headers = nil)
259
- response = create_or_update_async(resource_group_name, lab_name, policy_set_name, name, policy, custom_headers).value!
260
+ def create_or_update(resource_group_name, lab_name, policy_set_name, name, policy, custom_headers:nil)
261
+ response = create_or_update_async(resource_group_name, lab_name, policy_set_name, name, policy, custom_headers:custom_headers).value!
260
262
  response.body unless response.nil?
261
263
  end
262
264
 
@@ -273,8 +275,8 @@ module Azure::DevTestLabs::Mgmt::V2016_05_15
273
275
  #
274
276
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
275
277
  #
276
- def create_or_update_with_http_info(resource_group_name, lab_name, policy_set_name, name, policy, custom_headers = nil)
277
- create_or_update_async(resource_group_name, lab_name, policy_set_name, name, policy, custom_headers).value!
278
+ def create_or_update_with_http_info(resource_group_name, lab_name, policy_set_name, name, policy, custom_headers:nil)
279
+ create_or_update_async(resource_group_name, lab_name, policy_set_name, name, policy, custom_headers:custom_headers).value!
278
280
  end
279
281
 
280
282
  #
@@ -290,7 +292,7 @@ module Azure::DevTestLabs::Mgmt::V2016_05_15
290
292
  #
291
293
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
292
294
  #
293
- def create_or_update_async(resource_group_name, lab_name, policy_set_name, name, policy, custom_headers = nil)
295
+ def create_or_update_async(resource_group_name, lab_name, policy_set_name, name, policy, custom_headers:nil)
294
296
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
295
297
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
296
298
  fail ArgumentError, 'lab_name is nil' if lab_name.nil?
@@ -301,13 +303,12 @@ module Azure::DevTestLabs::Mgmt::V2016_05_15
301
303
 
302
304
 
303
305
  request_headers = {}
306
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
304
307
 
305
308
  # Set Headers
306
309
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
307
310
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
308
311
 
309
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
310
-
311
312
  # Serialize Request
312
313
  request_mapper = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::Policy.mapper()
313
314
  request_content = @client.serialize(request_mapper, policy)
@@ -375,8 +376,8 @@ module Azure::DevTestLabs::Mgmt::V2016_05_15
375
376
  # will be added to the HTTP request.
376
377
  #
377
378
  #
378
- def delete(resource_group_name, lab_name, policy_set_name, name, custom_headers = nil)
379
- response = delete_async(resource_group_name, lab_name, policy_set_name, name, custom_headers).value!
379
+ def delete(resource_group_name, lab_name, policy_set_name, name, custom_headers:nil)
380
+ response = delete_async(resource_group_name, lab_name, policy_set_name, name, custom_headers:custom_headers).value!
380
381
  nil
381
382
  end
382
383
 
@@ -392,8 +393,8 @@ module Azure::DevTestLabs::Mgmt::V2016_05_15
392
393
  #
393
394
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
394
395
  #
395
- def delete_with_http_info(resource_group_name, lab_name, policy_set_name, name, custom_headers = nil)
396
- delete_async(resource_group_name, lab_name, policy_set_name, name, custom_headers).value!
396
+ def delete_with_http_info(resource_group_name, lab_name, policy_set_name, name, custom_headers:nil)
397
+ delete_async(resource_group_name, lab_name, policy_set_name, name, custom_headers:custom_headers).value!
397
398
  end
398
399
 
399
400
  #
@@ -408,7 +409,7 @@ module Azure::DevTestLabs::Mgmt::V2016_05_15
408
409
  #
409
410
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
410
411
  #
411
- def delete_async(resource_group_name, lab_name, policy_set_name, name, custom_headers = nil)
412
+ def delete_async(resource_group_name, lab_name, policy_set_name, name, custom_headers:nil)
412
413
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
413
414
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
414
415
  fail ArgumentError, 'lab_name is nil' if lab_name.nil?
@@ -418,6 +419,7 @@ module Azure::DevTestLabs::Mgmt::V2016_05_15
418
419
 
419
420
 
420
421
  request_headers = {}
422
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
421
423
 
422
424
  # Set Headers
423
425
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
@@ -465,8 +467,8 @@ module Azure::DevTestLabs::Mgmt::V2016_05_15
465
467
  #
466
468
  # @return [Policy] operation results.
467
469
  #
468
- def update(resource_group_name, lab_name, policy_set_name, name, policy, custom_headers = nil)
469
- response = update_async(resource_group_name, lab_name, policy_set_name, name, policy, custom_headers).value!
470
+ def update(resource_group_name, lab_name, policy_set_name, name, policy, custom_headers:nil)
471
+ response = update_async(resource_group_name, lab_name, policy_set_name, name, policy, custom_headers:custom_headers).value!
470
472
  response.body unless response.nil?
471
473
  end
472
474
 
@@ -483,8 +485,8 @@ module Azure::DevTestLabs::Mgmt::V2016_05_15
483
485
  #
484
486
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
485
487
  #
486
- def update_with_http_info(resource_group_name, lab_name, policy_set_name, name, policy, custom_headers = nil)
487
- update_async(resource_group_name, lab_name, policy_set_name, name, policy, custom_headers).value!
488
+ def update_with_http_info(resource_group_name, lab_name, policy_set_name, name, policy, custom_headers:nil)
489
+ update_async(resource_group_name, lab_name, policy_set_name, name, policy, custom_headers:custom_headers).value!
488
490
  end
489
491
 
490
492
  #
@@ -500,7 +502,7 @@ module Azure::DevTestLabs::Mgmt::V2016_05_15
500
502
  #
501
503
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
502
504
  #
503
- def update_async(resource_group_name, lab_name, policy_set_name, name, policy, custom_headers = nil)
505
+ def update_async(resource_group_name, lab_name, policy_set_name, name, policy, custom_headers:nil)
504
506
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
505
507
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
506
508
  fail ArgumentError, 'lab_name is nil' if lab_name.nil?
@@ -511,13 +513,12 @@ module Azure::DevTestLabs::Mgmt::V2016_05_15
511
513
 
512
514
 
513
515
  request_headers = {}
516
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
514
517
 
515
518
  # Set Headers
516
519
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
517
520
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
518
521
 
519
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
520
-
521
522
  # Serialize Request
522
523
  request_mapper = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::PolicyFragment.mapper()
523
524
  request_content = @client.serialize(request_mapper, policy)
@@ -574,8 +575,8 @@ module Azure::DevTestLabs::Mgmt::V2016_05_15
574
575
  #
575
576
  # @return [ResponseWithContinuationPolicy] operation results.
576
577
  #
577
- def list_next(next_page_link, custom_headers = nil)
578
- response = list_next_async(next_page_link, custom_headers).value!
578
+ def list_next(next_page_link, custom_headers:nil)
579
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
579
580
  response.body unless response.nil?
580
581
  end
581
582
 
@@ -589,8 +590,8 @@ module Azure::DevTestLabs::Mgmt::V2016_05_15
589
590
  #
590
591
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
591
592
  #
592
- def list_next_with_http_info(next_page_link, custom_headers = nil)
593
- list_next_async(next_page_link, custom_headers).value!
593
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
594
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
594
595
  end
595
596
 
596
597
  #
@@ -603,11 +604,12 @@ module Azure::DevTestLabs::Mgmt::V2016_05_15
603
604
  #
604
605
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
605
606
  #
606
- def list_next_async(next_page_link, custom_headers = nil)
607
+ def list_next_async(next_page_link, custom_headers:nil)
607
608
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
608
609
 
609
610
 
610
611
  request_headers = {}
612
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
611
613
 
612
614
  # Set Headers
613
615
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
@@ -670,12 +672,12 @@ module Azure::DevTestLabs::Mgmt::V2016_05_15
670
672
  # @return [ResponseWithContinuationPolicy] which provide lazy access to pages
671
673
  # of the response.
672
674
  #
673
- def list_as_lazy(resource_group_name, lab_name, policy_set_name, expand = nil, filter = nil, top = nil, orderby = nil, custom_headers = nil)
674
- response = list_async(resource_group_name, lab_name, policy_set_name, expand, filter, top, orderby, custom_headers).value!
675
+ def list_as_lazy(resource_group_name, lab_name, policy_set_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil)
676
+ response = list_async(resource_group_name, lab_name, policy_set_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers).value!
675
677
  unless response.nil?
676
678
  page = response.body
677
679
  page.next_method = Proc.new do |next_page_link|
678
- list_next_async(next_page_link, custom_headers)
680
+ list_next_async(next_page_link, custom_headers:custom_headers)
679
681
  end
680
682
  page
681
683
  end