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,1121 @@
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 GlobalSchedules
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the GlobalSchedules 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 schedules in a subscription.
26
+ #
27
+ # @param expand [String] Specify the $expand query. Example:
28
+ # 'properties($select=status)'
29
+ # @param filter [String] The filter to apply to the operation.
30
+ # @param top [Integer] The maximum number of resources to return from the
31
+ # operation.
32
+ # @param orderby [String] The ordering expression for the results, using OData
33
+ # notation.
34
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
35
+ # will be added to the HTTP request.
36
+ #
37
+ # @return [Array<Schedule>] operation results.
38
+ #
39
+ def list_by_subscription(expand = nil, filter = nil, top = nil, orderby = nil, custom_headers = nil)
40
+ first_page = list_by_subscription_as_lazy(expand, filter, top, orderby, custom_headers)
41
+ first_page.get_all_items
42
+ end
43
+
44
+ #
45
+ # List schedules in a subscription.
46
+ #
47
+ # @param expand [String] Specify the $expand query. Example:
48
+ # 'properties($select=status)'
49
+ # @param filter [String] The filter to apply to the operation.
50
+ # @param top [Integer] The maximum number of resources to return from the
51
+ # operation.
52
+ # @param orderby [String] The ordering expression for the results, using OData
53
+ # notation.
54
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
55
+ # will be added to the HTTP request.
56
+ #
57
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
58
+ #
59
+ def list_by_subscription_with_http_info(expand = nil, filter = nil, top = nil, orderby = nil, custom_headers = nil)
60
+ list_by_subscription_async(expand, filter, top, orderby, custom_headers).value!
61
+ end
62
+
63
+ #
64
+ # List schedules in a subscription.
65
+ #
66
+ # @param expand [String] Specify the $expand query. Example:
67
+ # 'properties($select=status)'
68
+ # @param filter [String] The filter to apply to the operation.
69
+ # @param top [Integer] The maximum number of resources to return from the
70
+ # operation.
71
+ # @param orderby [String] The ordering expression for the results, using OData
72
+ # notation.
73
+ # @param [Hash{String => String}] A hash of custom headers that will be added
74
+ # to the HTTP request.
75
+ #
76
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
77
+ #
78
+ def list_by_subscription_async(expand = nil, filter = nil, top = nil, orderby = nil, custom_headers = nil)
79
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
80
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
81
+
82
+
83
+ request_headers = {}
84
+
85
+ # Set Headers
86
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
87
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
88
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.DevTestLab/schedules'
89
+
90
+ request_url = @base_url || @client.base_url
91
+
92
+ options = {
93
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
94
+ path_params: {'subscriptionId' => @client.subscription_id},
95
+ query_params: {'$expand' => expand,'$filter' => filter,'$top' => top,'$orderby' => orderby,'api-version' => @client.api_version},
96
+ headers: request_headers.merge(custom_headers || {}),
97
+ base_url: request_url
98
+ }
99
+ promise = @client.make_request_async(:get, path_template, options)
100
+
101
+ promise = promise.then do |result|
102
+ http_response = result.response
103
+ status_code = http_response.status
104
+ response_content = http_response.body
105
+ unless status_code == 200
106
+ error_model = JSON.load(response_content)
107
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
108
+ end
109
+
110
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
111
+ # Deserialize Response
112
+ if status_code == 200
113
+ begin
114
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
115
+ result_mapper = Azure::ARM::DevTestLabs::Models::ResponseWithContinuationSchedule.mapper()
116
+ result.body = @client.deserialize(result_mapper, parsed_response)
117
+ rescue Exception => e
118
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
119
+ end
120
+ end
121
+
122
+ result
123
+ end
124
+
125
+ promise.execute
126
+ end
127
+
128
+ #
129
+ # List schedules in a resource group.
130
+ #
131
+ # @param resource_group_name [String] The name of the resource group.
132
+ # @param expand [String] Specify the $expand query. Example:
133
+ # 'properties($select=status)'
134
+ # @param filter [String] The filter to apply to the operation.
135
+ # @param top [Integer] The maximum number of resources to return from the
136
+ # operation.
137
+ # @param orderby [String] The ordering expression for the results, using OData
138
+ # notation.
139
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
140
+ # will be added to the HTTP request.
141
+ #
142
+ # @return [Array<Schedule>] operation results.
143
+ #
144
+ def list_by_resource_group(resource_group_name, expand = nil, filter = nil, top = nil, orderby = nil, custom_headers = nil)
145
+ first_page = list_by_resource_group_as_lazy(resource_group_name, expand, filter, top, orderby, custom_headers)
146
+ first_page.get_all_items
147
+ end
148
+
149
+ #
150
+ # List schedules in a resource group.
151
+ #
152
+ # @param resource_group_name [String] The name of the resource group.
153
+ # @param expand [String] Specify the $expand query. Example:
154
+ # 'properties($select=status)'
155
+ # @param filter [String] The filter to apply to the operation.
156
+ # @param top [Integer] The maximum number of resources to return from the
157
+ # operation.
158
+ # @param orderby [String] The ordering expression for the results, using OData
159
+ # notation.
160
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
161
+ # will be added to the HTTP request.
162
+ #
163
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
164
+ #
165
+ def list_by_resource_group_with_http_info(resource_group_name, expand = nil, filter = nil, top = nil, orderby = nil, custom_headers = nil)
166
+ list_by_resource_group_async(resource_group_name, expand, filter, top, orderby, custom_headers).value!
167
+ end
168
+
169
+ #
170
+ # List schedules in a resource group.
171
+ #
172
+ # @param resource_group_name [String] The name of the resource group.
173
+ # @param expand [String] Specify the $expand query. Example:
174
+ # 'properties($select=status)'
175
+ # @param filter [String] The filter to apply to the operation.
176
+ # @param top [Integer] The maximum number of resources to return from the
177
+ # operation.
178
+ # @param orderby [String] The ordering expression for the results, using OData
179
+ # notation.
180
+ # @param [Hash{String => String}] A hash of custom headers that will be added
181
+ # to the HTTP request.
182
+ #
183
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
184
+ #
185
+ def list_by_resource_group_async(resource_group_name, expand = nil, filter = nil, top = nil, orderby = nil, custom_headers = nil)
186
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
187
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
188
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
189
+
190
+
191
+ request_headers = {}
192
+
193
+ # Set Headers
194
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
195
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
196
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/schedules'
197
+
198
+ request_url = @base_url || @client.base_url
199
+
200
+ options = {
201
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
202
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
203
+ query_params: {'$expand' => expand,'$filter' => filter,'$top' => top,'$orderby' => orderby,'api-version' => @client.api_version},
204
+ headers: request_headers.merge(custom_headers || {}),
205
+ base_url: request_url
206
+ }
207
+ promise = @client.make_request_async(:get, path_template, options)
208
+
209
+ promise = promise.then do |result|
210
+ http_response = result.response
211
+ status_code = http_response.status
212
+ response_content = http_response.body
213
+ unless status_code == 200
214
+ error_model = JSON.load(response_content)
215
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
216
+ end
217
+
218
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
219
+ # Deserialize Response
220
+ if status_code == 200
221
+ begin
222
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
223
+ result_mapper = Azure::ARM::DevTestLabs::Models::ResponseWithContinuationSchedule.mapper()
224
+ result.body = @client.deserialize(result_mapper, parsed_response)
225
+ rescue Exception => e
226
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
227
+ end
228
+ end
229
+
230
+ result
231
+ end
232
+
233
+ promise.execute
234
+ end
235
+
236
+ #
237
+ # Get schedule.
238
+ #
239
+ # @param resource_group_name [String] The name of the resource group.
240
+ # @param name [String] The name of the schedule.
241
+ # @param expand [String] Specify the $expand query. Example:
242
+ # 'properties($select=status)'
243
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
244
+ # will be added to the HTTP request.
245
+ #
246
+ # @return [Schedule] operation results.
247
+ #
248
+ def get(resource_group_name, name, expand = nil, custom_headers = nil)
249
+ response = get_async(resource_group_name, name, expand, custom_headers).value!
250
+ response.body unless response.nil?
251
+ end
252
+
253
+ #
254
+ # Get schedule.
255
+ #
256
+ # @param resource_group_name [String] The name of the resource group.
257
+ # @param name [String] The name of the schedule.
258
+ # @param expand [String] Specify the $expand query. Example:
259
+ # 'properties($select=status)'
260
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
261
+ # will be added to the HTTP request.
262
+ #
263
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
264
+ #
265
+ def get_with_http_info(resource_group_name, name, expand = nil, custom_headers = nil)
266
+ get_async(resource_group_name, name, expand, custom_headers).value!
267
+ end
268
+
269
+ #
270
+ # Get schedule.
271
+ #
272
+ # @param resource_group_name [String] The name of the resource group.
273
+ # @param name [String] The name of the schedule.
274
+ # @param expand [String] Specify the $expand query. Example:
275
+ # 'properties($select=status)'
276
+ # @param [Hash{String => String}] A hash of custom headers that will be added
277
+ # to the HTTP request.
278
+ #
279
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
280
+ #
281
+ def get_async(resource_group_name, name, expand = nil, custom_headers = nil)
282
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
283
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
284
+ fail ArgumentError, 'name is nil' if name.nil?
285
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
286
+
287
+
288
+ request_headers = {}
289
+
290
+ # Set Headers
291
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
292
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
293
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/schedules/{name}'
294
+
295
+ request_url = @base_url || @client.base_url
296
+
297
+ options = {
298
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
299
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'name' => name},
300
+ query_params: {'$expand' => expand,'api-version' => @client.api_version},
301
+ headers: request_headers.merge(custom_headers || {}),
302
+ base_url: request_url
303
+ }
304
+ promise = @client.make_request_async(:get, path_template, options)
305
+
306
+ promise = promise.then do |result|
307
+ http_response = result.response
308
+ status_code = http_response.status
309
+ response_content = http_response.body
310
+ unless status_code == 200
311
+ error_model = JSON.load(response_content)
312
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
313
+ end
314
+
315
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
316
+ # Deserialize Response
317
+ if status_code == 200
318
+ begin
319
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
320
+ result_mapper = Azure::ARM::DevTestLabs::Models::Schedule.mapper()
321
+ result.body = @client.deserialize(result_mapper, parsed_response)
322
+ rescue Exception => e
323
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
324
+ end
325
+ end
326
+
327
+ result
328
+ end
329
+
330
+ promise.execute
331
+ end
332
+
333
+ #
334
+ # Create or replace an existing schedule.
335
+ #
336
+ # @param resource_group_name [String] The name of the resource group.
337
+ # @param name [String] The name of the schedule.
338
+ # @param schedule [Schedule] A schedule.
339
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
340
+ # will be added to the HTTP request.
341
+ #
342
+ # @return [Schedule] operation results.
343
+ #
344
+ def create_or_update(resource_group_name, name, schedule, custom_headers = nil)
345
+ response = create_or_update_async(resource_group_name, name, schedule, custom_headers).value!
346
+ response.body unless response.nil?
347
+ end
348
+
349
+ #
350
+ # Create or replace an existing schedule.
351
+ #
352
+ # @param resource_group_name [String] The name of the resource group.
353
+ # @param name [String] The name of the schedule.
354
+ # @param schedule [Schedule] A schedule.
355
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
356
+ # will be added to the HTTP request.
357
+ #
358
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
359
+ #
360
+ def create_or_update_with_http_info(resource_group_name, name, schedule, custom_headers = nil)
361
+ create_or_update_async(resource_group_name, name, schedule, custom_headers).value!
362
+ end
363
+
364
+ #
365
+ # Create or replace an existing schedule.
366
+ #
367
+ # @param resource_group_name [String] The name of the resource group.
368
+ # @param name [String] The name of the schedule.
369
+ # @param schedule [Schedule] A schedule.
370
+ # @param [Hash{String => String}] A hash of custom headers that will be added
371
+ # to the HTTP request.
372
+ #
373
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
374
+ #
375
+ def create_or_update_async(resource_group_name, name, schedule, custom_headers = nil)
376
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
377
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
378
+ fail ArgumentError, 'name is nil' if name.nil?
379
+ fail ArgumentError, 'schedule is nil' if schedule.nil?
380
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
381
+
382
+
383
+ request_headers = {}
384
+
385
+ # Set Headers
386
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
387
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
388
+
389
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
390
+
391
+ # Serialize Request
392
+ request_mapper = Azure::ARM::DevTestLabs::Models::Schedule.mapper()
393
+ request_content = @client.serialize(request_mapper, schedule)
394
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
395
+
396
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/schedules/{name}'
397
+
398
+ request_url = @base_url || @client.base_url
399
+
400
+ options = {
401
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
402
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'name' => name},
403
+ query_params: {'api-version' => @client.api_version},
404
+ body: request_content,
405
+ headers: request_headers.merge(custom_headers || {}),
406
+ base_url: request_url
407
+ }
408
+ promise = @client.make_request_async(:put, path_template, options)
409
+
410
+ promise = promise.then do |result|
411
+ http_response = result.response
412
+ status_code = http_response.status
413
+ response_content = http_response.body
414
+ unless status_code == 200 || status_code == 201
415
+ error_model = JSON.load(response_content)
416
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
417
+ end
418
+
419
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
420
+ # Deserialize Response
421
+ if status_code == 200
422
+ begin
423
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
424
+ result_mapper = Azure::ARM::DevTestLabs::Models::Schedule.mapper()
425
+ result.body = @client.deserialize(result_mapper, parsed_response)
426
+ rescue Exception => e
427
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
428
+ end
429
+ end
430
+ # Deserialize Response
431
+ if status_code == 201
432
+ begin
433
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
434
+ result_mapper = Azure::ARM::DevTestLabs::Models::Schedule.mapper()
435
+ result.body = @client.deserialize(result_mapper, parsed_response)
436
+ rescue Exception => e
437
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
438
+ end
439
+ end
440
+
441
+ result
442
+ end
443
+
444
+ promise.execute
445
+ end
446
+
447
+ #
448
+ # Delete schedule.
449
+ #
450
+ # @param resource_group_name [String] The name of the resource group.
451
+ # @param name [String] The name of the schedule.
452
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
453
+ # will be added to the HTTP request.
454
+ #
455
+ #
456
+ def delete(resource_group_name, name, custom_headers = nil)
457
+ response = delete_async(resource_group_name, name, custom_headers).value!
458
+ nil
459
+ end
460
+
461
+ #
462
+ # Delete schedule.
463
+ #
464
+ # @param resource_group_name [String] The name of the resource group.
465
+ # @param name [String] The name of the schedule.
466
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
467
+ # will be added to the HTTP request.
468
+ #
469
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
470
+ #
471
+ def delete_with_http_info(resource_group_name, name, custom_headers = nil)
472
+ delete_async(resource_group_name, name, custom_headers).value!
473
+ end
474
+
475
+ #
476
+ # Delete schedule.
477
+ #
478
+ # @param resource_group_name [String] The name of the resource group.
479
+ # @param name [String] The name of the schedule.
480
+ # @param [Hash{String => String}] A hash of custom headers that will be added
481
+ # to the HTTP request.
482
+ #
483
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
484
+ #
485
+ def delete_async(resource_group_name, name, custom_headers = nil)
486
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
487
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
488
+ fail ArgumentError, 'name is nil' if name.nil?
489
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
490
+
491
+
492
+ request_headers = {}
493
+
494
+ # Set Headers
495
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
496
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
497
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/schedules/{name}'
498
+
499
+ request_url = @base_url || @client.base_url
500
+
501
+ options = {
502
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
503
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'name' => name},
504
+ query_params: {'api-version' => @client.api_version},
505
+ headers: request_headers.merge(custom_headers || {}),
506
+ base_url: request_url
507
+ }
508
+ promise = @client.make_request_async(:delete, path_template, options)
509
+
510
+ promise = promise.then do |result|
511
+ http_response = result.response
512
+ status_code = http_response.status
513
+ response_content = http_response.body
514
+ unless status_code == 200 || status_code == 204
515
+ error_model = JSON.load(response_content)
516
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
517
+ end
518
+
519
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
520
+
521
+ result
522
+ end
523
+
524
+ promise.execute
525
+ end
526
+
527
+ #
528
+ # Modify properties of schedules.
529
+ #
530
+ # @param resource_group_name [String] The name of the resource group.
531
+ # @param name [String] The name of the schedule.
532
+ # @param schedule [ScheduleFragment] A schedule.
533
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
534
+ # will be added to the HTTP request.
535
+ #
536
+ # @return [Schedule] operation results.
537
+ #
538
+ def update(resource_group_name, name, schedule, custom_headers = nil)
539
+ response = update_async(resource_group_name, name, schedule, custom_headers).value!
540
+ response.body unless response.nil?
541
+ end
542
+
543
+ #
544
+ # Modify properties of schedules.
545
+ #
546
+ # @param resource_group_name [String] The name of the resource group.
547
+ # @param name [String] The name of the schedule.
548
+ # @param schedule [ScheduleFragment] A schedule.
549
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
550
+ # will be added to the HTTP request.
551
+ #
552
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
553
+ #
554
+ def update_with_http_info(resource_group_name, name, schedule, custom_headers = nil)
555
+ update_async(resource_group_name, name, schedule, custom_headers).value!
556
+ end
557
+
558
+ #
559
+ # Modify properties of schedules.
560
+ #
561
+ # @param resource_group_name [String] The name of the resource group.
562
+ # @param name [String] The name of the schedule.
563
+ # @param schedule [ScheduleFragment] A schedule.
564
+ # @param [Hash{String => String}] A hash of custom headers that will be added
565
+ # to the HTTP request.
566
+ #
567
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
568
+ #
569
+ def update_async(resource_group_name, name, schedule, custom_headers = nil)
570
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
571
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
572
+ fail ArgumentError, 'name is nil' if name.nil?
573
+ fail ArgumentError, 'schedule is nil' if schedule.nil?
574
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
575
+
576
+
577
+ request_headers = {}
578
+
579
+ # Set Headers
580
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
581
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
582
+
583
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
584
+
585
+ # Serialize Request
586
+ request_mapper = Azure::ARM::DevTestLabs::Models::ScheduleFragment.mapper()
587
+ request_content = @client.serialize(request_mapper, schedule)
588
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
589
+
590
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/schedules/{name}'
591
+
592
+ request_url = @base_url || @client.base_url
593
+
594
+ options = {
595
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
596
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'name' => name},
597
+ query_params: {'api-version' => @client.api_version},
598
+ body: request_content,
599
+ headers: request_headers.merge(custom_headers || {}),
600
+ base_url: request_url
601
+ }
602
+ promise = @client.make_request_async(:patch, path_template, options)
603
+
604
+ promise = promise.then do |result|
605
+ http_response = result.response
606
+ status_code = http_response.status
607
+ response_content = http_response.body
608
+ unless status_code == 200
609
+ error_model = JSON.load(response_content)
610
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
611
+ end
612
+
613
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
614
+ # Deserialize Response
615
+ if status_code == 200
616
+ begin
617
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
618
+ result_mapper = Azure::ARM::DevTestLabs::Models::Schedule.mapper()
619
+ result.body = @client.deserialize(result_mapper, parsed_response)
620
+ rescue Exception => e
621
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
622
+ end
623
+ end
624
+
625
+ result
626
+ end
627
+
628
+ promise.execute
629
+ end
630
+
631
+ #
632
+ # Execute a schedule. This operation can take a while to complete.
633
+ #
634
+ # @param resource_group_name [String] The name of the resource group.
635
+ # @param name [String] The name of the schedule.
636
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
637
+ # will be added to the HTTP request.
638
+ #
639
+ def execute(resource_group_name, name, custom_headers = nil)
640
+ response = execute_async(resource_group_name, name, custom_headers).value!
641
+ nil
642
+ end
643
+
644
+ #
645
+ # @param resource_group_name [String] The name of the resource group.
646
+ # @param name [String] The name of the schedule.
647
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
648
+ # will be added to the HTTP request.
649
+ #
650
+ # @return [Concurrent::Promise] promise which provides async access to http
651
+ # response.
652
+ #
653
+ def execute_async(resource_group_name, name, custom_headers = nil)
654
+ # Send request
655
+ promise = begin_execute_async(resource_group_name, name, custom_headers)
656
+
657
+ promise = promise.then do |response|
658
+ # Defining deserialization method.
659
+ deserialize_method = lambda do |parsed_response|
660
+ end
661
+
662
+ # Waiting for response.
663
+ @client.get_long_running_operation_result(response, deserialize_method)
664
+ end
665
+
666
+ promise
667
+ end
668
+
669
+ #
670
+ # Updates a schedule's target resource Id. This operation can take a while to
671
+ # complete.
672
+ #
673
+ # @param resource_group_name [String] The name of the resource group.
674
+ # @param name [String] The name of the schedule.
675
+ # @param retarget_schedule_properties [RetargetScheduleProperties] Properties
676
+ # for retargeting a virtual machine schedule.
677
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
678
+ # will be added to the HTTP request.
679
+ #
680
+ def retarget(resource_group_name, name, retarget_schedule_properties, custom_headers = nil)
681
+ response = retarget_async(resource_group_name, name, retarget_schedule_properties, custom_headers).value!
682
+ nil
683
+ end
684
+
685
+ #
686
+ # @param resource_group_name [String] The name of the resource group.
687
+ # @param name [String] The name of the schedule.
688
+ # @param retarget_schedule_properties [RetargetScheduleProperties] Properties
689
+ # for retargeting a virtual machine schedule.
690
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
691
+ # will be added to the HTTP request.
692
+ #
693
+ # @return [Concurrent::Promise] promise which provides async access to http
694
+ # response.
695
+ #
696
+ def retarget_async(resource_group_name, name, retarget_schedule_properties, custom_headers = nil)
697
+ # Send request
698
+ promise = begin_retarget_async(resource_group_name, name, retarget_schedule_properties, custom_headers)
699
+
700
+ promise = promise.then do |response|
701
+ # Defining deserialization method.
702
+ deserialize_method = lambda do |parsed_response|
703
+ end
704
+
705
+ # Waiting for response.
706
+ @client.get_long_running_operation_result(response, deserialize_method)
707
+ end
708
+
709
+ promise
710
+ end
711
+
712
+ #
713
+ # Execute a schedule. This operation can take a while to complete.
714
+ #
715
+ # @param resource_group_name [String] The name of the resource group.
716
+ # @param name [String] The name of the schedule.
717
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
718
+ # will be added to the HTTP request.
719
+ #
720
+ #
721
+ def begin_execute(resource_group_name, name, custom_headers = nil)
722
+ response = begin_execute_async(resource_group_name, name, custom_headers).value!
723
+ nil
724
+ end
725
+
726
+ #
727
+ # Execute a schedule. This operation can take a while to complete.
728
+ #
729
+ # @param resource_group_name [String] The name of the resource group.
730
+ # @param name [String] The name of the schedule.
731
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
732
+ # will be added to the HTTP request.
733
+ #
734
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
735
+ #
736
+ def begin_execute_with_http_info(resource_group_name, name, custom_headers = nil)
737
+ begin_execute_async(resource_group_name, name, custom_headers).value!
738
+ end
739
+
740
+ #
741
+ # Execute a schedule. This operation can take a while to complete.
742
+ #
743
+ # @param resource_group_name [String] The name of the resource group.
744
+ # @param name [String] The name of the schedule.
745
+ # @param [Hash{String => String}] A hash of custom headers that will be added
746
+ # to the HTTP request.
747
+ #
748
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
749
+ #
750
+ def begin_execute_async(resource_group_name, name, custom_headers = nil)
751
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
752
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
753
+ fail ArgumentError, 'name is nil' if name.nil?
754
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
755
+
756
+
757
+ request_headers = {}
758
+
759
+ # Set Headers
760
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
761
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
762
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/schedules/{name}/execute'
763
+
764
+ request_url = @base_url || @client.base_url
765
+
766
+ options = {
767
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
768
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'name' => name},
769
+ query_params: {'api-version' => @client.api_version},
770
+ headers: request_headers.merge(custom_headers || {}),
771
+ base_url: request_url
772
+ }
773
+ promise = @client.make_request_async(:post, path_template, options)
774
+
775
+ promise = promise.then do |result|
776
+ http_response = result.response
777
+ status_code = http_response.status
778
+ response_content = http_response.body
779
+ unless status_code == 200 || status_code == 202
780
+ error_model = JSON.load(response_content)
781
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
782
+ end
783
+
784
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
785
+
786
+ result
787
+ end
788
+
789
+ promise.execute
790
+ end
791
+
792
+ #
793
+ # Updates a schedule's target resource Id. This operation can take a while to
794
+ # complete.
795
+ #
796
+ # @param resource_group_name [String] The name of the resource group.
797
+ # @param name [String] The name of the schedule.
798
+ # @param retarget_schedule_properties [RetargetScheduleProperties] Properties
799
+ # for retargeting a virtual machine schedule.
800
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
801
+ # will be added to the HTTP request.
802
+ #
803
+ #
804
+ def begin_retarget(resource_group_name, name, retarget_schedule_properties, custom_headers = nil)
805
+ response = begin_retarget_async(resource_group_name, name, retarget_schedule_properties, custom_headers).value!
806
+ nil
807
+ end
808
+
809
+ #
810
+ # Updates a schedule's target resource Id. This operation can take a while to
811
+ # complete.
812
+ #
813
+ # @param resource_group_name [String] The name of the resource group.
814
+ # @param name [String] The name of the schedule.
815
+ # @param retarget_schedule_properties [RetargetScheduleProperties] Properties
816
+ # for retargeting a virtual machine schedule.
817
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
818
+ # will be added to the HTTP request.
819
+ #
820
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
821
+ #
822
+ def begin_retarget_with_http_info(resource_group_name, name, retarget_schedule_properties, custom_headers = nil)
823
+ begin_retarget_async(resource_group_name, name, retarget_schedule_properties, custom_headers).value!
824
+ end
825
+
826
+ #
827
+ # Updates a schedule's target resource Id. This operation can take a while to
828
+ # complete.
829
+ #
830
+ # @param resource_group_name [String] The name of the resource group.
831
+ # @param name [String] The name of the schedule.
832
+ # @param retarget_schedule_properties [RetargetScheduleProperties] Properties
833
+ # for retargeting a virtual machine schedule.
834
+ # @param [Hash{String => String}] A hash of custom headers that will be added
835
+ # to the HTTP request.
836
+ #
837
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
838
+ #
839
+ def begin_retarget_async(resource_group_name, name, retarget_schedule_properties, custom_headers = nil)
840
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
841
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
842
+ fail ArgumentError, 'name is nil' if name.nil?
843
+ fail ArgumentError, 'retarget_schedule_properties is nil' if retarget_schedule_properties.nil?
844
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
845
+
846
+
847
+ request_headers = {}
848
+
849
+ # Set Headers
850
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
851
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
852
+
853
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
854
+
855
+ # Serialize Request
856
+ request_mapper = Azure::ARM::DevTestLabs::Models::RetargetScheduleProperties.mapper()
857
+ request_content = @client.serialize(request_mapper, retarget_schedule_properties)
858
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
859
+
860
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/schedules/{name}/retarget'
861
+
862
+ request_url = @base_url || @client.base_url
863
+
864
+ options = {
865
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
866
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'name' => name},
867
+ query_params: {'api-version' => @client.api_version},
868
+ body: request_content,
869
+ headers: request_headers.merge(custom_headers || {}),
870
+ base_url: request_url
871
+ }
872
+ promise = @client.make_request_async(:post, path_template, options)
873
+
874
+ promise = promise.then do |result|
875
+ http_response = result.response
876
+ status_code = http_response.status
877
+ response_content = http_response.body
878
+ unless status_code == 200 || status_code == 202
879
+ error_model = JSON.load(response_content)
880
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
881
+ end
882
+
883
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
884
+
885
+ result
886
+ end
887
+
888
+ promise.execute
889
+ end
890
+
891
+ #
892
+ # List schedules in a subscription.
893
+ #
894
+ # @param next_page_link [String] The NextLink from the previous successful call
895
+ # to List operation.
896
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
897
+ # will be added to the HTTP request.
898
+ #
899
+ # @return [ResponseWithContinuationSchedule] operation results.
900
+ #
901
+ def list_by_subscription_next(next_page_link, custom_headers = nil)
902
+ response = list_by_subscription_next_async(next_page_link, custom_headers).value!
903
+ response.body unless response.nil?
904
+ end
905
+
906
+ #
907
+ # List schedules in a subscription.
908
+ #
909
+ # @param next_page_link [String] The NextLink from the previous successful call
910
+ # to List operation.
911
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
912
+ # will be added to the HTTP request.
913
+ #
914
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
915
+ #
916
+ def list_by_subscription_next_with_http_info(next_page_link, custom_headers = nil)
917
+ list_by_subscription_next_async(next_page_link, custom_headers).value!
918
+ end
919
+
920
+ #
921
+ # List schedules in a subscription.
922
+ #
923
+ # @param next_page_link [String] The NextLink from the previous successful call
924
+ # to List operation.
925
+ # @param [Hash{String => String}] A hash of custom headers that will be added
926
+ # to the HTTP request.
927
+ #
928
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
929
+ #
930
+ def list_by_subscription_next_async(next_page_link, custom_headers = nil)
931
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
932
+
933
+
934
+ request_headers = {}
935
+
936
+ # Set Headers
937
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
938
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
939
+ path_template = '{nextLink}'
940
+
941
+ request_url = @base_url || @client.base_url
942
+
943
+ options = {
944
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
945
+ skip_encoding_path_params: {'nextLink' => next_page_link},
946
+ headers: request_headers.merge(custom_headers || {}),
947
+ base_url: request_url
948
+ }
949
+ promise = @client.make_request_async(:get, path_template, options)
950
+
951
+ promise = promise.then do |result|
952
+ http_response = result.response
953
+ status_code = http_response.status
954
+ response_content = http_response.body
955
+ unless status_code == 200
956
+ error_model = JSON.load(response_content)
957
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
958
+ end
959
+
960
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
961
+ # Deserialize Response
962
+ if status_code == 200
963
+ begin
964
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
965
+ result_mapper = Azure::ARM::DevTestLabs::Models::ResponseWithContinuationSchedule.mapper()
966
+ result.body = @client.deserialize(result_mapper, parsed_response)
967
+ rescue Exception => e
968
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
969
+ end
970
+ end
971
+
972
+ result
973
+ end
974
+
975
+ promise.execute
976
+ end
977
+
978
+ #
979
+ # List schedules in a resource group.
980
+ #
981
+ # @param next_page_link [String] The NextLink from the previous successful call
982
+ # to List operation.
983
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
984
+ # will be added to the HTTP request.
985
+ #
986
+ # @return [ResponseWithContinuationSchedule] operation results.
987
+ #
988
+ def list_by_resource_group_next(next_page_link, custom_headers = nil)
989
+ response = list_by_resource_group_next_async(next_page_link, custom_headers).value!
990
+ response.body unless response.nil?
991
+ end
992
+
993
+ #
994
+ # List schedules in a resource group.
995
+ #
996
+ # @param next_page_link [String] The NextLink from the previous successful call
997
+ # to List operation.
998
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
999
+ # will be added to the HTTP request.
1000
+ #
1001
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1002
+ #
1003
+ def list_by_resource_group_next_with_http_info(next_page_link, custom_headers = nil)
1004
+ list_by_resource_group_next_async(next_page_link, custom_headers).value!
1005
+ end
1006
+
1007
+ #
1008
+ # List schedules in a resource group.
1009
+ #
1010
+ # @param next_page_link [String] The NextLink from the previous successful call
1011
+ # to List operation.
1012
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1013
+ # to the HTTP request.
1014
+ #
1015
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1016
+ #
1017
+ def list_by_resource_group_next_async(next_page_link, custom_headers = nil)
1018
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1019
+
1020
+
1021
+ request_headers = {}
1022
+
1023
+ # Set Headers
1024
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1025
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1026
+ path_template = '{nextLink}'
1027
+
1028
+ request_url = @base_url || @client.base_url
1029
+
1030
+ options = {
1031
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1032
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1033
+ headers: request_headers.merge(custom_headers || {}),
1034
+ base_url: request_url
1035
+ }
1036
+ promise = @client.make_request_async(:get, path_template, options)
1037
+
1038
+ promise = promise.then do |result|
1039
+ http_response = result.response
1040
+ status_code = http_response.status
1041
+ response_content = http_response.body
1042
+ unless status_code == 200
1043
+ error_model = JSON.load(response_content)
1044
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1045
+ end
1046
+
1047
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1048
+ # Deserialize Response
1049
+ if status_code == 200
1050
+ begin
1051
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1052
+ result_mapper = Azure::ARM::DevTestLabs::Models::ResponseWithContinuationSchedule.mapper()
1053
+ result.body = @client.deserialize(result_mapper, parsed_response)
1054
+ rescue Exception => e
1055
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1056
+ end
1057
+ end
1058
+
1059
+ result
1060
+ end
1061
+
1062
+ promise.execute
1063
+ end
1064
+
1065
+ #
1066
+ # List schedules in a subscription.
1067
+ #
1068
+ # @param expand [String] Specify the $expand query. Example:
1069
+ # 'properties($select=status)'
1070
+ # @param filter [String] The filter to apply to the operation.
1071
+ # @param top [Integer] The maximum number of resources to return from the
1072
+ # operation.
1073
+ # @param orderby [String] The ordering expression for the results, using OData
1074
+ # notation.
1075
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1076
+ # will be added to the HTTP request.
1077
+ #
1078
+ # @return [ResponseWithContinuationSchedule] which provide lazy access to pages
1079
+ # of the response.
1080
+ #
1081
+ def list_by_subscription_as_lazy(expand = nil, filter = nil, top = nil, orderby = nil, custom_headers = nil)
1082
+ response = list_by_subscription_async(expand, filter, top, orderby, custom_headers).value!
1083
+ unless response.nil?
1084
+ page = response.body
1085
+ page.next_method = Proc.new do |next_page_link|
1086
+ list_by_subscription_next_async(next_page_link, custom_headers)
1087
+ end
1088
+ page
1089
+ end
1090
+ end
1091
+
1092
+ #
1093
+ # List schedules in a resource group.
1094
+ #
1095
+ # @param resource_group_name [String] The name of the resource group.
1096
+ # @param expand [String] Specify the $expand query. Example:
1097
+ # 'properties($select=status)'
1098
+ # @param filter [String] The filter to apply to the operation.
1099
+ # @param top [Integer] The maximum number of resources to return from the
1100
+ # operation.
1101
+ # @param orderby [String] The ordering expression for the results, using OData
1102
+ # notation.
1103
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1104
+ # will be added to the HTTP request.
1105
+ #
1106
+ # @return [ResponseWithContinuationSchedule] which provide lazy access to pages
1107
+ # of the response.
1108
+ #
1109
+ def list_by_resource_group_as_lazy(resource_group_name, expand = nil, filter = nil, top = nil, orderby = nil, custom_headers = nil)
1110
+ response = list_by_resource_group_async(resource_group_name, expand, filter, top, orderby, custom_headers).value!
1111
+ unless response.nil?
1112
+ page = response.body
1113
+ page.next_method = Proc.new do |next_page_link|
1114
+ list_by_resource_group_next_async(next_page_link, custom_headers)
1115
+ end
1116
+ page
1117
+ end
1118
+ end
1119
+
1120
+ end
1121
+ end