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
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
@@ -12,10 +12,12 @@ module Azure::ARM::DevTestLabs
12
12
 
13
13
  include MsRestAzure
14
14
 
15
- # @return [Array<String>] The days of the week.
15
+ include MsRest::JSONable
16
+ # @return [Array<String>] The days of the week for which the schedule is
17
+ # set (e.g. Sunday, Monday, Tuesday, etc.).
16
18
  attr_accessor :weekdays
17
19
 
18
- # @return [String] The time of the day.
20
+ # @return [String] The time of the day the schedule will occur.
19
21
  attr_accessor :time
20
22
 
21
23
 
@@ -0,0 +1,63 @@
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
+ module Models
8
+ #
9
+ # Properties of a weekly schedule.
10
+ #
11
+ class WeekDetailsFragment
12
+
13
+ include MsRestAzure
14
+
15
+ include MsRest::JSONable
16
+ # @return [Array<String>] The days of the week for which the schedule is
17
+ # set (e.g. Sunday, Monday, Tuesday, etc.).
18
+ attr_accessor :weekdays
19
+
20
+ # @return [String] The time of the day the schedule will occur.
21
+ attr_accessor :time
22
+
23
+
24
+ #
25
+ # Mapper for WeekDetailsFragment class as Ruby Hash.
26
+ # This will be used for serialization/deserialization.
27
+ #
28
+ def self.mapper()
29
+ {
30
+ required: false,
31
+ serialized_name: 'WeekDetailsFragment',
32
+ type: {
33
+ name: 'Composite',
34
+ class_name: 'WeekDetailsFragment',
35
+ model_properties: {
36
+ weekdays: {
37
+ required: false,
38
+ serialized_name: 'weekdays',
39
+ type: {
40
+ name: 'Sequence',
41
+ element: {
42
+ required: false,
43
+ serialized_name: 'StringElementType',
44
+ type: {
45
+ name: 'String'
46
+ }
47
+ }
48
+ }
49
+ },
50
+ time: {
51
+ required: false,
52
+ serialized_name: 'time',
53
+ type: {
54
+ name: 'String'
55
+ }
56
+ }
57
+ }
58
+ }
59
+ }
60
+ end
61
+ end
62
+ end
63
+ end
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
@@ -12,7 +12,9 @@ module Azure::ARM::DevTestLabs
12
12
 
13
13
  include MsRestAzure
14
14
 
15
- # @return [WindowsOsState] The state of the Windows OS. Possible values
15
+ include MsRest::JSONable
16
+ # @return [WindowsOsState] The state of the Windows OS (i.e.
17
+ # NonSysprepped, SysprepRequested, SysprepApplied). Possible values
16
18
  # include: 'NonSysprepped', 'SysprepRequested', 'SysprepApplied'
17
19
  attr_accessor :windows_os_state
