azure_mgmt_labservices 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (94) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/lib/2018-10-15/generated/azure_mgmt_labservices.rb +109 -0
  4. data/lib/2018-10-15/generated/azure_mgmt_labservices/environment_settings.rb +1254 -0
  5. data/lib/2018-10-15/generated/azure_mgmt_labservices/environments.rb +1286 -0
  6. data/lib/2018-10-15/generated/azure_mgmt_labservices/gallery_images.rb +672 -0
  7. data/lib/2018-10-15/generated/azure_mgmt_labservices/global_users.rb +1131 -0
  8. data/lib/2018-10-15/generated/azure_mgmt_labservices/lab_accounts.rb +1093 -0
  9. data/lib/2018-10-15/generated/azure_mgmt_labservices/labs.rb +890 -0
  10. data/lib/2018-10-15/generated/azure_mgmt_labservices/managed_labs_client.rb +163 -0
  11. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/add_remove.rb +16 -0
  12. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/add_users_payload.rb +55 -0
  13. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/configuration_state.rb +16 -0
  14. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/create_lab_properties.rb +101 -0
  15. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/environment.rb +235 -0
  16. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/environment_details.rb +149 -0
  17. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/environment_fragment.rb +121 -0
  18. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/environment_operations_payload.rb +47 -0
  19. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/environment_setting.rb +210 -0
  20. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/environment_setting_creation_parameters.rb +48 -0
  21. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/environment_setting_fragment.rb +157 -0
  22. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/environment_size.rb +110 -0
  23. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/environment_size_fragment.rb +69 -0
  24. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/gallery_image.rb +231 -0
  25. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/gallery_image_fragment.rb +143 -0
  26. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/gallery_image_reference.rb +90 -0
  27. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/gallery_image_reference_fragment.rb +90 -0
  28. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/get_environment_response.rb +48 -0
  29. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/get_personal_preferences_response.rb +65 -0
  30. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/get_regional_availability_response.rb +56 -0
  31. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/lab.rb +219 -0
  32. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/lab_account.rb +147 -0
  33. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/lab_account_fragment.rb +119 -0
  34. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/lab_creation_parameters.rb +46 -0
  35. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/lab_details.rb +82 -0
  36. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/lab_fragment.rb +144 -0
  37. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/lab_user_access_mode.rb +16 -0
  38. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/latest_operation_result.rb +107 -0
  39. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/list_environments_payload.rb +46 -0
  40. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/list_environments_response.rb +55 -0
  41. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/list_labs_response.rb +55 -0
  42. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/managed_lab_vm_size.rb +17 -0
  43. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/network_interface.rb +83 -0
  44. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/operation_batch_status_payload.rb +54 -0
  45. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/operation_batch_status_response.rb +57 -0
  46. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/operation_batch_status_response_item.rb +61 -0
  47. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/operation_error.rb +57 -0
  48. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/operation_metadata.rb +59 -0
  49. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/operation_metadata_display.rb +80 -0
  50. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/operation_result.rb +59 -0
  51. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/operation_status_payload.rb +46 -0
  52. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/operation_status_response.rb +48 -0
  53. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/personal_preferences_operations_payload.rb +71 -0
  54. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/provider_operation_result.rb +101 -0
  55. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/publish_payload.rb +47 -0
  56. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/publishing_state.rb +19 -0
  57. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/reference_vm.rb +84 -0
  58. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/reference_vm_creation_parameters.rb +57 -0
  59. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/reference_vm_fragment.rb +58 -0
  60. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/regional_availability.rb +67 -0
  61. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/register_payload.rb +46 -0
  62. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/reset_password_payload.rb +68 -0
  63. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/resource.rb +110 -0
  64. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/resource_set.rb +57 -0
  65. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/resource_set_fragment.rb +57 -0
  66. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/resource_setting_creation_parameters.rb +94 -0
  67. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/resource_settings.rb +108 -0
  68. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/resource_settings_fragment.rb +71 -0
  69. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/response_with_continuation_environment.rb +98 -0
  70. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/response_with_continuation_environment_setting.rb +100 -0
  71. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/response_with_continuation_gallery_image.rb +98 -0
  72. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/response_with_continuation_lab.rb +98 -0
  73. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/response_with_continuation_lab_account.rb +98 -0
  74. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/response_with_continuation_user.rb +98 -0
  75. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/size_availability.rb +59 -0
  76. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/size_configuration_properties.rb +56 -0
  77. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/size_configuration_properties_fragment.rb +56 -0
  78. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/size_info.rb +82 -0
  79. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/size_info_fragment.rb +82 -0
  80. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/user.rb +186 -0
  81. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/user_fragment.rb +108 -0
  82. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/virtual_machine_details.rb +107 -0
  83. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/vm_state_details.rb +86 -0
  84. data/lib/2018-10-15/generated/azure_mgmt_labservices/module_definition.rb +9 -0
  85. data/lib/2018-10-15/generated/azure_mgmt_labservices/operations.rb +117 -0
  86. data/lib/2018-10-15/generated/azure_mgmt_labservices/provider_operations.rb +215 -0
  87. data/lib/2018-10-15/generated/azure_mgmt_labservices/users.rb +729 -0
  88. data/lib/azure_mgmt_labservices.rb +6 -0
  89. data/lib/module_definition.rb +7 -0
  90. data/lib/profiles/latest/labservices_latest_profile_client.rb +40 -0
  91. data/lib/profiles/latest/labservices_module_definition.rb +8 -0
  92. data/lib/profiles/latest/modules/labservices_profile_module.rb +369 -0
  93. data/lib/version.rb +7 -0
  94. metadata +210 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 3dece6c62658e827f2fb3b03068e923a7e0a8f82
