azure_mgmt_devtestlabs 0.10.0 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (179) hide show
  1. checksums.yaml +4 -4
  2. data/lib/generated/azure_mgmt_devtestlabs.rb +149 -55
  3. data/lib/generated/azure_mgmt_devtestlabs/arm_templates.rb +363 -0
  4. data/lib/generated/azure_mgmt_devtestlabs/{artifact_source_operations.rb → artifact_sources.rb} +85 -69
  5. data/lib/generated/azure_mgmt_devtestlabs/{artifact_operations.rb → artifacts.rb} +59 -43
  6. data/lib/generated/azure_mgmt_devtestlabs/costs.rb +244 -0
  7. data/lib/generated/azure_mgmt_devtestlabs/{custom_image_operations.rb → custom_images.rb} +81 -68
  8. data/lib/generated/azure_mgmt_devtestlabs/dev_test_labs_client.rb +73 -37
  9. data/lib/generated/azure_mgmt_devtestlabs/disks.rb +975 -0
  10. data/lib/generated/azure_mgmt_devtestlabs/environments.rb +672 -0
  11. data/lib/generated/azure_mgmt_devtestlabs/{formula_operations.rb → formulas.rb} +82 -64
  12. data/lib/generated/azure_mgmt_devtestlabs/{gallery_image_operations.rb → gallery_images.rb} +33 -26
  13. data/lib/generated/azure_mgmt_devtestlabs/global_schedules.rb +1121 -0
  14. data/lib/generated/azure_mgmt_devtestlabs/{lab_operations.rb → labs.rb} +439 -141
  15. data/lib/generated/azure_mgmt_devtestlabs/models/applicable_schedule.rb +105 -0
  16. data/lib/generated/azure_mgmt_devtestlabs/models/applicable_schedule_fragment.rb +105 -0
  17. data/lib/generated/azure_mgmt_devtestlabs/models/apply_artifacts_request.rb +2 -1
  18. data/lib/generated/azure_mgmt_devtestlabs/models/arm_template.rb +167 -0
  19. data/lib/generated/azure_mgmt_devtestlabs/models/arm_template_info.rb +2 -1
  20. data/lib/generated/azure_mgmt_devtestlabs/models/arm_template_parameter_properties.rb +55 -0
  21. data/lib/generated/azure_mgmt_devtestlabs/models/artifact.rb +70 -53
  22. data/lib/generated/azure_mgmt_devtestlabs/models/artifact_deployment_status_properties.rb +2 -1
  23. data/lib/generated/azure_mgmt_devtestlabs/models/artifact_deployment_status_properties_fragment.rb +68 -0
  24. data/lib/generated/azure_mgmt_devtestlabs/models/artifact_install_properties.rb +43 -1
  25. data/lib/generated/azure_mgmt_devtestlabs/models/artifact_install_properties_fragment.rb +105 -0
  26. data/lib/generated/azure_mgmt_devtestlabs/models/artifact_parameter_properties.rb +2 -1
  27. data/lib/generated/azure_mgmt_devtestlabs/models/artifact_parameter_properties_fragment.rb +55 -0
  28. data/lib/generated/azure_mgmt_devtestlabs/models/artifact_source.rb +75 -62
  29. data/lib/generated/azure_mgmt_devtestlabs/models/artifact_source_fragment.rb +185 -0
  30. data/lib/generated/azure_mgmt_devtestlabs/models/attach_disk_properties.rb +46 -0
  31. data/lib/generated/azure_mgmt_devtestlabs/models/attach_new_data_disk_options.rb +66 -0
  32. data/lib/generated/azure_mgmt_devtestlabs/models/bulk_creation_parameters.rb +45 -0
  33. data/lib/generated/azure_mgmt_devtestlabs/models/compute_data_disk.rb +76 -0
  34. data/lib/generated/azure_mgmt_devtestlabs/models/compute_data_disk_fragment.rb +76 -0
  35. data/lib/generated/azure_mgmt_devtestlabs/models/compute_vm_instance_view_status.rb +65 -0
  36. data/lib/generated/azure_mgmt_devtestlabs/models/compute_vm_instance_view_status_fragment.rb +65 -0
  37. data/lib/generated/azure_mgmt_devtestlabs/models/compute_vm_properties.rb +131 -0
  38. data/lib/generated/azure_mgmt_devtestlabs/models/compute_vm_properties_fragment.rb +131 -0
  39. data/lib/generated/azure_mgmt_devtestlabs/models/cost_threshold_properties.rb +92 -0
  40. data/lib/generated/azure_mgmt_devtestlabs/models/cost_threshold_status.rb +16 -0
  41. data/lib/generated/azure_mgmt_devtestlabs/models/{lab_cost_type.rb → cost_type.rb} +3 -3
  42. data/lib/generated/azure_mgmt_devtestlabs/models/custom_image.rb +58 -57
  43. data/lib/generated/azure_mgmt_devtestlabs/models/custom_image_os_type.rb +1 -1
  44. data/lib/generated/azure_mgmt_devtestlabs/models/custom_image_properties_custom.rb +5 -4
  45. data/lib/generated/azure_mgmt_devtestlabs/models/custom_image_properties_from_vm.rb +2 -1
  46. data/lib/generated/azure_mgmt_devtestlabs/models/data_disk_properties.rb +70 -0
  47. data/lib/generated/azure_mgmt_devtestlabs/models/day_details.rb +3 -2
  48. data/lib/generated/azure_mgmt_devtestlabs/models/{subscription_notification_properties.rb → day_details_fragment.rb} +11 -11
  49. data/lib/generated/azure_mgmt_devtestlabs/models/detach_data_disk_properties.rb +46 -0
  50. data/lib/generated/azure_mgmt_devtestlabs/models/detach_disk_properties.rb +46 -0
  51. data/lib/generated/azure_mgmt_devtestlabs/models/disk.rb +186 -0
  52. data/lib/generated/azure_mgmt_devtestlabs/models/dtl_environment.rb +146 -0
  53. data/lib/generated/azure_mgmt_devtestlabs/models/enable_status.rb +1 -1
  54. data/lib/generated/azure_mgmt_devtestlabs/models/environment_deployment_properties.rb +64 -0
  55. data/lib/generated/azure_mgmt_devtestlabs/models/evaluate_policies_properties.rb +2 -1
  56. data/lib/generated/azure_mgmt_devtestlabs/models/evaluate_policies_request.rb +2 -1
  57. data/lib/generated/azure_mgmt_devtestlabs/models/evaluate_policies_response.rb +2 -1
  58. data/lib/generated/azure_mgmt_devtestlabs/models/event.rb +47 -0
  59. data/lib/generated/azure_mgmt_devtestlabs/models/event_fragment.rb +47 -0
  60. data/lib/generated/azure_mgmt_devtestlabs/models/export_resource_usage_parameters.rb +58 -0
  61. data/lib/generated/azure_mgmt_devtestlabs/models/external_subnet.rb +55 -0
  62. data/lib/generated/azure_mgmt_devtestlabs/models/external_subnet_fragment.rb +55 -0
  63. data/lib/generated/azure_mgmt_devtestlabs/models/file_upload_options.rb +16 -0
  64. data/lib/generated/azure_mgmt_devtestlabs/models/formula.rb +53 -61
  65. data/lib/generated/azure_mgmt_devtestlabs/models/formula_properties_from_vm.rb +2 -1
  66. data/lib/generated/azure_mgmt_devtestlabs/models/gallery_image.rb +44 -54
  67. data/lib/generated/azure_mgmt_devtestlabs/models/gallery_image_reference.rb +2 -1
  68. data/lib/generated/azure_mgmt_devtestlabs/models/gallery_image_reference_fragment.rb +85 -0
  69. data/lib/generated/azure_mgmt_devtestlabs/models/generate_arm_template_request.rb +14 -1
  70. data/lib/generated/azure_mgmt_devtestlabs/models/generate_upload_uri_parameter.rb +2 -1
  71. data/lib/generated/azure_mgmt_devtestlabs/models/generate_upload_uri_response.rb +2 -1
  72. data/lib/generated/azure_mgmt_devtestlabs/models/host_caching_options.rb +17 -0
  73. data/lib/generated/azure_mgmt_devtestlabs/models/hour_details.rb +2 -1
  74. data/lib/generated/azure_mgmt_devtestlabs/models/hour_details_fragment.rb +45 -0
  75. data/lib/generated/azure_mgmt_devtestlabs/models/identity_properties.rb +75 -0
  76. data/lib/generated/azure_mgmt_devtestlabs/models/inbound_nat_rule.rb +70 -0
  77. data/lib/generated/azure_mgmt_devtestlabs/models/inbound_nat_rule_fragment.rb +70 -0
  78. data/lib/generated/azure_mgmt_devtestlabs/models/lab.rb +85 -54
  79. data/lib/generated/azure_mgmt_devtestlabs/models/lab_cost.rb +204 -0
  80. data/lib/generated/azure_mgmt_devtestlabs/models/{cost_per_day_properties.rb → lab_cost_details_properties.rb} +7 -6
  81. data/lib/generated/azure_mgmt_devtestlabs/models/lab_cost_summary_properties.rb +45 -0
  82. data/lib/generated/azure_mgmt_devtestlabs/models/lab_fragment.rb +127 -0
  83. data/lib/generated/azure_mgmt_devtestlabs/models/{resource_cost_properties.rb → lab_resource_cost_properties.rb} +49 -28
  84. data/lib/generated/azure_mgmt_devtestlabs/models/lab_vhd.rb +3 -2
  85. data/lib/generated/azure_mgmt_devtestlabs/models/lab_virtual_machine.rb +141 -42
  86. data/lib/generated/azure_mgmt_devtestlabs/models/lab_virtual_machine_creation_parameter.rb +412 -0
  87. data/lib/generated/azure_mgmt_devtestlabs/models/lab_virtual_machine_fragment.rb +410 -0
  88. data/lib/generated/azure_mgmt_devtestlabs/models/linux_os_info.rb +5 -3
  89. data/lib/generated/azure_mgmt_devtestlabs/models/linux_os_state.rb +1 -1
  90. data/lib/generated/azure_mgmt_devtestlabs/models/network_interface_properties.rb +130 -0
  91. data/lib/generated/azure_mgmt_devtestlabs/models/network_interface_properties_fragment.rb +130 -0
  92. data/lib/generated/azure_mgmt_devtestlabs/models/notification_channel.rb +150 -0
  93. data/lib/generated/azure_mgmt_devtestlabs/models/notification_channel_event_type.rb +16 -0
  94. data/lib/generated/azure_mgmt_devtestlabs/models/{cost.rb → notification_channel_fragment.rb} +64 -64
  95. data/lib/generated/azure_mgmt_devtestlabs/models/notification_settings.rb +69 -0
  96. data/lib/generated/azure_mgmt_devtestlabs/models/notification_settings_fragment.rb +69 -0
  97. data/lib/generated/azure_mgmt_devtestlabs/models/notification_status.rb +16 -0
  98. data/lib/generated/azure_mgmt_devtestlabs/models/notify_parameters.rb +56 -0
  99. data/lib/generated/azure_mgmt_devtestlabs/models/parameter_info.rb +5 -5
  100. data/lib/generated/azure_mgmt_devtestlabs/models/parameters_value_file_info.rb +55 -0
  101. data/lib/generated/azure_mgmt_devtestlabs/models/percentage_cost_threshold_properties.rb +45 -0
  102. data/lib/generated/azure_mgmt_devtestlabs/models/policy.rb +62 -58
  103. data/lib/generated/azure_mgmt_devtestlabs/models/policy_evaluator_type.rb +1 -1
  104. data/lib/generated/azure_mgmt_devtestlabs/models/policy_fact_name.rb +4 -1
  105. data/lib/generated/azure_mgmt_devtestlabs/models/policy_fragment.rb +168 -0
  106. data/lib/generated/azure_mgmt_devtestlabs/models/policy_set_result.rb +2 -1
  107. data/lib/generated/azure_mgmt_devtestlabs/models/policy_status.rb +1 -1
  108. data/lib/generated/azure_mgmt_devtestlabs/models/policy_violation.rb +2 -1
  109. data/lib/generated/azure_mgmt_devtestlabs/models/port.rb +56 -0
  110. data/lib/generated/azure_mgmt_devtestlabs/models/port_fragment.rb +56 -0
  111. data/lib/generated/azure_mgmt_devtestlabs/models/premium_data_disk.rb +16 -0
  112. data/lib/generated/azure_mgmt_devtestlabs/models/reporting_cycle_type.rb +16 -0
  113. data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_arm_template.rb +94 -0
  114. data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_artifact.rb +2 -1
  115. data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_artifact_source.rb +2 -1
  116. data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_custom_image.rb +2 -1
  117. data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_disk.rb +94 -0
  118. data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_dtl_environment.rb +95 -0
  119. data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_formula.rb +2 -1
  120. data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_gallery_image.rb +2 -1
  121. data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_lab.rb +2 -1
  122. data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_lab_vhd.rb +2 -1
  123. data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_lab_virtual_machine.rb +2 -1
  124. data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_notification_channel.rb +96 -0
  125. data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_policy.rb +2 -1
  126. data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_schedule.rb +2 -1
  127. data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_secret.rb +94 -0
  128. data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_service_runner.rb +94 -0
  129. data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_user.rb +94 -0
  130. data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_virtual_network.rb +2 -1
  131. data/lib/generated/azure_mgmt_devtestlabs/models/retarget_schedule_properties.rb +57 -0
  132. data/lib/generated/azure_mgmt_devtestlabs/models/schedule.rb +82 -57
  133. data/lib/generated/azure_mgmt_devtestlabs/models/schedule_fragment.rb +189 -0
  134. data/lib/generated/azure_mgmt_devtestlabs/models/secret.rb +110 -0
  135. data/lib/generated/azure_mgmt_devtestlabs/models/service_runner.rb +91 -0
  136. data/lib/generated/azure_mgmt_devtestlabs/models/shared_public_ip_address_configuration.rb +54 -0
  137. data/lib/generated/azure_mgmt_devtestlabs/models/shared_public_ip_address_configuration_fragment.rb +55 -0
  138. data/lib/generated/azure_mgmt_devtestlabs/models/shutdown_notification_content.rb +147 -0
  139. data/lib/generated/azure_mgmt_devtestlabs/models/source_control_type.rb +1 -1
  140. data/lib/generated/azure_mgmt_devtestlabs/models/{lab_storage_type.rb → storage_type.rb} +3 -3
  141. data/lib/generated/azure_mgmt_devtestlabs/models/subnet.rb +8 -7
  142. data/lib/generated/azure_mgmt_devtestlabs/models/subnet_fragment.rb +67 -0
  143. data/lib/generated/azure_mgmt_devtestlabs/models/subnet_override.rb +29 -6
  144. data/lib/generated/azure_mgmt_devtestlabs/models/subnet_override_fragment.rb +101 -0
  145. data/lib/generated/azure_mgmt_devtestlabs/models/subnet_shared_public_ip_address_configuration.rb +54 -0
  146. data/lib/generated/azure_mgmt_devtestlabs/models/subnet_shared_public_ip_address_configuration_fragment.rb +55 -0
  147. data/lib/generated/azure_mgmt_devtestlabs/models/target_cost_properties.rb +105 -0
  148. data/lib/generated/azure_mgmt_devtestlabs/models/target_cost_status.rb +16 -0
  149. data/lib/generated/azure_mgmt_devtestlabs/models/transport_protocol.rb +16 -0
  150. data/lib/generated/azure_mgmt_devtestlabs/models/usage_permission_type.rb +1 -1
  151. data/lib/generated/azure_mgmt_devtestlabs/models/user.rb +133 -0
  152. data/lib/generated/azure_mgmt_devtestlabs/models/user_fragment.rb +122 -0
  153. data/lib/generated/azure_mgmt_devtestlabs/models/user_identity.rb +91 -0
  154. data/lib/generated/azure_mgmt_devtestlabs/models/user_identity_fragment.rb +91 -0
  155. data/lib/generated/azure_mgmt_devtestlabs/models/user_secret_store.rb +55 -0
  156. data/lib/generated/azure_mgmt_devtestlabs/models/user_secret_store_fragment.rb +55 -0
  157. data/lib/generated/azure_mgmt_devtestlabs/models/virtual_machine_creation_source.rb +16 -0
  158. data/lib/generated/azure_mgmt_devtestlabs/models/virtual_network.rb +77 -59
  159. data/lib/generated/azure_mgmt_devtestlabs/models/virtual_network_fragment.rb +177 -0
  160. data/lib/generated/azure_mgmt_devtestlabs/models/week_details.rb +5 -3
  161. data/lib/generated/azure_mgmt_devtestlabs/models/week_details_fragment.rb +63 -0
  162. data/lib/generated/azure_mgmt_devtestlabs/models/windows_os_info.rb +4 -2
  163. data/lib/generated/azure_mgmt_devtestlabs/models/windows_os_state.rb +1 -1
  164. data/lib/generated/azure_mgmt_devtestlabs/module_definition.rb +1 -1
  165. data/lib/generated/azure_mgmt_devtestlabs/notification_channels.rb +764 -0
  166. data/lib/generated/azure_mgmt_devtestlabs/{policy_operations.rb → policies.rb} +82 -69
  167. data/lib/generated/azure_mgmt_devtestlabs/{policy_set.rb → policy_sets.rb} +18 -16
  168. data/lib/generated/azure_mgmt_devtestlabs/{virtual_machine.rb → schedules.rb} +282 -417
  169. data/lib/generated/azure_mgmt_devtestlabs/secrets.rb +573 -0
  170. data/lib/generated/azure_mgmt_devtestlabs/service_runners.rb +545 -0
  171. data/lib/generated/azure_mgmt_devtestlabs/users.rb +704 -0
  172. data/lib/generated/azure_mgmt_devtestlabs/version.rb +2 -2
  173. data/lib/generated/azure_mgmt_devtestlabs/{schedule_operations.rb → virtual_machine_schedules.rb} +132 -92
  174. data/lib/generated/azure_mgmt_devtestlabs/virtual_machines.rb +1669 -0
  175. data/lib/generated/azure_mgmt_devtestlabs/{virtual_network_operations.rb → virtual_networks.rb} +94 -81
  176. metadata +118 -24
  177. data/lib/generated/azure_mgmt_devtestlabs/cost_operations.rb +0 -121
  178. data/lib/generated/azure_mgmt_devtestlabs/models/subscription_notification.rb +0 -68
  179. data/lib/generated/azure_mgmt_devtestlabs/models/subscription_notification_state.rb +0 -20