18
20
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
@@ -0,0 +1,764 @@
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 NotificationChannels
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the NotificationChannels 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 notificationchannels in a given lab.
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 expand [String] Specify the $expand query. Example:
30
+ # 'properties($select=webHookUrl)'
31
+ # @param filter [String] The filter to apply to the operation.
32
+ # @param top [Integer] The maximum number of resources to return from the
33
+ # operation.
34
+ # @param orderby [String] The ordering expression for the results, using OData
35
+ # notation.
36
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
37
+ # will be added to the HTTP request.
38
+ #
39
+ # @return [Array<NotificationChannel>] operation results.
40
+ #
41
+ def list(resource_group_name, lab_name, expand = nil, filter = nil, top = nil, orderby = nil, custom_headers = nil)
42
+ first_page = list_as_lazy(resource_group_name, lab_name, expand, filter, top, orderby, custom_headers)
43
+ first_page.get_all_items
44
+ end
45
+
46
+ #
47
+ # List notificationchannels in a given lab.
48
+ #
49
+ # @param resource_group_name [String] The name of the resource group.
50
+ # @param lab_name [String] The name of the lab.
51
+ # @param expand [String] Specify the $expand query. Example:
52
+ # 'properties($select=webHookUrl)'
53
+ # @param filter [String] The filter to apply to the operation.
54
+ # @param top [Integer] The maximum number of resources to return from the
55
+ # operation.
56
+ # @param orderby [String] The ordering expression for the results, using OData
57
+ # notation.
58
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
59
+ # will be added to the HTTP request.
60
+ #
61
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
62
+ #
63
+ def list_with_http_info(resource_group_name, lab_name, expand = nil, filter = nil, top = nil, orderby = nil, custom_headers = nil)
64
+ list_async(resource_group_name, lab_name, expand, filter, top, orderby, custom_headers).value!
65
+ end
66
+
67
+ #
68
+ # List notificationchannels in a given lab.
69
+ #
70
+ # @param resource_group_name [String] The name of the resource group.
71
+ # @param lab_name [String] The name of the lab.
72
+ # @param expand [String] Specify the $expand query. Example:
73
+ # 'properties($select=webHookUrl)'
74
+ # @param filter [String] The filter to apply to the operation.
75
+ # @param top [Integer] The maximum number of resources to return from the
76
+ # operation.
77
+ # @param orderby [String] The ordering expression for the results, using OData
78
+ # notation.
79
+ # @param [Hash{String => String}] A hash of custom headers that will be added
80
+ # to the HTTP request.
81
+ #
82
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
83
+ #
84
+ def list_async(resource_group_name, lab_name, expand = nil, filter = nil, top = nil, orderby = nil, custom_headers = nil)
85
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
86
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
87
+ fail ArgumentError, 'lab_name is nil' if lab_name.nil?
88
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
89
+
90
+
91
+ request_headers = {}
92
+
93
+ # Set Headers
94
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
95
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
96
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/notificationchannels'
97
+
98
+ request_url = @base_url || @client.base_url
99
+
100
+ options = {
101
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
102
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labName' => lab_name},
103
+ query_params: {'$expand' => expand,'$filter' => filter,'$top' => top,'$orderby' => orderby,'api-version' => @client.api_version},
104
+ headers: request_headers.merge(custom_headers || {}),
105
+ base_url: request_url
106
+ }
107
+ promise = @client.make_request_async(:get, path_template, options)
108
+
109
+ promise = promise.then do |result|
110
+ http_response = result.response
111
+ status_code = http_response.status
112
+ response_content = http_response.body
113
+ unless status_code == 200
114
+ error_model = JSON.load(response_content)
115
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
116
+ end
117
+
118
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
119
+ # Deserialize Response
120
+ if status_code == 200
121
+ begin
122
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
123
+ result_mapper = Azure::ARM::DevTestLabs::Models::ResponseWithContinuationNotificationChannel.mapper()
124
+ result.body = @client.deserialize(result_mapper, parsed_response)
125
+ rescue Exception => e
126
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
127
+ end
128
+ end
129
+
130
+ result
131
+ end
132
+
133
+ promise.execute
134
+ end
135
+
136
+ #
137
+ # Get notificationchannel.
138
+ #
139
+ # @param resource_group_name [String] The name of the resource group.
140
+ # @param lab_name [String] The name of the lab.
141
+ # @param name [String] The name of the notificationChannel.
142
+ # @param expand [String] Specify the $expand query. Example:
143
+ # 'properties($select=webHookUrl)'
144
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
145
+ # will be added to the HTTP request.
146
+ #
147
+ # @return [NotificationChannel] operation results.
148
+ #
149
+ def get(resource_group_name, lab_name, name, expand = nil, custom_headers = nil)
150
+ response = get_async(resource_group_name, lab_name, name, expand, custom_headers).value!
151
+ response.body unless response.nil?
152
+ end
153
+
154
+ #
155
+ # Get notificationchannel.
156
+ #
157
+ # @param resource_group_name [String] The name of the resource group.
158
+ # @param lab_name [String] The name of the lab.
159
+ # @param name [String] The name of the notificationChannel.
160
+ # @param expand [String] Specify the $expand query. Example:
161
+ # 'properties($select=webHookUrl)'
162
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
163
+ # will be added to the HTTP request.
164
+ #
165
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
166
+ #
167
+ def get_with_http_info(resource_group_name, lab_name, name, expand = nil, custom_headers = nil)
168
+ get_async(resource_group_name, lab_name, name, expand, custom_headers).value!
169
+ end
170
+
171
+ #
172
+ # Get notificationchannel.
173
+ #
174
+ # @param resource_group_name [String] The name of the resource group.
175
+ # @param lab_name [String] The name of the lab.
176
+ # @param name [String] The name of the notificationChannel.
177
+ # @param expand [String] Specify the $expand query. Example:
178
+ # 'properties($select=webHookUrl)'
179
+ # @param [Hash{String => String}] A hash of custom headers that will be added
180
+ # to the HTTP request.
181
+ #
182
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
183
+ #
184
+ def get_async(resource_group_name, lab_name, name, expand = nil, custom_headers = nil)
185
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
186
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
187
+ fail ArgumentError, 'lab_name is nil' if lab_name.nil?
188
+ fail ArgumentError, 'name is nil' if name.nil?
189
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
190
+
191
+
192
+ request_headers = {}
193
+
194
+ # Set Headers
195
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
196
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
197
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/notificationchannels/{name}'
198
+
199
+ request_url = @base_url || @client.base_url
200
+
201
+ options = {
202
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
203
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labName' => lab_name,'name' => name},
204
+ query_params: {'$expand' => expand,'api-version' => @client.api_version},
205
+ headers: request_headers.merge(custom_headers || {}),
206
+ base_url: request_url
207
+ }
208
+ promise = @client.make_request_async(:get, path_template, options)
209
+
210
+ promise = promise.then do |result|
211
+ http_response = result.response
212
+ status_code = http_response.status
213
+ response_content = http_response.body
214
+ unless status_code == 200
215
+ error_model = JSON.load(response_content)
216
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
217
+ end
218
+
219
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
220
+ # Deserialize Response
221
+ if status_code == 200
222
+ begin
223
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
224
+ result_mapper = Azure::ARM::DevTestLabs::Models::NotificationChannel.mapper()
225
+ result.body = @client.deserialize(result_mapper, parsed_response)
226
+ rescue Exception => e
227
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
228
+ end
229
+ end
230
+
231
+ result
232
+ end
233
+
234
+ promise.execute
235
+ end
236
+
237
+ #
238
+ # Create or replace an existing notificationChannel.
239
+ #
240
+ # @param resource_group_name [String] The name of the resource group.
241
+ # @param lab_name [String] The name of the lab.
242
+ # @param name [String] The name of the notificationChannel.
243
+ # @param notification_channel [NotificationChannel] A notification.
244
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
245
+ # will be added to the HTTP request.
246
+ #
247
+ # @return [NotificationChannel] operation results.
248
+ #
249
+ def create_or_update(resource_group_name, lab_name, name, notification_channel, custom_headers = nil)
250
+ response = create_or_update_async(resource_group_name, lab_name, name, notification_channel, custom_headers).value!
251
+ response.body unless response.nil?
252
+ end
253
+
254
+ #
255
+ # Create or replace an existing notificationChannel.
256
+ #
257
+ # @param resource_group_name [String] The name of the resource group.
258
+ # @param lab_name [String] The name of the lab.
259
+ # @param name [String] The name of the notificationChannel.
260
+ # @param notification_channel [NotificationChannel] A notification.
261
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
262
+ # will be added to the HTTP request.
263
+ #
264
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
265
+ #
266
+ def create_or_update_with_http_info(resource_group_name, lab_name, name, notification_channel, custom_headers = nil)
267
+ create_or_update_async(resource_group_name, lab_name, name, notification_channel, custom_headers).value!
268
+ end
269
+
270
+ #
271
+ # Create or replace an existing notificationChannel.
272
+ #
273
+ # @param resource_group_name [String] The name of the resource group.
274
+ # @param lab_name [String] The name of the lab.
275
+ # @param name [String] The name of the notificationChannel.
276
+ # @param notification_channel [NotificationChannel] A notification.
277
+ # @param [Hash{String => String}] A hash of custom headers that will be added
278
+ # to the HTTP request.
279
+ #
280
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
281
+ #
282
+ def create_or_update_async(resource_group_name, lab_name, name, notification_channel, custom_headers = nil)
283
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
284
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
285
+ fail ArgumentError, 'lab_name is nil' if lab_name.nil?
286
+ fail ArgumentError, 'name is nil' if name.nil?
287
+ fail ArgumentError, 'notification_channel is nil' if notification_channel.nil?
288
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
289
+
290
+
291
+ request_headers = {}
292
+
293
+ # Set Headers
294
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
295
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
296
+
297
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
298
+
299
+ # Serialize Request
300
+ request_mapper = Azure::ARM::DevTestLabs::Models::NotificationChannel.mapper()
301
+ request_content = @client.serialize(request_mapper, notification_channel)
302
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
303
+
304
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/notificationchannels/{name}'
305
+
306
+ request_url = @base_url || @client.base_url
307
+
308
+ options = {
309
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
310
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labName' => lab_name,'name' => name},
311
+ query_params: {'api-version' => @client.api_version},
312
+ body: request_content,
313
+ headers: request_headers.merge(custom_headers || {}),
314
+ base_url: request_url
315
+ }
316
+ promise = @client.make_request_async(:put, path_template, options)
317
+
318
+ promise = promise.then do |result|
319
+ http_response = result.response
320
+ status_code = http_response.status
321
+ response_content = http_response.body
322
+ unless status_code == 200 || status_code == 201
323
+ error_model = JSON.load(response_content)
324
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
325
+ end
326
+
327
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
328
+ # Deserialize Response
329
+ if status_code == 200
330
+ begin
331
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
332
+ result_mapper = Azure::ARM::DevTestLabs::Models::NotificationChannel.mapper()
333
+ result.body = @client.deserialize(result_mapper, parsed_response)
334
+ rescue Exception => e
335
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
336
+ end
337
+ end
338
+ # Deserialize Response
339
+ if status_code == 201
340
+ begin
341
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
342
+ result_mapper = Azure::ARM::DevTestLabs::Models::NotificationChannel.mapper()
343
+ result.body = @client.deserialize(result_mapper, parsed_response)
344
+ rescue Exception => e
345
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
346
+ end
347
+ end
348
+
349
+ result
350
+ end
351
+
352
+ promise.execute
353
+ end
354
+
355
+ #
356
+ # Delete notificationchannel.
357
+ #
358
+ # @param resource_group_name [String] The name of the resource group.
359
+ # @param lab_name [String] The name of the lab.
360
+ # @param name [String] The name of the notificationChannel.
361
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
362
+ # will be added to the HTTP request.
363
+ #
364
+ #
365
+ def delete(resource_group_name, lab_name, name, custom_headers = nil)
366
+ response = delete_async(resource_group_name, lab_name, name, custom_headers).value!
367
+ nil
368
+ end
369
+
370
+ #
371
+ # Delete notificationchannel.
372
+ #
373
+ # @param resource_group_name [String] The name of the resource group.
374
+ # @param lab_name [String] The name of the lab.
375
+ # @param name [String] The name of the notificationChannel.
376
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
377
+ # will be added to the HTTP request.
378
+ #
379
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
380
+ #
381
+ def delete_with_http_info(resource_group_name, lab_name, name, custom_headers = nil)
382
+ delete_async(resource_group_name, lab_name, name, custom_headers).value!
383
+ end
384
+
385
+ #
386
+ # Delete notificationchannel.
387
+ #
388
+ # @param resource_group_name [String] The name of the resource group.
389
+ # @param lab_name [String] The name of the lab.
390
+ # @param name [String] The name of the notificationChannel.
391
+ # @param [Hash{String => String}] A hash of custom headers that will be added
392
+ # to the HTTP request.
393
+ #
394
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
395
+ #
396
+ def delete_async(resource_group_name, lab_name, name, custom_headers = nil)
397
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
398
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
399
+ fail ArgumentError, 'lab_name is nil' if lab_name.nil?
400
+ fail ArgumentError, 'name is nil' if name.nil?
401
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
402
+
403
+
404
+ request_headers = {}
405
+
406
+ # Set Headers
407
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
408
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
409
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/notificationchannels/{name}'
410
+
411
+ request_url = @base_url || @client.base_url
412
+
413
+ options = {
414
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
415
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labName' => lab_name,'name' => name},
416
+ query_params: {'api-version' => @client.api_version},
417
+ headers: request_headers.merge(custom_headers || {}),
418
+ base_url: request_url
419
+ }
420
+ promise = @client.make_request_async(:delete, path_template, options)
421
+
422
+ promise = promise.then do |result|
423
+ http_response = result.response
424
+ status_code = http_response.status
425
+ response_content = http_response.body
426
+ unless status_code == 200 || status_code == 204
427
+ error_model = JSON.load(response_content)
428
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
429
+ end
430
+
431
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
432
+
433
+ result
434
+ end
435
+
436
+ promise.execute
437
+ end
438
+
439
+ #
440
+ # Modify properties of notificationchannels.
441
+ #
442
+ # @param resource_group_name [String] The name of the resource group.
443
+ # @param lab_name [String] The name of the lab.
444
+ # @param name [String] The name of the notificationChannel.
445
+ # @param notification_channel [NotificationChannelFragment] A notification.
446
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
447
+ # will be added to the HTTP request.
448
+ #
449
+ # @return [NotificationChannel] operation results.
450
+ #
451
+ def update(resource_group_name, lab_name, name, notification_channel, custom_headers = nil)
452
+ response = update_async(resource_group_name, lab_name, name, notification_channel, custom_headers).value!
453
+ response.body unless response.nil?
454
+ end
455
+
456
+ #
457
+ # Modify properties of notificationchannels.
458
+ #
459
+ # @param resource_group_name [String] The name of the resource group.
460
+ # @param lab_name [String] The name of the lab.
461
+ # @param name [String] The name of the notificationChannel.
462
+ # @param notification_channel [NotificationChannelFragment] A notification.
463
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
464
+ # will be added to the HTTP request.
465
+ #
466
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
467
+ #
468
+ def update_with_http_info(resource_group_name, lab_name, name, notification_channel, custom_headers = nil)
469
+ update_async(resource_group_name, lab_name, name, notification_channel, custom_headers).value!
470
+ end
471
+
472
+ #
473
+ # Modify properties of notificationchannels.
474
+ #
475
+ # @param resource_group_name [String] The name of the resource group.
476
+ # @param lab_name [String] The name of the lab.
477
+ # @param name [String] The name of the notificationChannel.
478
+ # @param notification_channel [NotificationChannelFragment] A notification.
479
+ # @param [Hash{String => String}] A hash of custom headers that will be added
480
+ # to the HTTP request.
481
+ #
482
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
483
+ #
484
+ def update_async(resource_group_name, lab_name, name, notification_channel, custom_headers = nil)
485
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
486
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
487
+ fail ArgumentError, 'lab_name is nil' if lab_name.nil?
488
+ fail ArgumentError, 'name is nil' if name.nil?
489
+ fail ArgumentError, 'notification_channel is nil' if notification_channel.nil?
490
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
491
+
492
+
493
+ request_headers = {}
494
+
495
+ # Set Headers
496
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
497
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
498
+
499
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
500
+
501
+ # Serialize Request
502
+ request_mapper = Azure::ARM::DevTestLabs::Models::NotificationChannelFragment.mapper()
503
+ request_content = @client.serialize(request_mapper, notification_channel)
504
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
505
+
506
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/notificationchannels/{name}'
507
+
508
+ request_url = @base_url || @client.base_url
509
+
510
+ options = {
511
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
512
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labName' => lab_name,'name' => name},
513
+ query_params: {'api-version' => @client.api_version},
514
+ body: request_content,
515
+ headers: request_headers.merge(custom_headers || {}),
516
+ base_url: request_url
517
+ }
518
+ promise = @client.make_request_async(:patch, path_template, options)
519
+
520
+ promise = promise.then do |result|
521
+ http_response = result.response
522
+ status_code = http_response.status
523
+ response_content = http_response.body
524
+ unless status_code == 200
525
+ error_model = JSON.load(response_content)
526
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
527
+ end
528
+
529
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
530
+ # Deserialize Response
531
+ if status_code == 200
532
+ begin
533
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
534
+ result_mapper = Azure::ARM::DevTestLabs::Models::NotificationChannel.mapper()
535
+ result.body = @client.deserialize(result_mapper, parsed_response)
536
+ rescue Exception => e
537
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
538
+ end
539
+ end
540
+
541
+ result
542
+ end
543
+
544
+ promise.execute
545
+ end
546
+
547
+ #
548
+ # Send notification to provided channel.
549
+ #
550
+ # @param resource_group_name [String] The name of the resource group.
551
+ # @param lab_name [String] The name of the lab.
552
+ # @param name [String] The name of the notificationChannel.
553
+ # @param notify_parameters [NotifyParameters] Properties for generating a
554
+ # Notification.
555
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
556
+ # will be added to the HTTP request.
557
+ #
558
+ #
559
+ def notify(resource_group_name, lab_name, name, notify_parameters, custom_headers = nil)
560
+ response = notify_async(resource_group_name, lab_name, name, notify_parameters, custom_headers).value!
561
+ nil
562
+ end
563
+
564
+ #
565
+ # Send notification to provided channel.
566
+ #
567
+ # @param resource_group_name [String] The name of the resource group.
568
+ # @param lab_name [String] The name of the lab.
569
+ # @param name [String] The name of the notificationChannel.
570
+ # @param notify_parameters [NotifyParameters] Properties for generating a
571
+ # Notification.
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 notify_with_http_info(resource_group_name, lab_name, name, notify_parameters, custom_headers = nil)
578
+ notify_async(resource_group_name, lab_name, name, notify_parameters, custom_headers).value!
579
+ end
580
+
581
+ #
582
+ # Send notification to provided channel.
583
+ #
584
+ # @param resource_group_name [String] The name of the resource group.
585
+ # @param lab_name [String] The name of the lab.
586
+ # @param name [String] The name of the notificationChannel.
587
+ # @param notify_parameters [NotifyParameters] Properties for generating a
588
+ # Notification.
589
+ # @param [Hash{String => String}] A hash of custom headers that will be added
590
+ # to the HTTP request.
591
+ #
592
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
593
+ #
594
+ def notify_async(resource_group_name, lab_name, name, notify_parameters, custom_headers = nil)
595
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
596
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
597
+ fail ArgumentError, 'lab_name is nil' if lab_name.nil?
598
+ fail ArgumentError, 'name is nil' if name.nil?
599
+ fail ArgumentError, 'notify_parameters is nil' if notify_parameters.nil?
600
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
601
+
602
+
603
+ request_headers = {}
604
+
605
+ # Set Headers
606
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
607
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
608
+
609
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
610
+
611
+ # Serialize Request
612
+ request_mapper = Azure::ARM::DevTestLabs::Models::NotifyParameters.mapper()
613
+ request_content = @client.serialize(request_mapper, notify_parameters)
614
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
615
+
616
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/notificationchannels/{name}/notify'
617
+
618
+ request_url = @base_url || @client.base_url
619
+
620
+ options = {
621
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
622
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labName' => lab_name,'name' => name},
623
+ query_params: {'api-version' => @client.api_version},
624
+ body: request_content,
625
+ headers: request_headers.merge(custom_headers || {}),
626
+ base_url: request_url
627
+ }
628
+ promise = @client.make_request_async(:post, path_template, options)
629
+
630
+ promise = promise.then do |result|
631
+ http_response = result.response
632
+ status_code = http_response.status
633
+ response_content = http_response.body
634
+ unless status_code == 200
635
+ error_model = JSON.load(response_content)
636
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
637
+ end
638
+
639
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
640
+
641
+ result
642
+ end
643
+
644
+ promise.execute
645
+ end
646
+
647
+ #
648
+ # List notificationchannels in a given lab.
649
+ #
650
+ # @param next_page_link [String] The NextLink from the previous successful call
651
+ # to List operation.
652
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
653
+ # will be added to the HTTP request.
654
+ #
655
+ # @return [ResponseWithContinuationNotificationChannel] operation results.
656
+ #
657
+ def list_next(next_page_link, custom_headers = nil)
658
+ response = list_next_async(next_page_link, custom_headers).value!
659
+ response.body unless response.nil?
660
+ end
661
+
662
+ #
663
+ # List notificationchannels in a given lab.
664
+ #
665
+ # @param next_page_link [String] The NextLink from the previous successful call
666
+ # to List operation.
667
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
668
+ # will be added to the HTTP request.
669
+ #
670
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
671
+ #
672
+ def list_next_with_http_info(next_page_link, custom_headers = nil)
673
+ list_next_async(next_page_link, custom_headers).value!
674
+ end
675
+
676
+ #
677
+ # List notificationchannels in a given lab.
678
+ #
679
+ # @param next_page_link [String] The NextLink from the previous successful call
680
+ # to List operation.
681
+ # @param [Hash{String => String}] A hash of custom headers that will be added
682
+ # to the HTTP request.
683
+ #
684
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
685
+ #
686
+ def list_next_async(next_page_link, custom_headers = nil)
687
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
688
+
689
+
690
+ request_headers = {}
691
+
692
+ # Set Headers
693
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
694
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
695
+ path_template = '{nextLink}'
696
+
697
+ request_url = @base_url || @client.base_url
698
+
699
+ options = {
700
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
701
+ skip_encoding_path_params: {'nextLink' => next_page_link},
702
+ headers: request_headers.merge(custom_headers || {}),
703
+ base_url: request_url
704
+ }
705
+ promise = @client.make_request_async(:get, path_template, options)
706
+
707
+ promise = promise.then do |result|
708
+ http_response = result.response
709
+ status_code = http_response.status
710
+ response_content = http_response.body
711
+ unless status_code == 200
712
+ error_model = JSON.load(response_content)
713
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
714
+ end
715
+
716
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
717
+ # Deserialize Response
718
+ if status_code == 200
719
+ begin
720
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
721
+ result_mapper = Azure::ARM::DevTestLabs::Models::ResponseWithContinuationNotificationChannel.mapper()
722
+ result.body = @client.deserialize(result_mapper, parsed_response)
723
+ rescue Exception => e
724
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
725
+ end
726
+ end
727
+
728
+ result
729
+ end
730
+
731
+ promise.execute
732
+ end
733
+
734
+ #
735
+ # List notificationchannels in a given lab.
736
+ #
737
+ # @param resource_group_name [String] The name of the resource group.
738
+ # @param lab_name [String] The name of the lab.
739
+ # @param expand [String] Specify the $expand query. Example:
740
+ # 'properties($select=webHookUrl)'
741
+ # @param filter [String] The filter to apply to the operation.
742
+ # @param top [Integer] The maximum number of resources to return from the
743
+ # operation.
744
+ # @param orderby [String] The ordering expression for the results, using OData
745
+ # notation.
746
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
747
+ # will be added to the HTTP request.
748
+ #
749
+ # @return [ResponseWithContinuationNotificationChannel] which provide lazy
750
+ # access to pages of the response.
751
+ #
752
+ def list_as_lazy(resource_group_name, lab_name, expand = nil, filter = nil, top = nil, orderby = nil, custom_headers = nil)
753
+ response = list_async(resource_group_name, lab_name, expand, filter, top, orderby, custom_headers).value!
754
+ unless response.nil?
755
+ page = response.body
756
+ page.next_method = Proc.new do |next_page_link|
757
+ list_next_async(next_page_link, custom_headers)
758
+ end
759
+ page
760
+ end
761
+ end
762
+
763
+ end
764
+ end