4
+ data.tar.gz: 4bdf42fe58d99dfbbdc75fd54dcd38218c365548
5
+ SHA512:
6
+ metadata.gz: a165c91023ff153c409c9ab31a9e2fce4fbd931ec8c96848d3c4d7f9dee10bd5f9a155b1077e429a64689c35568ce7c3cd7ef789a1680f329818f2925b43520a
7
+ data.tar.gz: d4ea1038d10474cb7d1008cf680a861f71c2d8a5e8de8bdc1575f4fc768622b349a565b93d658200b63de3be117b254ec6eda3fd285d5e84ffb9456dbcc5bc6c
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Microsoft Corporation
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,109 @@
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 '2018-10-15/generated/azure_mgmt_labservices/module_definition'
20
+ require 'ms_rest_azure'
21
+
22
+ module Azure::Labservices::Mgmt::V2018_10_15
23
+ autoload :ProviderOperations, '2018-10-15/generated/azure_mgmt_labservices/provider_operations.rb'
24
+ autoload :GlobalUsers, '2018-10-15/generated/azure_mgmt_labservices/global_users.rb'
25
+ autoload :LabAccounts, '2018-10-15/generated/azure_mgmt_labservices/lab_accounts.rb'
26
+ autoload :Operations, '2018-10-15/generated/azure_mgmt_labservices/operations.rb'
27
+ autoload :GalleryImages, '2018-10-15/generated/azure_mgmt_labservices/gallery_images.rb'
28
+ autoload :Labs, '2018-10-15/generated/azure_mgmt_labservices/labs.rb'
29
+ autoload :EnvironmentSettings, '2018-10-15/generated/azure_mgmt_labservices/environment_settings.rb'
30
+ autoload :Environments, '2018-10-15/generated/azure_mgmt_labservices/environments.rb'
31
+ autoload :Users, '2018-10-15/generated/azure_mgmt_labservices/users.rb'
32
+ autoload :ManagedLabsClient, '2018-10-15/generated/azure_mgmt_labservices/managed_labs_client.rb'
33
+
34
+ module Models
35
+ autoload :SizeAvailability, '2018-10-15/generated/azure_mgmt_labservices/models/size_availability.rb'
36
+ autoload :RegionalAvailability, '2018-10-15/generated/azure_mgmt_labservices/models/regional_availability.rb'
37
+ autoload :GetRegionalAvailabilityResponse, '2018-10-15/generated/azure_mgmt_labservices/models/get_regional_availability_response.rb'
38
+ autoload :ReferenceVmCreationParameters, '2018-10-15/generated/azure_mgmt_labservices/models/reference_vm_creation_parameters.rb'
39
+ autoload :AddUsersPayload, '2018-10-15/generated/azure_mgmt_labservices/models/add_users_payload.rb'
40
+ autoload :EnvironmentSettingCreationParameters, '2018-10-15/generated/azure_mgmt_labservices/models/environment_setting_creation_parameters.rb'
41
+ autoload :CreateLabProperties, '2018-10-15/generated/azure_mgmt_labservices/models/create_lab_properties.rb'
42
+ autoload :ResourceSettingCreationParameters, '2018-10-15/generated/azure_mgmt_labservices/models/resource_setting_creation_parameters.rb'
43
+ autoload :NetworkInterface, '2018-10-15/generated/azure_mgmt_labservices/models/network_interface.rb'
44
+ autoload :SizeConfigurationPropertiesFragment, '2018-10-15/generated/azure_mgmt_labservices/models/size_configuration_properties_fragment.rb'
45
+ autoload :LabCreationParameters, '2018-10-15/generated/azure_mgmt_labservices/models/lab_creation_parameters.rb'
46
+ autoload :ResourceSet, '2018-10-15/generated/azure_mgmt_labservices/models/resource_set.rb'
47
+ autoload :EnvironmentDetails, '2018-10-15/generated/azure_mgmt_labservices/models/environment_details.rb'
48
+ autoload :LatestOperationResult, '2018-10-15/generated/azure_mgmt_labservices/models/latest_operation_result.rb'
49
+ autoload :ResponseWithContinuationGalleryImage, '2018-10-15/generated/azure_mgmt_labservices/models/response_with_continuation_gallery_image.rb'
50
+ autoload :RegisterPayload, '2018-10-15/generated/azure_mgmt_labservices/models/register_payload.rb'
51
+ autoload :VmStateDetails, '2018-10-15/generated/azure_mgmt_labservices/models/vm_state_details.rb'
52
+ autoload :SizeConfigurationProperties, '2018-10-15/generated/azure_mgmt_labservices/models/size_configuration_properties.rb'
53
+ autoload :ResourceSettings, '2018-10-15/generated/azure_mgmt_labservices/models/resource_settings.rb'
54
+ autoload :ResponseWithContinuationUser, '2018-10-15/generated/azure_mgmt_labservices/models/response_with_continuation_user.rb'
55
+ autoload :ReferenceVmFragment, '2018-10-15/generated/azure_mgmt_labservices/models/reference_vm_fragment.rb'
56
+ autoload :ResponseWithContinuationLabAccount, '2018-10-15/generated/azure_mgmt_labservices/models/response_with_continuation_lab_account.rb'
57
+ autoload :ResponseWithContinuationEnvironment, '2018-10-15/generated/azure_mgmt_labservices/models/response_with_continuation_environment.rb'
58
+ autoload :LabDetails, '2018-10-15/generated/azure_mgmt_labservices/models/lab_details.rb'
59
+ autoload :EnvironmentSize, '2018-10-15/generated/azure_mgmt_labservices/models/environment_size.rb'
60
+ autoload :ResponseWithContinuationLab, '2018-10-15/generated/azure_mgmt_labservices/models/response_with_continuation_lab.rb'
61
+ autoload :EnvironmentSizeFragment, '2018-10-15/generated/azure_mgmt_labservices/models/environment_size_fragment.rb'
62
+ autoload :ListEnvironmentsPayload, '2018-10-15/generated/azure_mgmt_labservices/models/list_environments_payload.rb'
63
+ autoload :Resource, '2018-10-15/generated/azure_mgmt_labservices/models/resource.rb'
64
+ autoload :ListEnvironmentsResponse, '2018-10-15/generated/azure_mgmt_labservices/models/list_environments_response.rb'
65
+ autoload :GalleryImageReferenceFragment, '2018-10-15/generated/azure_mgmt_labservices/models/gallery_image_reference_fragment.rb'
66
+ autoload :ListLabsResponse, '2018-10-15/generated/azure_mgmt_labservices/models/list_labs_response.rb'
67
+ autoload :GetPersonalPreferencesResponse, '2018-10-15/generated/azure_mgmt_labservices/models/get_personal_preferences_response.rb'
68
+ autoload :OperationBatchStatusPayload, '2018-10-15/generated/azure_mgmt_labservices/models/operation_batch_status_payload.rb'
69
+ autoload :ResourceSetFragment, '2018-10-15/generated/azure_mgmt_labservices/models/resource_set_fragment.rb'
70
+ autoload :OperationBatchStatusResponseItem, '2018-10-15/generated/azure_mgmt_labservices/models/operation_batch_status_response_item.rb'
71
+ autoload :ReferenceVm, '2018-10-15/generated/azure_mgmt_labservices/models/reference_vm.rb'
72
+ autoload :OperationBatchStatusResponse, '2018-10-15/generated/azure_mgmt_labservices/models/operation_batch_status_response.rb'
73
+ autoload :ResourceSettingsFragment, '2018-10-15/generated/azure_mgmt_labservices/models/resource_settings_fragment.rb'
74
+ autoload :OperationError, '2018-10-15/generated/azure_mgmt_labservices/models/operation_error.rb'
75
+ autoload :SizeInfoFragment, '2018-10-15/generated/azure_mgmt_labservices/models/size_info_fragment.rb'
76
+ autoload :OperationMetadataDisplay, '2018-10-15/generated/azure_mgmt_labservices/models/operation_metadata_display.rb'
77
+ autoload :ResetPasswordPayload, '2018-10-15/generated/azure_mgmt_labservices/models/reset_password_payload.rb'
78
+ autoload :OperationMetadata, '2018-10-15/generated/azure_mgmt_labservices/models/operation_metadata.rb'
79
+ autoload :VirtualMachineDetails, '2018-10-15/generated/azure_mgmt_labservices/models/virtual_machine_details.rb'
80
+ autoload :OperationResult, '2018-10-15/generated/azure_mgmt_labservices/models/operation_result.rb'
81
+ autoload :ResponseWithContinuationEnvironmentSetting, '2018-10-15/generated/azure_mgmt_labservices/models/response_with_continuation_environment_setting.rb'
82
+ autoload :OperationStatusPayload, '2018-10-15/generated/azure_mgmt_labservices/models/operation_status_payload.rb'
83
+ autoload :GalleryImageReference, '2018-10-15/generated/azure_mgmt_labservices/models/gallery_image_reference.rb'
84
+ autoload :OperationStatusResponse, '2018-10-15/generated/azure_mgmt_labservices/models/operation_status_response.rb'
85
+ autoload :EnvironmentOperationsPayload, '2018-10-15/generated/azure_mgmt_labservices/models/environment_operations_payload.rb'
86
+ autoload :PersonalPreferencesOperationsPayload, '2018-10-15/generated/azure_mgmt_labservices/models/personal_preferences_operations_payload.rb'
87
+ autoload :GetEnvironmentResponse, '2018-10-15/generated/azure_mgmt_labservices/models/get_environment_response.rb'
88
+ autoload :ProviderOperationResult, '2018-10-15/generated/azure_mgmt_labservices/models/provider_operation_result.rb'
89
+ autoload :SizeInfo, '2018-10-15/generated/azure_mgmt_labservices/models/size_info.rb'
90
+ autoload :PublishPayload, '2018-10-15/generated/azure_mgmt_labservices/models/publish_payload.rb'
91
+ autoload :Environment, '2018-10-15/generated/azure_mgmt_labservices/models/environment.rb'
92
+ autoload :EnvironmentFragment, '2018-10-15/generated/azure_mgmt_labservices/models/environment_fragment.rb'
93
+ autoload :EnvironmentSetting, '2018-10-15/generated/azure_mgmt_labservices/models/environment_setting.rb'
94
+ autoload :EnvironmentSettingFragment, '2018-10-15/generated/azure_mgmt_labservices/models/environment_setting_fragment.rb'
95
+ autoload :GalleryImage, '2018-10-15/generated/azure_mgmt_labservices/models/gallery_image.rb'
96
+ autoload :GalleryImageFragment, '2018-10-15/generated/azure_mgmt_labservices/models/gallery_image_fragment.rb'
97
+ autoload :Lab, '2018-10-15/generated/azure_mgmt_labservices/models/lab.rb'
98
+ autoload :LabAccount, '2018-10-15/generated/azure_mgmt_labservices/models/lab_account.rb'
99
+ autoload :LabAccountFragment, '2018-10-15/generated/azure_mgmt_labservices/models/lab_account_fragment.rb'
100
+ autoload :LabFragment, '2018-10-15/generated/azure_mgmt_labservices/models/lab_fragment.rb'
101
+ autoload :User, '2018-10-15/generated/azure_mgmt_labservices/models/user.rb'
102
+ autoload :UserFragment, '2018-10-15/generated/azure_mgmt_labservices/models/user_fragment.rb'
103
+ autoload :ManagedLabVmSize, '2018-10-15/generated/azure_mgmt_labservices/models/managed_lab_vm_size.rb'
104
+ autoload :PublishingState, '2018-10-15/generated/azure_mgmt_labservices/models/publishing_state.rb'
105
+ autoload :ConfigurationState, '2018-10-15/generated/azure_mgmt_labservices/models/configuration_state.rb'
106
+ autoload :LabUserAccessMode, '2018-10-15/generated/azure_mgmt_labservices/models/lab_user_access_mode.rb'
107
+ autoload :AddRemove, '2018-10-15/generated/azure_mgmt_labservices/models/add_remove.rb'
108
+ end
109
+ end
@@ -0,0 +1,1254 @@
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::Labservices::Mgmt::V2018_10_15
7
+ #
8
+ # The Managed Labs Client.
9
+ #
10
+ class EnvironmentSettings
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the EnvironmentSettings class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [ManagedLabsClient] reference to the ManagedLabsClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # List environment setting in a given lab.
26
+ #
27
+ # @param resource_group_name [String] The name of the resource group.
28
+ # @param lab_account_name [String] The name of the lab Account.
29
+ # @param lab_name [String] The name of the lab.
30
+ # @param expand [String] Specify the $expand query. Example:
31
+ # 'properties($select=publishingState)'
32
+ # @param filter [String] The filter to apply to the operation.
33
+ # @param top [Integer] The maximum number of resources to return from the
34
+ # operation.
35
+ # @param orderby [String] The ordering expression for the results, using OData
36
+ # notation.
37
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
38
+ # will be added to the HTTP request.
39
+ #
40
+ # @return [Array<EnvironmentSetting>] operation results.
41
+ #
42
+ def list(resource_group_name, lab_account_name, lab_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil)
43
+ first_page = list_as_lazy(resource_group_name, lab_account_name, lab_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers)
44
+ first_page.get_all_items
45
+ end
46
+
47
+ #
48
+ # List environment setting in a given lab.
49
+ #
50
+ # @param resource_group_name [String] The name of the resource group.
51
+ # @param lab_account_name [String] The name of the lab Account.
52
+ # @param lab_name [String] The name of the lab.
53
+ # @param expand [String] Specify the $expand query. Example:
54
+ # 'properties($select=publishingState)'
55
+ # @param filter [String] The filter to apply to the operation.
56
+ # @param top [Integer] The maximum number of resources to return from the
57
+ # operation.
58
+ # @param orderby [String] The ordering expression for the results, using OData
59
+ # notation.
60
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
61
+ # will be added to the HTTP request.
62
+ #
63
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
64
+ #
65
+ def list_with_http_info(resource_group_name, lab_account_name, lab_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil)
66
+ list_async(resource_group_name, lab_account_name, lab_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers).value!
67
+ end
68
+
69
+ #
70
+ # List environment setting in a given lab.
71
+ #
72
+ # @param resource_group_name [String] The name of the resource group.
73
+ # @param lab_account_name [String] The name of the lab Account.
74
+ # @param lab_name [String] The name of the lab.
75
+ # @param expand [String] Specify the $expand query. Example:
76
+ # 'properties($select=publishingState)'
77
+ # @param filter [String] The filter to apply to the operation.
78
+ # @param top [Integer] The maximum number of resources to return from the
79
+ # operation.
80
+ # @param orderby [String] The ordering expression for the results, using OData
81
+ # notation.
82
+ # @param [Hash{String => String}] A hash of custom headers that will be added
83
+ # to the HTTP request.
84
+ #
85
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
86
+ #
87
+ def list_async(resource_group_name, lab_account_name, lab_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil)
88
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
89
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
90
+ fail ArgumentError, 'lab_account_name is nil' if lab_account_name.nil?
91
+ fail ArgumentError, 'lab_name is nil' if lab_name.nil?
92
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
93
+
94
+
95
+ request_headers = {}
96
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
97
+
98
+ # Set Headers
99
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
100
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
101
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings'
102
+
103
+ request_url = @base_url || @client.base_url
104
+
105
+ options = {
106
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
107
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labAccountName' => lab_account_name,'labName' => lab_name},
108
+ query_params: {'$expand' => expand,'$filter' => filter,'$top' => top,'$orderby' => orderby,'api-version' => @client.api_version},
109
+ headers: request_headers.merge(custom_headers || {}),
110
+ base_url: request_url
111
+ }
112
+ promise = @client.make_request_async(:get, path_template, options)
113
+
114
+ promise = promise.then do |result|
115
+ http_response = result.response
116
+ status_code = http_response.status
117
+ response_content = http_response.body
118
+ unless status_code == 200
119
+ error_model = JSON.load(response_content)
120
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
121
+ end
122
+
123
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
124
+ # Deserialize Response
125
+ if status_code == 200
126
+ begin
127
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
128
+ result_mapper = Azure::Labservices::Mgmt::V2018_10_15::Models::ResponseWithContinuationEnvironmentSetting.mapper()
129
+ result.body = @client.deserialize(result_mapper, parsed_response)
130
+ rescue Exception => e
131
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
132
+ end
133
+ end
134
+
135
+ result
136
+ end
137
+
138
+ promise.execute
139
+ end
140
+
141
+ #
142
+ # Get environment setting
143
+ #
144
+ # @param resource_group_name [String] The name of the resource group.
145
+ # @param lab_account_name [String] The name of the lab Account.
146
+ # @param lab_name [String] The name of the lab.
147
+ # @param environment_setting_name [String] The name of the environment Setting.
148
+ # @param expand [String] Specify the $expand query. Example:
149
+ # 'properties($select=publishingState)'
150
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
151
+ # will be added to the HTTP request.
152
+ #
153
+ # @return [EnvironmentSetting] operation results.
154
+ #
155
+ def get(resource_group_name, lab_account_name, lab_name, environment_setting_name, expand:nil, custom_headers:nil)
156
+ response = get_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, expand:expand, custom_headers:custom_headers).value!
157
+ response.body unless response.nil?
158
+ end
159
+
160
+ #
161
+ # Get environment setting
162
+ #
163
+ # @param resource_group_name [String] The name of the resource group.
164
+ # @param lab_account_name [String] The name of the lab Account.
165
+ # @param lab_name [String] The name of the lab.
166
+ # @param environment_setting_name [String] The name of the environment Setting.
167
+ # @param expand [String] Specify the $expand query. Example:
168
+ # 'properties($select=publishingState)'
169
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
170
+ # will be added to the HTTP request.
171
+ #
172
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
173
+ #
174
+ def get_with_http_info(resource_group_name, lab_account_name, lab_name, environment_setting_name, expand:nil, custom_headers:nil)
175
+ get_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, expand:expand, custom_headers:custom_headers).value!
176
+ end
177
+
178
+ #
179
+ # Get environment setting
180
+ #
181
+ # @param resource_group_name [String] The name of the resource group.
182
+ # @param lab_account_name [String] The name of the lab Account.
183
+ # @param lab_name [String] The name of the lab.
184
+ # @param environment_setting_name [String] The name of the environment Setting.
185
+ # @param expand [String] Specify the $expand query. Example:
186
+ # 'properties($select=publishingState)'
187
+ # @param [Hash{String => String}] A hash of custom headers that will be added
188
+ # to the HTTP request.
189
+ #
190
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
191
+ #
192
+ def get_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, expand:nil, custom_headers:nil)
193
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
194
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
195
+ fail ArgumentError, 'lab_account_name is nil' if lab_account_name.nil?
196
+ fail ArgumentError, 'lab_name is nil' if lab_name.nil?
197
+ fail ArgumentError, 'environment_setting_name is nil' if environment_setting_name.nil?
198
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
199
+
200
+
201
+ request_headers = {}
202
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
203
+
204
+ # Set Headers
205
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
206
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
207
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}'
208
+
209
+ request_url = @base_url || @client.base_url
210
+
211
+ options = {
212
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
213
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labAccountName' => lab_account_name,'labName' => lab_name,'environmentSettingName' => environment_setting_name},
214
+ query_params: {'$expand' => expand,'api-version' => @client.api_version},
215
+ headers: request_headers.merge(custom_headers || {}),
216
+ base_url: request_url
217
+ }
218
+ promise = @client.make_request_async(:get, path_template, options)
219
+
220
+ promise = promise.then do |result|
221
+ http_response = result.response
222
+ status_code = http_response.status
223
+ response_content = http_response.body
224
+ unless status_code == 200
225
+ error_model = JSON.load(response_content)
226
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
227
+ end
228
+
229
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
230
+ # Deserialize Response
231
+ if status_code == 200
232
+ begin
233
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
234
+ result_mapper = Azure::Labservices::Mgmt::V2018_10_15::Models::EnvironmentSetting.mapper()
235
+ result.body = @client.deserialize(result_mapper, parsed_response)
236
+ rescue Exception => e
237
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
238
+ end
239
+ end
240
+
241
+ result
242
+ end
243
+
244
+ promise.execute
245
+ end
246
+
247
+ #
248
+ # Create or replace an existing Environment Setting. This operation can take a
249
+ # while to complete
250
+ #
251
+ # @param resource_group_name [String] The name of the resource group.
252
+ # @param lab_account_name [String] The name of the lab Account.
253
+ # @param lab_name [String] The name of the lab.
254
+ # @param environment_setting_name [String] The name of the environment Setting.
255
+ # @param environment_setting [EnvironmentSetting] Represents settings of an
256
+ # environment, from which environment instances would be created
257
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
258
+ # will be added to the HTTP request.
259
+ #
260
+ # @return [EnvironmentSetting] operation results.
261
+ #
262
+ def create_or_update(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_setting, custom_headers:nil)
263
+ response = create_or_update_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_setting, custom_headers:custom_headers).value!
264
+ response.body unless response.nil?
265
+ end
266
+
267
+ #
268
+ # @param resource_group_name [String] The name of the resource group.
269
+ # @param lab_account_name [String] The name of the lab Account.
270
+ # @param lab_name [String] The name of the lab.
271
+ # @param environment_setting_name [String] The name of the environment Setting.
272
+ # @param environment_setting [EnvironmentSetting] Represents settings of an
273
+ # environment, from which environment instances would be created
274
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
275
+ # will be added to the HTTP request.
276
+ #
277
+ # @return [Concurrent::Promise] promise which provides async access to http
278
+ # response.
279
+ #
280
+ def create_or_update_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_setting, custom_headers:nil)
281
+ # Send request
282
+ promise = begin_create_or_update_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_setting, custom_headers:custom_headers)
283
+
284
+ promise = promise.then do |response|
285
+ # Defining deserialization method.
286
+ deserialize_method = lambda do |parsed_response|
287
+ result_mapper = Azure::Labservices::Mgmt::V2018_10_15::Models::EnvironmentSetting.mapper()
288
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
289
+ end
290
+
291
+ # Waiting for response.
292
+ @client.get_long_running_operation_result(response, deserialize_method)
293
+ end
294
+
295
+ promise
296
+ end
297
+
298
+ #
299
+ # Delete environment setting. This operation can take a while to complete
300
+ #
301
+ # @param resource_group_name [String] The name of the resource group.
302
+ # @param lab_account_name [String] The name of the lab Account.
303
+ # @param lab_name [String] The name of the lab.
304
+ # @param environment_setting_name [String] The name of the environment Setting.
305
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
306
+ # will be added to the HTTP request.
307
+ #
308
+ def delete(resource_group_name, lab_account_name, lab_name, environment_setting_name, custom_headers:nil)
309
+ response = delete_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, custom_headers:custom_headers).value!
310
+ nil
311
+ end
312
+
313
+ #
314
+ # @param resource_group_name [String] The name of the resource group.
315
+ # @param lab_account_name [String] The name of the lab Account.
316
+ # @param lab_name [String] The name of the lab.
317
+ # @param environment_setting_name [String] The name of the environment Setting.
318
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
319
+ # will be added to the HTTP request.
320
+ #
321
+ # @return [Concurrent::Promise] promise which provides async access to http
322
+ # response.
323
+ #
324
+ def delete_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, custom_headers:nil)
325
+ # Send request
326
+ promise = begin_delete_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, custom_headers:custom_headers)
327
+
328
+ promise = promise.then do |response|
329
+ # Defining deserialization method.
330
+ deserialize_method = lambda do |parsed_response|
331
+ end
332
+
333
+ # Waiting for response.
334
+ @client.get_long_running_operation_result(response, deserialize_method)
335
+ end
336
+
337
+ promise
338
+ end
339
+
340
+ #
341
+ # Modify properties of environment setting.
342
+ #
343
+ # @param resource_group_name [String] The name of the resource group.
344
+ # @param lab_account_name [String] The name of the lab Account.
345
+ # @param lab_name [String] The name of the lab.
346
+ # @param environment_setting_name [String] The name of the environment Setting.
347
+ # @param environment_setting [EnvironmentSettingFragment] Represents settings
348
+ # of an environment, from which environment instances would be created
349
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
350
+ # will be added to the HTTP request.
351
+ #
352
+ # @return [EnvironmentSetting] operation results.
353
+ #
354
+ def update(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_setting, custom_headers:nil)
355
+ response = update_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_setting, custom_headers:custom_headers).value!
356
+ response.body unless response.nil?
357
+ end
358
+
359
+ #
360
+ # Modify properties of environment setting.
361
+ #
362
+ # @param resource_group_name [String] The name of the resource group.
363
+ # @param lab_account_name [String] The name of the lab Account.
364
+ # @param lab_name [String] The name of the lab.
365
+ # @param environment_setting_name [String] The name of the environment Setting.
366
+ # @param environment_setting [EnvironmentSettingFragment] Represents settings
367
+ # of an environment, from which environment instances would be created
368
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
369
+ # will be added to the HTTP request.
370
+ #
371
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
372
+ #
373
+ def update_with_http_info(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_setting, custom_headers:nil)
374
+ update_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_setting, custom_headers:custom_headers).value!
375
+ end
376
+
377
+ #
378
+ # Modify properties of environment setting.
379
+ #
380
+ # @param resource_group_name [String] The name of the resource group.
381
+ # @param lab_account_name [String] The name of the lab Account.
382
+ # @param lab_name [String] The name of the lab.
383
+ # @param environment_setting_name [String] The name of the environment Setting.
384
+ # @param environment_setting [EnvironmentSettingFragment] Represents settings
385
+ # of an environment, from which environment instances would be created
386
+ # @param [Hash{String => String}] A hash of custom headers that will be added
387
+ # to the HTTP request.
388
+ #
389
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
390
+ #
391
+ def update_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_setting, custom_headers:nil)
392
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
393
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
394
+ fail ArgumentError, 'lab_account_name is nil' if lab_account_name.nil?
395
+ fail ArgumentError, 'lab_name is nil' if lab_name.nil?
396
+ fail ArgumentError, 'environment_setting_name is nil' if environment_setting_name.nil?
397
+ fail ArgumentError, 'environment_setting is nil' if environment_setting.nil?
398
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
399
+
400
+
401
+ request_headers = {}
402
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
403
+
404
+ # Set Headers
405
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
406
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
407
+
408
+ # Serialize Request
409
+ request_mapper = Azure::Labservices::Mgmt::V2018_10_15::Models::EnvironmentSettingFragment.mapper()
410
+ request_content = @client.serialize(request_mapper, environment_setting)
411
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
412
+
413
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}'
414
+
415
+ request_url = @base_url || @client.base_url
416
+
417
+ options = {
418
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
419
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labAccountName' => lab_account_name,'labName' => lab_name,'environmentSettingName' => environment_setting_name},
420
+ query_params: {'api-version' => @client.api_version},
421
+ body: request_content,
422
+ headers: request_headers.merge(custom_headers || {}),
423
+ base_url: request_url
424
+ }
425
+ promise = @client.make_request_async(:patch, path_template, options)
426
+
427
+ promise = promise.then do |result|
428
+ http_response = result.response
429
+ status_code = http_response.status
430
+ response_content = http_response.body
431
+ unless status_code == 200
432
+ error_model = JSON.load(response_content)
433
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
434
+ end
435
+
436
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
437
+ # Deserialize Response
438
+ if status_code == 200
439
+ begin
440
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
441
+ result_mapper = Azure::Labservices::Mgmt::V2018_10_15::Models::EnvironmentSetting.mapper()
442
+ result.body = @client.deserialize(result_mapper, parsed_response)
443
+ rescue Exception => e
444
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
445
+ end
446
+ end
447
+
448
+ result
449
+ end
450
+
451
+ promise.execute
452
+ end
453
+
454
+ #
455
+ # Claims a random environment for a user in an environment settings
456
+ #
457
+ # @param resource_group_name [String] The name of the resource group.
458
+ # @param lab_account_name [String] The name of the lab Account.
459
+ # @param lab_name [String] The name of the lab.
460
+ # @param environment_setting_name [String] The name of the environment Setting.
461
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
462
+ # will be added to the HTTP request.
463
+ #
464
+ #
465
+ def claim_any(resource_group_name, lab_account_name, lab_name, environment_setting_name, custom_headers:nil)
466
+ response = claim_any_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, custom_headers:custom_headers).value!
467
+ nil
468
+ end
469
+
470
+ #
471
+ # Claims a random environment for a user in an environment settings
472
+ #
473
+ # @param resource_group_name [String] The name of the resource group.
474
+ # @param lab_account_name [String] The name of the lab Account.
475
+ # @param lab_name [String] The name of the lab.
476
+ # @param environment_setting_name [String] The name of the environment Setting.
477
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
478
+ # will be added to the HTTP request.
479
+ #
480
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
481
+ #
482
+ def claim_any_with_http_info(resource_group_name, lab_account_name, lab_name, environment_setting_name, custom_headers:nil)
483
+ claim_any_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, custom_headers:custom_headers).value!
484
+ end
485
+
486
+ #
487
+ # Claims a random environment for a user in an environment settings
488
+ #
489
+ # @param resource_group_name [String] The name of the resource group.
490
+ # @param lab_account_name [String] The name of the lab Account.
491
+ # @param lab_name [String] The name of the lab.
492
+ # @param environment_setting_name [String] The name of the environment Setting.
493
+ # @param [Hash{String => String}] A hash of custom headers that will be added
494
+ # to the HTTP request.
495
+ #
496
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
497
+ #
498
+ def claim_any_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, custom_headers:nil)
499
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
500
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
501
+ fail ArgumentError, 'lab_account_name is nil' if lab_account_name.nil?
502
+ fail ArgumentError, 'lab_name is nil' if lab_name.nil?
503
+ fail ArgumentError, 'environment_setting_name is nil' if environment_setting_name.nil?
504
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
505
+
506
+
507
+ request_headers = {}
508
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
509
+
510
+ # Set Headers
511
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
512
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
513
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/claimAny'
514
+
515
+ request_url = @base_url || @client.base_url
516
+
517
+ options = {
518
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
519
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labAccountName' => lab_account_name,'labName' => lab_name,'environmentSettingName' => environment_setting_name},
520
+ query_params: {'api-version' => @client.api_version},
521
+ headers: request_headers.merge(custom_headers || {}),
522
+ base_url: request_url
523
+ }
524
+ promise = @client.make_request_async(:post, path_template, options)
525
+
526
+ promise = promise.then do |result|
527
+ http_response = result.response
528
+ status_code = http_response.status
529
+ response_content = http_response.body
530
+ unless status_code == 200
531
+ error_model = JSON.load(response_content)
532
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
533
+ end
534
+
535
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
536
+
537
+ result
538
+ end
539
+
540
+ promise.execute
541
+ end
542
+
543
+ #
544
+ # Provisions/deprovisions required resources for an environment setting based
545
+ # on current state of the lab/environment setting.
546
+ #
547
+ # @param resource_group_name [String] The name of the resource group.
548
+ # @param lab_account_name [String] The name of the lab Account.
549
+ # @param lab_name [String] The name of the lab.
550
+ # @param environment_setting_name [String] The name of the environment Setting.
551
+ # @param publish_payload [PublishPayload] Payload for Publish operation on
552
+ # EnvironmentSetting.
553
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
554
+ # will be added to the HTTP request.
555
+ #
556
+ #
557
+ def publish(resource_group_name, lab_account_name, lab_name, environment_setting_name, publish_payload, custom_headers:nil)
558
+ response = publish_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, publish_payload, custom_headers:custom_headers).value!
559
+ nil
560
+ end
561
+
562
+ #
563
+ # Provisions/deprovisions required resources for an environment setting based
564
+ # on current state of the lab/environment setting.
565
+ #
566
+ # @param resource_group_name [String] The name of the resource group.
567
+ # @param lab_account_name [String] The name of the lab Account.
568
+ # @param lab_name [String] The name of the lab.
569
+ # @param environment_setting_name [String] The name of the environment Setting.
570
+ # @param publish_payload [PublishPayload] Payload for Publish operation on
571
+ # EnvironmentSetting.
572
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
573
+ # will be added to the HTTP request.
574
+ #
575
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
576
+ #
577
+ def publish_with_http_info(resource_group_name, lab_account_name, lab_name, environment_setting_name, publish_payload, custom_headers:nil)
578
+ publish_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, publish_payload, custom_headers:custom_headers).value!
579
+ end
580
+
581
+ #
582
+ # Provisions/deprovisions required resources for an environment setting based
583
+ # on current state of the lab/environment setting.
584
+ #
585
+ # @param resource_group_name [String] The name of the resource group.
586
+ # @param lab_account_name [String] The name of the lab Account.
587
+ # @param lab_name [String] The name of the lab.
588
+ # @param environment_setting_name [String] The name of the environment Setting.
589
+ # @param publish_payload [PublishPayload] Payload for Publish operation on
590
+ # EnvironmentSetting.
591
+ # @param [Hash{String => String}] A hash of custom headers that will be added
592
+ # to the HTTP request.
593
+ #
594
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
595
+ #
596
+ def publish_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, publish_payload, custom_headers:nil)
597
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
598
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
599
+ fail ArgumentError, 'lab_account_name is nil' if lab_account_name.nil?
600
+ fail ArgumentError, 'lab_name is nil' if lab_name.nil?
601
+ fail ArgumentError, 'environment_setting_name is nil' if environment_setting_name.nil?
602
+ fail ArgumentError, 'publish_payload is nil' if publish_payload.nil?
603
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
604
+
605
+
606
+ request_headers = {}
607
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
608
+
609
+ # Set Headers
610
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
611
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
612
+
613
+ # Serialize Request
614
+ request_mapper = Azure::Labservices::Mgmt::V2018_10_15::Models::PublishPayload.mapper()
615
+ request_content = @client.serialize(request_mapper, publish_payload)
616
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
617
+
618
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/publish'
619
+
620
+ request_url = @base_url || @client.base_url
621
+
622
+ options = {
623
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
624
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labAccountName' => lab_account_name,'labName' => lab_name,'environmentSettingName' => environment_setting_name},
625
+ query_params: {'api-version' => @client.api_version},
626
+ body: request_content,
627
+ headers: request_headers.merge(custom_headers || {}),
628
+ base_url: request_url
629
+ }
630
+ promise = @client.make_request_async(:post, path_template, options)
631
+
632
+ promise = promise.then do |result|
633
+ http_response = result.response
634
+ status_code = http_response.status
635
+ response_content = http_response.body
636
+ unless status_code == 200
637
+ error_model = JSON.load(response_content)
638
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
639
+ end
640
+
641
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
642
+
643
+ result
644
+ end
645
+
646
+ promise.execute
647
+ end
648
+
649
+ #
650
+ # Starts a template by starting all resources inside the template. This
651
+ # operation can take a while to complete
652
+ #
653
+ # @param resource_group_name [String] The name of the resource group.
654
+ # @param lab_account_name [String] The name of the lab Account.
655
+ # @param lab_name [String] The name of the lab.
656
+ # @param environment_setting_name [String] The name of the environment Setting.
657
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
658
+ # will be added to the HTTP request.
659
+ #
660
+ def start(resource_group_name, lab_account_name, lab_name, environment_setting_name, custom_headers:nil)
661
+ response = start_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, custom_headers:custom_headers).value!
662
+ nil
663
+ end
664
+
665
+ #
666
+ # @param resource_group_name [String] The name of the resource group.
667
+ # @param lab_account_name [String] The name of the lab Account.
668
+ # @param lab_name [String] The name of the lab.
669
+ # @param environment_setting_name [String] The name of the environment Setting.
670
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
671
+ # will be added to the HTTP request.
672
+ #
673
+ # @return [Concurrent::Promise] promise which provides async access to http
674
+ # response.
675
+ #
676
+ def start_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, custom_headers:nil)
677
+ # Send request
678
+ promise = begin_start_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, custom_headers:custom_headers)
679
+
680
+ promise = promise.then do |response|
681
+ # Defining deserialization method.
682
+ deserialize_method = lambda do |parsed_response|
683
+ end
684
+
685
+ # Waiting for response.
686
+ @client.get_long_running_operation_result(response, deserialize_method)
687
+ end
688
+
689
+ promise
690
+ end
691
+
692
+ #
693
+ # Starts a template by starting all resources inside the template. This
694
+ # operation can take a while to complete
695
+ #
696
+ # @param resource_group_name [String] The name of the resource group.
697
+ # @param lab_account_name [String] The name of the lab Account.
698
+ # @param lab_name [String] The name of the lab.
699
+ # @param environment_setting_name [String] The name of the environment Setting.
700
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
701
+ # will be added to the HTTP request.
702
+ #
703
+ def stop(resource_group_name, lab_account_name, lab_name, environment_setting_name, custom_headers:nil)
704
+ response = stop_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, custom_headers:custom_headers).value!
705
+ nil
706
+ end
707
+
708
+ #
709
+ # @param resource_group_name [String] The name of the resource group.
710
+ # @param lab_account_name [String] The name of the lab Account.
711
+ # @param lab_name [String] The name of the lab.
712
+ # @param environment_setting_name [String] The name of the environment Setting.
713
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
714
+ # will be added to the HTTP request.
715
+ #
716
+ # @return [Concurrent::Promise] promise which provides async access to http
717
+ # response.
718
+ #
719
+ def stop_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, custom_headers:nil)
720
+ # Send request
721
+ promise = begin_stop_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, custom_headers:custom_headers)
722
+
723
+ promise = promise.then do |response|
724
+ # Defining deserialization method.
725
+ deserialize_method = lambda do |parsed_response|
726
+ end
727
+
728
+ # Waiting for response.
729
+ @client.get_long_running_operation_result(response, deserialize_method)
730
+ end
731
+
732
+ promise
733
+ end
734
+
735
+ #
736
+ # Create or replace an existing Environment Setting. This operation can take a
737
+ # while to complete
738
+ #
739
+ # @param resource_group_name [String] The name of the resource group.
740
+ # @param lab_account_name [String] The name of the lab Account.
741
+ # @param lab_name [String] The name of the lab.
742
+ # @param environment_setting_name [String] The name of the environment Setting.
743
+ # @param environment_setting [EnvironmentSetting] Represents settings of an
744
+ # environment, from which environment instances would be created
745
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
746
+ # will be added to the HTTP request.
747
+ #
748
+ # @return [EnvironmentSetting] operation results.
749
+ #
750
+ def begin_create_or_update(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_setting, custom_headers:nil)
751
+ response = begin_create_or_update_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_setting, custom_headers:custom_headers).value!
752
+ response.body unless response.nil?
753
+ end
754
+
755
+ #
756
+ # Create or replace an existing Environment Setting. This operation can take a
757
+ # while to complete
758
+ #
759
+ # @param resource_group_name [String] The name of the resource group.
760
+ # @param lab_account_name [String] The name of the lab Account.
761
+ # @param lab_name [String] The name of the lab.
762
+ # @param environment_setting_name [String] The name of the environment Setting.
763
+ # @param environment_setting [EnvironmentSetting] Represents settings of an
764
+ # environment, from which environment instances would be created
765
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
766
+ # will be added to the HTTP request.
767
+ #
768
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
769
+ #
770
+ def begin_create_or_update_with_http_info(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_setting, custom_headers:nil)
771
+ begin_create_or_update_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_setting, custom_headers:custom_headers).value!
772
+ end
773
+
774
+ #
775
+ # Create or replace an existing Environment Setting. This operation can take a
776
+ # while to complete
777
+ #
778
+ # @param resource_group_name [String] The name of the resource group.
779
+ # @param lab_account_name [String] The name of the lab Account.
780
+ # @param lab_name [String] The name of the lab.
781
+ # @param environment_setting_name [String] The name of the environment Setting.
782
+ # @param environment_setting [EnvironmentSetting] Represents settings of an
783
+ # environment, from which environment instances would be created
784
+ # @param [Hash{String => String}] A hash of custom headers that will be added
785
+ # to the HTTP request.
786
+ #
787
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
788
+ #
789
+ def begin_create_or_update_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_setting, custom_headers:nil)
790
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
791
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
792
+ fail ArgumentError, 'lab_account_name is nil' if lab_account_name.nil?
793
+ fail ArgumentError, 'lab_name is nil' if lab_name.nil?
794
+ fail ArgumentError, 'environment_setting_name is nil' if environment_setting_name.nil?
795
+ fail ArgumentError, 'environment_setting is nil' if environment_setting.nil?
796
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
797
+
798
+
799
+ request_headers = {}
800
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
801
+
802
+ # Set Headers
803
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
804
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
805
+
806
+ # Serialize Request
807
+ request_mapper = Azure::Labservices::Mgmt::V2018_10_15::Models::EnvironmentSetting.mapper()
808
+ request_content = @client.serialize(request_mapper, environment_setting)
809
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
810
+
811
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}'
812
+
813
+ request_url = @base_url || @client.base_url
814
+
815
+ options = {
816
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
817
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labAccountName' => lab_account_name,'labName' => lab_name,'environmentSettingName' => environment_setting_name},
818
+ query_params: {'api-version' => @client.api_version},
819
+ body: request_content,
820
+ headers: request_headers.merge(custom_headers || {}),
821
+ base_url: request_url
822
+ }
823
+ promise = @client.make_request_async(:put, path_template, options)
824
+
825
+ promise = promise.then do |result|
826
+ http_response = result.response
827
+ status_code = http_response.status
828
+ response_content = http_response.body
829
+ unless status_code == 200 || status_code == 201
830
+ error_model = JSON.load(response_content)
831
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
832
+ end
833
+
834
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
835
+ # Deserialize Response
836
+ if status_code == 200
837
+ begin
838
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
839
+ result_mapper = Azure::Labservices::Mgmt::V2018_10_15::Models::EnvironmentSetting.mapper()
840
+ result.body = @client.deserialize(result_mapper, parsed_response)
841
+ rescue Exception => e
842
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
843
+ end
844
+ end
845
+ # Deserialize Response
846
+ if status_code == 201
847
+ begin
848
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
849
+ result_mapper = Azure::Labservices::Mgmt::V2018_10_15::Models::EnvironmentSetting.mapper()
850
+ result.body = @client.deserialize(result_mapper, parsed_response)
851
+ rescue Exception => e
852
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
853
+ end
854
+ end
855
+
856
+ result
857
+ end
858
+
859
+ promise.execute
860
+ end
861
+
862
+ #
863
+ # Delete environment setting. This operation can take a while to complete
864
+ #
865
+ # @param resource_group_name [String] The name of the resource group.
866
+ # @param lab_account_name [String] The name of the lab Account.
867
+ # @param lab_name [String] The name of the lab.
868
+ # @param environment_setting_name [String] The name of the environment Setting.
869
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
870
+ # will be added to the HTTP request.
871
+ #
872
+ #
873
+ def begin_delete(resource_group_name, lab_account_name, lab_name, environment_setting_name, custom_headers:nil)
874
+ response = begin_delete_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, custom_headers:custom_headers).value!
875
+ nil
876
+ end
877
+
878
+ #
879
+ # Delete environment setting. This operation can take a while to complete
880
+ #
881
+ # @param resource_group_name [String] The name of the resource group.
882
+ # @param lab_account_name [String] The name of the lab Account.
883
+ # @param lab_name [String] The name of the lab.
884
+ # @param environment_setting_name [String] The name of the environment Setting.
885
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
886
+ # will be added to the HTTP request.
887
+ #
888
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
889
+ #
890
+ def begin_delete_with_http_info(resource_group_name, lab_account_name, lab_name, environment_setting_name, custom_headers:nil)
891
+ begin_delete_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, custom_headers:custom_headers).value!
892
+ end
893
+
894
+ #
895
+ # Delete environment setting. This operation can take a while to complete
896
+ #
897
+ # @param resource_group_name [String] The name of the resource group.
898
+ # @param lab_account_name [String] The name of the lab Account.
899
+ # @param lab_name [String] The name of the lab.
900
+ # @param environment_setting_name [String] The name of the environment Setting.
901
+ # @param [Hash{String => String}] A hash of custom headers that will be added
902
+ # to the HTTP request.
903
+ #
904
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
905
+ #
906
+ def begin_delete_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, custom_headers:nil)
907
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
908
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
909
+ fail ArgumentError, 'lab_account_name is nil' if lab_account_name.nil?
910
+ fail ArgumentError, 'lab_name is nil' if lab_name.nil?
911
+ fail ArgumentError, 'environment_setting_name is nil' if environment_setting_name.nil?
912
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
913
+
914
+
915
+ request_headers = {}
916
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
917
+
918
+ # Set Headers
919
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
920
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
921
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}'
922
+
923
+ request_url = @base_url || @client.base_url
924
+
925
+ options = {
926
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
927
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labAccountName' => lab_account_name,'labName' => lab_name,'environmentSettingName' => environment_setting_name},
928
+ query_params: {'api-version' => @client.api_version},
929
+ headers: request_headers.merge(custom_headers || {}),
930
+ base_url: request_url
931
+ }
932
+ promise = @client.make_request_async(:delete, path_template, options)
933
+
934
+ promise = promise.then do |result|
935
+ http_response = result.response
936
+ status_code = http_response.status
937
+ response_content = http_response.body
938
+ unless status_code == 202 || status_code == 204
939
+ error_model = JSON.load(response_content)
940
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
941
+ end
942
+
943
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
944
+
945
+ result
946
+ end
947
+
948
+ promise.execute
949
+ end
950
+
951
+ #
952
+ # Starts a template by starting all resources inside the template. This
953
+ # operation can take a while to complete
954
+ #
955
+ # @param resource_group_name [String] The name of the resource group.
956
+ # @param lab_account_name [String] The name of the lab Account.
957
+ # @param lab_name [String] The name of the lab.
958
+ # @param environment_setting_name [String] The name of the environment Setting.
959
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
960
+ # will be added to the HTTP request.
961
+ #
962
+ #
963
+ def begin_start(resource_group_name, lab_account_name, lab_name, environment_setting_name, custom_headers:nil)
964
+ response = begin_start_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, custom_headers:custom_headers).value!
965
+ nil
966
+ end
967
+
968
+ #
969
+ # Starts a template by starting all resources inside the template. This
970
+ # operation can take a while to complete
971
+ #
972
+ # @param resource_group_name [String] The name of the resource group.
973
+ # @param lab_account_name [String] The name of the lab Account.
974
+ # @param lab_name [String] The name of the lab.
975
+ # @param environment_setting_name [String] The name of the environment Setting.
976
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
977
+ # will be added to the HTTP request.
978
+ #
979
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
980
+ #
981
+ def begin_start_with_http_info(resource_group_name, lab_account_name, lab_name, environment_setting_name, custom_headers:nil)
982
+ begin_start_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, custom_headers:custom_headers).value!
983
+ end
984
+
985
+ #
986
+ # Starts a template by starting all resources inside the template. This
987
+ # operation can take a while to complete
988
+ #
989
+ # @param resource_group_name [String] The name of the resource group.
990
+ # @param lab_account_name [String] The name of the lab Account.
991
+ # @param lab_name [String] The name of the lab.
992
+ # @param environment_setting_name [String] The name of the environment Setting.
993
+ # @param [Hash{String => String}] A hash of custom headers that will be added
994
+ # to the HTTP request.
995
+ #
996
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
997
+ #
998
+ def begin_start_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, custom_headers:nil)
999
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1000
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1001
+ fail ArgumentError, 'lab_account_name is nil' if lab_account_name.nil?
1002
+ fail ArgumentError, 'lab_name is nil' if lab_name.nil?
1003
+ fail ArgumentError, 'environment_setting_name is nil' if environment_setting_name.nil?
1004
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1005
+
1006
+
1007
+ request_headers = {}
1008
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1009
+
1010
+ # Set Headers
1011
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1012
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1013
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/start'
1014
+
1015
+ request_url = @base_url || @client.base_url
1016
+
1017
+ options = {
1018
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1019
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labAccountName' => lab_account_name,'labName' => lab_name,'environmentSettingName' => environment_setting_name},
1020
+ query_params: {'api-version' => @client.api_version},
1021
+ headers: request_headers.merge(custom_headers || {}),
1022
+ base_url: request_url
1023
+ }
1024
+ promise = @client.make_request_async(:post, path_template, options)
1025
+
1026
+ promise = promise.then do |result|
1027
+ http_response = result.response
1028
+ status_code = http_response.status
1029
+ response_content = http_response.body
1030
+ unless status_code == 200 || status_code == 202
1031
+ error_model = JSON.load(response_content)
1032
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1033
+ end
1034
+
1035
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1036
+
1037
+ result
1038
+ end
1039
+
1040
+ promise.execute
1041
+ end
1042
+
1043
+ #
1044
+ # Starts a template by starting all resources inside the template. This
1045
+ # operation can take a while to complete
1046
+ #
1047
+ # @param resource_group_name [String] The name of the resource group.
1048
+ # @param lab_account_name [String] The name of the lab Account.
1049
+ # @param lab_name [String] The name of the lab.
1050
+ # @param environment_setting_name [String] The name of the environment Setting.
1051
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1052
+ # will be added to the HTTP request.
1053
+ #
1054
+ #
1055
+ def begin_stop(resource_group_name, lab_account_name, lab_name, environment_setting_name, custom_headers:nil)
1056
+ response = begin_stop_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, custom_headers:custom_headers).value!
1057
+ nil
1058
+ end
1059
+
1060
+ #
1061
+ # Starts a template by starting all resources inside the template. This
1062
+ # operation can take a while to complete
1063
+ #
1064
+ # @param resource_group_name [String] The name of the resource group.
1065
+ # @param lab_account_name [String] The name of the lab Account.
1066
+ # @param lab_name [String] The name of the lab.
1067
+ # @param environment_setting_name [String] The name of the environment Setting.
1068
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1069
+ # will be added to the HTTP request.
1070
+ #
1071
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1072
+ #
1073
+ def begin_stop_with_http_info(resource_group_name, lab_account_name, lab_name, environment_setting_name, custom_headers:nil)
1074
+ begin_stop_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, custom_headers:custom_headers).value!
1075
+ end
1076
+
1077
+ #
1078
+ # Starts a template by starting all resources inside the template. This
1079
+ # operation can take a while to complete
1080
+ #
1081
+ # @param resource_group_name [String] The name of the resource group.
1082
+ # @param lab_account_name [String] The name of the lab Account.
1083
+ # @param lab_name [String] The name of the lab.
1084
+ # @param environment_setting_name [String] The name of the environment Setting.
1085
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1086
+ # to the HTTP request.
1087
+ #
1088
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1089
+ #
1090
+ def begin_stop_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, custom_headers:nil)
1091
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1092
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1093
+ fail ArgumentError, 'lab_account_name is nil' if lab_account_name.nil?
1094
+ fail ArgumentError, 'lab_name is nil' if lab_name.nil?
1095
+ fail ArgumentError, 'environment_setting_name is nil' if environment_setting_name.nil?
1096
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1097
+
1098
+
1099
+ request_headers = {}
1100
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1101
+
1102
+ # Set Headers
1103
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1104
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1105
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/stop'
1106
+
1107
+ request_url = @base_url || @client.base_url
1108
+
1109
+ options = {
1110
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1111
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labAccountName' => lab_account_name,'labName' => lab_name,'environmentSettingName' => environment_setting_name},
1112
+ query_params: {'api-version' => @client.api_version},
1113
+ headers: request_headers.merge(custom_headers || {}),
1114
+ base_url: request_url
1115
+ }
1116
+ promise = @client.make_request_async(:post, path_template, options)
1117
+
1118
+ promise = promise.then do |result|
1119
+ http_response = result.response
1120
+ status_code = http_response.status
1121
+ response_content = http_response.body
1122
+ unless status_code == 200 || status_code == 202
1123
+ error_model = JSON.load(response_content)
1124
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1125
+ end
1126
+
1127
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1128
+
1129
+ result
1130
+ end
1131
+
1132
+ promise.execute
1133
+ end
1134
+
1135
+ #
1136
+ # List environment setting in a given lab.
1137
+ #
1138
+ # @param next_page_link [String] The NextLink from the previous successful call
1139
+ # to List operation.
1140
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1141
+ # will be added to the HTTP request.
1142
+ #
1143
+ # @return [ResponseWithContinuationEnvironmentSetting] operation results.
1144
+ #
1145
+ def list_next(next_page_link, custom_headers:nil)
1146
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
1147
+ response.body unless response.nil?
1148
+ end
1149
+
1150
+ #
1151
+ # List environment setting in a given lab.
1152
+ #
1153
+ # @param next_page_link [String] The NextLink from the previous successful call
1154
+ # to List operation.
1155
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1156
+ # will be added to the HTTP request.
1157
+ #
1158
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1159
+ #
1160
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
1161
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
1162
+ end
1163
+
1164
+ #
1165
+ # List environment setting in a given lab.
1166
+ #
1167
+ # @param next_page_link [String] The NextLink from the previous successful call
1168
+ # to List operation.
1169
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1170
+ # to the HTTP request.
1171
+ #
1172
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1173
+ #
1174
+ def list_next_async(next_page_link, custom_headers:nil)
1175
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1176
+
1177
+
1178
+ request_headers = {}
1179
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1180
+
1181
+ # Set Headers
1182
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1183
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1184
+ path_template = '{nextLink}'
1185
+
1186
+ request_url = @base_url || @client.base_url
1187
+
1188
+ options = {
1189
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1190
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1191
+ headers: request_headers.merge(custom_headers || {}),
1192
+ base_url: request_url
1193
+ }
1194
+ promise = @client.make_request_async(:get, path_template, options)
1195
+
1196
+ promise = promise.then do |result|
1197
+ http_response = result.response
1198
+ status_code = http_response.status
1199
+ response_content = http_response.body
1200
+ unless status_code == 200
1201
+ error_model = JSON.load(response_content)
1202
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1203
+ end
1204
+
1205
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1206
+ # Deserialize Response
1207
+ if status_code == 200
1208
+ begin
1209
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1210
+ result_mapper = Azure::Labservices::Mgmt::V2018_10_15::Models::ResponseWithContinuationEnvironmentSetting.mapper()
1211
+ result.body = @client.deserialize(result_mapper, parsed_response)
1212
+ rescue Exception => e
1213
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1214
+ end
1215
+ end
1216
+
1217
+ result
1218
+ end
1219
+
1220
+ promise.execute
1221
+ end
1222
+
1223
+ #
1224
+ # List environment setting in a given lab.
1225
+ #
1226
+ # @param resource_group_name [String] The name of the resource group.
1227
+ # @param lab_account_name [String] The name of the lab Account.
1228
+ # @param lab_name [String] The name of the lab.
1229
+ # @param expand [String] Specify the $expand query. Example:
1230
+ # 'properties($select=publishingState)'
1231
+ # @param filter [String] The filter to apply to the operation.
1232
+ # @param top [Integer] The maximum number of resources to return from the
1233
+ # operation.
1234
+ # @param orderby [String] The ordering expression for the results, using OData
1235
+ # notation.
1236
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1237
+ # will be added to the HTTP request.
1238
+ #
1239
+ # @return [ResponseWithContinuationEnvironmentSetting] which provide lazy
1240
+ # access to pages of the response.
1241
+ #
1242
+ def list_as_lazy(resource_group_name, lab_account_name, lab_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil)
1243
+ response = list_async(resource_group_name, lab_account_name, lab_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers).value!
1244
+ unless response.nil?
1245
+ page = response.body
1246
+ page.next_method = Proc.new do |next_page_link|
1247
+ list_next_async(next_page_link, custom_headers:custom_headers)
1248
+ end
1249
+ page
1250
+ end
1251
+ end
1252
+
1253
+ end
1254
+ end