@@ -0,0 +1,573 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::ARM::DevTestLabs
7
+ #
8
+ # The DevTest Labs Client.
9
+ #
10
+ class Secrets
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Secrets 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
+ # List secrets in a given user profile.
26
+ #
27
+ # @param resource_group_name [String] The name of the resource group.
28
+ # @param lab_name [String] The name of the lab.
29
+ # @param user_name [String] The name of the user profile.
30
+ # @param expand [String] Specify the $expand query. Example:
31
+ # 'properties($select=value)'
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<Secret>] operation results.
41
+ #
42
+ def list(resource_group_name, lab_name, user_name, expand = nil, filter = nil, top = nil, orderby = nil, custom_headers = nil)
43
+ first_page = list_as_lazy(resource_group_name, lab_name, user_name, expand, filter, top, orderby, custom_headers)
44
+ first_page.get_all_items
45
+ end
46
+
47
+ #
48
+ # List secrets in a given user profile.
49
+ #
50
+ # @param resource_group_name [String] The name of the resource group.
51
+ # @param lab_name [String] The name of the lab.
52
+ # @param user_name [String] The name of the user profile.
53
+ # @param expand [String] Specify the $expand query. Example:
54
+ # 'properties($select=value)'
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_name, user_name, expand = nil, filter = nil, top = nil, orderby = nil, custom_headers = nil)
66
+ list_async(resource_group_name, lab_name, user_name, expand, filter, top, orderby, custom_headers).value!
67
+ end
68
+
69
+ #
70
+ # List secrets in a given user profile.
71
+ #
72
+ # @param resource_group_name [String] The name of the resource group.
73
+ # @param lab_name [String] The name of the lab.
74
+ # @param user_name [String] The name of the user profile.
75
+ # @param expand [String] Specify the $expand query. Example:
76
+ # 'properties($select=value)'
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_name, user_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_name is nil' if lab_name.nil?
91
+ fail ArgumentError, 'user_name is nil' if user_name.nil?
92
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
93
+
94
+
95
+ request_headers = {}
96
+
97
+ # Set Headers
98
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
99
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
100
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/secrets'
101
+
102
+ request_url = @base_url || @client.base_url
103
+
104
+ options = {
105
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
106
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labName' => lab_name,'userName' => user_name},
107
+ query_params: {'$expand' => expand,'$filter' => filter,'$top' => top,'$orderby' => orderby,'api-version' => @client.api_version},
108
+ headers: request_headers.merge(custom_headers || {}),
109
+ base_url: request_url
110
+ }
111
+ promise = @client.make_request_async(:get, path_template, options)
112
+
113
+ promise = promise.then do |result|
114
+ http_response = result.response
115
+ status_code = http_response.status
116
+ response_content = http_response.body
117
+ unless status_code == 200
118
+ error_model = JSON.load(response_content)
119
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
120
+ end
121
+
122
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
123
+ # Deserialize Response
124
+ if status_code == 200
125
+ begin
126
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
127
+ result_mapper = Azure::ARM::DevTestLabs::Models::ResponseWithContinuationSecret.mapper()
128
+ result.body = @client.deserialize(result_mapper, parsed_response)
129
+ rescue Exception => e
130
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
131
+ end
132
+ end
133
+
134
+ result
135
+ end
136
+
137
+ promise.execute
138
+ end
139
+
140
+ #
141
+ # Get secret.
142
+ #
143
+ # @param resource_group_name [String] The name of the resource group.
144
+ # @param lab_name [String] The name of the lab.
145
+ # @param user_name [String] The name of the user profile.
146
+ # @param name [String] The name of the secret.
147
+ # @param expand [String] Specify the $expand query. Example:
148
+ # 'properties($select=value)'
149
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
150
+ # will be added to the HTTP request.
151
+ #
152
+ # @return [Secret] operation results.
153
+ #
154
+ def get(resource_group_name, lab_name, user_name, name, expand = nil, custom_headers = nil)
155
+ response = get_async(resource_group_name, lab_name, user_name, name, expand, custom_headers).value!
156
+ response.body unless response.nil?
157
+ end
158
+
159
+ #
160
+ # Get secret.
161
+ #
162
+ # @param resource_group_name [String] The name of the resource group.
163
+ # @param lab_name [String] The name of the lab.
164
+ # @param user_name [String] The name of the user profile.
165
+ # @param name [String] The name of the secret.
166
+ # @param expand [String] Specify the $expand query. Example:
167
+ # 'properties($select=value)'
168
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
169
+ # will be added to the HTTP request.
170
+ #
171
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
172
+ #
173
+ def get_with_http_info(resource_group_name, lab_name, user_name, name, expand = nil, custom_headers = nil)
174
+ get_async(resource_group_name, lab_name, user_name, name, expand, custom_headers).value!
175
+ end
176
+
177
+ #
178
+ # Get secret.
179
+ #
180
+ # @param resource_group_name [String] The name of the resource group.
181
+ # @param lab_name [String] The name of the lab.
182
+ # @param user_name [String] The name of the user profile.
183
+ # @param name [String] The name of the secret.
184
+ # @param expand [String] Specify the $expand query. Example:
185
+ # 'properties($select=value)'
186
+ # @param [Hash{String => String}] A hash of custom headers that will be added
187
+ # to the HTTP request.
188
+ #
189
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
190
+ #
191
+ def get_async(resource_group_name, lab_name, user_name, name, expand = nil, custom_headers = nil)
192
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
193
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
194
+ fail ArgumentError, 'lab_name is nil' if lab_name.nil?
195
+ fail ArgumentError, 'user_name is nil' if user_name.nil?
196
+ fail ArgumentError, 'name is nil' if name.nil?
197
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
198
+
199
+
200
+ request_headers = {}
201
+
202
+ # Set Headers
203
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
204
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
205
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/secrets/{name}'
206
+
207
+ request_url = @base_url || @client.base_url
208
+
209
+ options = {
210
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
211
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labName' => lab_name,'userName' => user_name,'name' => name},
212
+ query_params: {'$expand' => expand,'api-version' => @client.api_version},
213
+ headers: request_headers.merge(custom_headers || {}),
214
+ base_url: request_url
215
+ }
216
+ promise = @client.make_request_async(:get, path_template, options)
217
+
218
+ promise = promise.then do |result|
219
+ http_response = result.response
220
+ status_code = http_response.status
221
+ response_content = http_response.body
222
+ unless status_code == 200
223
+ error_model = JSON.load(response_content)
224
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
225
+ end
226
+
227
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
228
+ # Deserialize Response
229
+ if status_code == 200
230
+ begin
231
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
232
+ result_mapper = Azure::ARM::DevTestLabs::Models::Secret.mapper()
233
+ result.body = @client.deserialize(result_mapper, parsed_response)
234
+ rescue Exception => e
235
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
236
+ end
237
+ end
238
+
239
+ result
240
+ end
241
+
242
+ promise.execute
243
+ end
244
+
245
+ #
246
+ # Create or replace an existing secret.
247
+ #
248
+ # @param resource_group_name [String] The name of the resource group.
249
+ # @param lab_name [String] The name of the lab.
250
+ # @param user_name [String] The name of the user profile.
251
+ # @param name [String] The name of the secret.
252
+ # @param secret [Secret] A secret.
253
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
254
+ # will be added to the HTTP request.
255
+ #
256
+ # @return [Secret] operation results.
257
+ #
258
+ def create_or_update(resource_group_name, lab_name, user_name, name, secret, custom_headers = nil)
259
+ response = create_or_update_async(resource_group_name, lab_name, user_name, name, secret, custom_headers).value!
260
+ response.body unless response.nil?
261
+ end
262
+
263
+ #
264
+ # Create or replace an existing secret.
265
+ #
266
+ # @param resource_group_name [String] The name of the resource group.
267
+ # @param lab_name [String] The name of the lab.
268
+ # @param user_name [String] The name of the user profile.
269
+ # @param name [String] The name of the secret.
270
+ # @param secret [Secret] A secret.
271
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
272
+ # will be added to the HTTP request.
273
+ #
274
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
275
+ #
276
+ def create_or_update_with_http_info(resource_group_name, lab_name, user_name, name, secret, custom_headers = nil)
277
+ create_or_update_async(resource_group_name, lab_name, user_name, name, secret, custom_headers).value!
278
+ end
279
+
280
+ #
281
+ # Create or replace an existing secret.
282
+ #
283
+ # @param resource_group_name [String] The name of the resource group.
284
+ # @param lab_name [String] The name of the lab.
285
+ # @param user_name [String] The name of the user profile.
286
+ # @param name [String] The name of the secret.
287
+ # @param secret [Secret] A secret.
288
+ # @param [Hash{String => String}] A hash of custom headers that will be added
289
+ # to the HTTP request.
290
+ #
291
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
292
+ #
293
+ def create_or_update_async(resource_group_name, lab_name, user_name, name, secret, custom_headers = nil)
294
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
295
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
296
+ fail ArgumentError, 'lab_name is nil' if lab_name.nil?
297
+ fail ArgumentError, 'user_name is nil' if user_name.nil?
298
+ fail ArgumentError, 'name is nil' if name.nil?
299
+ fail ArgumentError, 'secret is nil' if secret.nil?
300
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
301
+
302
+
303
+ request_headers = {}
304
+
305
+ # Set Headers
306
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
307
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
308
+
309
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
310
+
311
+ # Serialize Request
312
+ request_mapper = Azure::ARM::DevTestLabs::Models::Secret.mapper()
313
+ request_content = @client.serialize(request_mapper, secret)
314
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
315
+
316
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/secrets/{name}'
317
+
318
+ request_url = @base_url || @client.base_url
319
+
320
+ options = {
321
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
322
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labName' => lab_name,'userName' => user_name,'name' => name},
323
+ query_params: {'api-version' => @client.api_version},
324
+ body: request_content,
325
+ headers: request_headers.merge(custom_headers || {}),
326
+ base_url: request_url
327
+ }
328
+ promise = @client.make_request_async(:put, path_template, options)
329
+
330
+ promise = promise.then do |result|
331
+ http_response = result.response
332
+ status_code = http_response.status
333
+ response_content = http_response.body
334
+ unless status_code == 200 || status_code == 201
335
+ error_model = JSON.load(response_content)
336
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
337
+ end
338
+
339
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
340
+ # Deserialize Response
341
+ if status_code == 200
342
+ begin
343
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
344
+ result_mapper = Azure::ARM::DevTestLabs::Models::Secret.mapper()
345
+ result.body = @client.deserialize(result_mapper, parsed_response)
346
+ rescue Exception => e
347
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
348
+ end
349
+ end
350
+ # Deserialize Response
351
+ if status_code == 201
352
+ begin
353
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
354
+ result_mapper = Azure::ARM::DevTestLabs::Models::Secret.mapper()
355
+ result.body = @client.deserialize(result_mapper, parsed_response)
356
+ rescue Exception => e
357
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
358
+ end
359
+ end
360
+
361
+ result
362
+ end
363
+
364
+ promise.execute
365
+ end
366
+
367
+ #
368
+ # Delete secret.
369
+ #
370
+ # @param resource_group_name [String] The name of the resource group.
371
+ # @param lab_name [String] The name of the lab.
372
+ # @param user_name [String] The name of the user profile.
373
+ # @param name [String] The name of the secret.
374
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
375
+ # will be added to the HTTP request.
376
+ #
377
+ #
378
+ def delete(resource_group_name, lab_name, user_name, name, custom_headers = nil)
379
+ response = delete_async(resource_group_name, lab_name, user_name, name, custom_headers).value!
380
+ nil
381
+ end
382
+
383
+ #
384
+ # Delete secret.
385
+ #
386
+ # @param resource_group_name [String] The name of the resource group.
387
+ # @param lab_name [String] The name of the lab.
388
+ # @param user_name [String] The name of the user profile.
389
+ # @param name [String] The name of the secret.
390
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
391
+ # will be added to the HTTP request.
392
+ #
393
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
394
+ #
395
+ def delete_with_http_info(resource_group_name, lab_name, user_name, name, custom_headers = nil)
396
+ delete_async(resource_group_name, lab_name, user_name, name, custom_headers).value!
397
+ end
398
+
399
+ #
400
+ # Delete secret.
401
+ #
402
+ # @param resource_group_name [String] The name of the resource group.
403
+ # @param lab_name [String] The name of the lab.
404
+ # @param user_name [String] The name of the user profile.
405
+ # @param name [String] The name of the secret.
406
+ # @param [Hash{String => String}] A hash of custom headers that will be added
407
+ # to the HTTP request.
408
+ #
409
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
410
+ #
411
+ def delete_async(resource_group_name, lab_name, user_name, name, custom_headers = nil)
412
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
413
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
414
+ fail ArgumentError, 'lab_name is nil' if lab_name.nil?
415
+ fail ArgumentError, 'user_name is nil' if user_name.nil?
416
+ fail ArgumentError, 'name is nil' if name.nil?
417
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
418
+
419
+
420
+ request_headers = {}
421
+
422
+ # Set Headers
423
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
424
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
425
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/secrets/{name}'
426
+
427
+ request_url = @base_url || @client.base_url
428
+
429
+ options = {
430
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
431
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labName' => lab_name,'userName' => user_name,'name' => name},
432
+ query_params: {'api-version' => @client.api_version},
433
+ headers: request_headers.merge(custom_headers || {}),
434
+ base_url: request_url
435
+ }
436
+ promise = @client.make_request_async(:delete, path_template, options)
437
+
438
+ promise = promise.then do |result|
439
+ http_response = result.response
440
+ status_code = http_response.status
441
+ response_content = http_response.body
442
+ unless status_code == 200 || status_code == 204
443
+ error_model = JSON.load(response_content)
444
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
445
+ end
446
+
447
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
448
+
449
+ result
450
+ end
451
+
452
+ promise.execute
453
+ end
454
+
455
+ #
456
+ # List secrets in a given user profile.
457
+ #
458
+ # @param next_page_link [String] The NextLink from the previous successful call
459
+ # to List operation.
460
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
461
+ # will be added to the HTTP request.
462
+ #
463
+ # @return [ResponseWithContinuationSecret] operation results.
464
+ #
465
+ def list_next(next_page_link, custom_headers = nil)
466
+ response = list_next_async(next_page_link, custom_headers).value!
467
+ response.body unless response.nil?
468
+ end
469
+
470
+ #
471
+ # List secrets in a given user profile.
472
+ #
473
+ # @param next_page_link [String] The NextLink from the previous successful call
474
+ # to List operation.
475
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
476
+ # will be added to the HTTP request.
477
+ #
478
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
479
+ #
480
+ def list_next_with_http_info(next_page_link, custom_headers = nil)
481
+ list_next_async(next_page_link, custom_headers).value!
482
+ end
483
+
484
+ #
485
+ # List secrets in a given user profile.
486
+ #
487
+ # @param next_page_link [String] The NextLink from the previous successful call
488
+ # to List operation.
489
+ # @param [Hash{String => String}] A hash of custom headers that will be added
490
+ # to the HTTP request.
491
+ #
492
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
493
+ #
494
+ def list_next_async(next_page_link, custom_headers = nil)
495
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
496
+
497
+
498
+ request_headers = {}
499
+
500
+ # Set Headers
501
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
502
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
503
+ path_template = '{nextLink}'
504
+
505
+ request_url = @base_url || @client.base_url
506
+
507
+ options = {
508
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
509
+ skip_encoding_path_params: {'nextLink' => next_page_link},
510
+ headers: request_headers.merge(custom_headers || {}),
511
+ base_url: request_url
512
+ }
513
+ promise = @client.make_request_async(:get, path_template, options)
514
+
515
+ promise = promise.then do |result|
516
+ http_response = result.response
517
+ status_code = http_response.status
518
+ response_content = http_response.body
519
+ unless status_code == 200
520
+ error_model = JSON.load(response_content)
521
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
522
+ end
523
+
524
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
525
+ # Deserialize Response
526
+ if status_code == 200
527
+ begin
528
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
529
+ result_mapper = Azure::ARM::DevTestLabs::Models::ResponseWithContinuationSecret.mapper()
530
+ result.body = @client.deserialize(result_mapper, parsed_response)
531
+ rescue Exception => e
532
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
533
+ end
534
+ end
535
+
536
+ result
537
+ end
538
+
539
+ promise.execute
540
+ end
541
+
542
+ #
543
+ # List secrets in a given user profile.
544
+ #
545
+ # @param resource_group_name [String] The name of the resource group.
546
+ # @param lab_name [String] The name of the lab.
547
+ # @param user_name [String] The name of the user profile.
548
+ # @param expand [String] Specify the $expand query. Example:
549
+ # 'properties($select=value)'
550
+ # @param filter [String] The filter to apply to the operation.
551
+ # @param top [Integer] The maximum number of resources to return from the
552
+ # operation.
553
+ # @param orderby [String] The ordering expression for the results, using OData
554
+ # notation.
555
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
556
+ # will be added to the HTTP request.
557
+ #
558
+ # @return [ResponseWithContinuationSecret] which provide lazy access to pages
559
+ # of the response.
560
+ #
561
+ def list_as_lazy(resource_group_name, lab_name, user_name, expand = nil, filter = nil, top = nil, orderby = nil, custom_headers = nil)
562
+ response = list_async(resource_group_name, lab_name, user_name, expand, filter, top, orderby, custom_headers).value!
563
+ unless response.nil?
564
+ page = response.body
565
+ page.next_method = Proc.new do |next_page_link|
566
+ list_next_async(next_page_link, custom_headers)
567
+ end
568
+ page
569
+ end
570
+ end
571
+
572
+ end
573
+ end