azure_mgmt_resources 0.16.0 → 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (142) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2016-02-01/generated/azure_mgmt_resources/models/deployment_extended.rb +1 -0
  3. data/lib/2016-02-01/generated/azure_mgmt_resources/models/tag_details.rb +1 -0
  4. data/lib/2016-02-01/generated/azure_mgmt_resources/models/tag_value.rb +1 -0
  5. data/lib/2016-02-01/generated/azure_mgmt_resources/resource_management_client.rb +8 -9
  6. data/lib/2016-07-01/generated/azure_mgmt_resources/models/deployment_extended.rb +1 -0
  7. data/lib/2016-07-01/generated/azure_mgmt_resources/models/tag_details.rb +1 -0
  8. data/lib/2016-07-01/generated/azure_mgmt_resources/models/tag_value.rb +1 -0
  9. data/lib/2016-07-01/generated/azure_mgmt_resources/resource_management_client.rb +7 -6
  10. data/lib/2016-09-01/generated/azure_mgmt_resources/models/deployment_extended.rb +1 -0
  11. data/lib/2016-09-01/generated/azure_mgmt_resources/models/tag_details.rb +1 -0
  12. data/lib/2016-09-01/generated/azure_mgmt_resources/models/tag_value.rb +1 -0
  13. data/lib/2016-09-01/generated/azure_mgmt_resources/resource_management_client.rb +7 -6
  14. data/lib/2017-05-10/generated/azure_mgmt_resources/models/deployment_extended.rb +1 -0
  15. data/lib/2017-05-10/generated/azure_mgmt_resources/models/resource.rb +1 -1
  16. data/lib/2017-05-10/generated/azure_mgmt_resources/models/resource_provider_operation_display_properties.rb +1 -1
  17. data/lib/2017-05-10/generated/azure_mgmt_resources/models/tag_details.rb +1 -0
  18. data/lib/2017-05-10/generated/azure_mgmt_resources/models/tag_value.rb +1 -0
  19. data/lib/2017-05-10/generated/azure_mgmt_resources/resource_management_client.rb +7 -6
  20. data/lib/2018-02-01/generated/azure_mgmt_resources.rb +83 -0
  21. data/lib/2018-02-01/generated/azure_mgmt_resources/deployment_operations.rb +350 -0
  22. data/lib/2018-02-01/generated/azure_mgmt_resources/deployments.rb +1136 -0
  23. data/lib/2018-02-01/generated/azure_mgmt_resources/models/alias_path_type.rb +65 -0
  24. data/lib/2018-02-01/generated/azure_mgmt_resources/models/alias_type.rb +66 -0
  25. data/lib/2018-02-01/generated/azure_mgmt_resources/models/basic_dependency.rb +68 -0
  26. data/lib/2018-02-01/generated/azure_mgmt_resources/models/debug_setting.rb +54 -0
  27. data/lib/2018-02-01/generated/azure_mgmt_resources/models/dependency.rb +88 -0
  28. data/lib/2018-02-01/generated/azure_mgmt_resources/models/deployment.rb +47 -0
  29. data/lib/2018-02-01/generated/azure_mgmt_resources/models/deployment_export_result.rb +46 -0
  30. data/lib/2018-02-01/generated/azure_mgmt_resources/models/deployment_extended.rb +70 -0
  31. data/lib/2018-02-01/generated/azure_mgmt_resources/models/deployment_extended_filter.rb +46 -0
  32. data/lib/2018-02-01/generated/azure_mgmt_resources/models/deployment_list_result.rb +99 -0
  33. data/lib/2018-02-01/generated/azure_mgmt_resources/models/deployment_mode.rb +16 -0
  34. data/lib/2018-02-01/generated/azure_mgmt_resources/models/deployment_operation.rb +71 -0
  35. data/lib/2018-02-01/generated/azure_mgmt_resources/models/deployment_operation_properties.rb +134 -0
  36. data/lib/2018-02-01/generated/azure_mgmt_resources/models/deployment_operations_list_result.rb +99 -0
  37. data/lib/2018-02-01/generated/azure_mgmt_resources/models/deployment_properties.rb +136 -0
  38. data/lib/2018-02-01/generated/azure_mgmt_resources/models/deployment_properties_extended.rb +210 -0
  39. data/lib/2018-02-01/generated/azure_mgmt_resources/models/deployment_validate_result.rb +60 -0
  40. data/lib/2018-02-01/generated/azure_mgmt_resources/models/export_template_request.rb +69 -0
  41. data/lib/2018-02-01/generated/azure_mgmt_resources/models/generic_resource.rb +158 -0
  42. data/lib/2018-02-01/generated/azure_mgmt_resources/models/generic_resource_filter.rb +68 -0
  43. data/lib/2018-02-01/generated/azure_mgmt_resources/models/http_message.rb +46 -0
  44. data/lib/2018-02-01/generated/azure_mgmt_resources/models/identity.rb +73 -0
  45. data/lib/2018-02-01/generated/azure_mgmt_resources/models/on_error_deployment.rb +60 -0
  46. data/lib/2018-02-01/generated/azure_mgmt_resources/models/on_error_deployment_extended.rb +73 -0
  47. data/lib/2018-02-01/generated/azure_mgmt_resources/models/on_error_deployment_type.rb +16 -0
  48. data/lib/2018-02-01/generated/azure_mgmt_resources/models/parameters_link.rb +58 -0
  49. data/lib/2018-02-01/generated/azure_mgmt_resources/models/plan.rb +90 -0
  50. data/lib/2018-02-01/generated/azure_mgmt_resources/models/provider.rb +92 -0
  51. data/lib/2018-02-01/generated/azure_mgmt_resources/models/provider_list_result.rb +99 -0
  52. data/lib/2018-02-01/generated/azure_mgmt_resources/models/provider_resource_type.rb +125 -0
  53. data/lib/2018-02-01/generated/azure_mgmt_resources/models/resource.rb +101 -0
  54. data/lib/2018-02-01/generated/azure_mgmt_resources/models/resource_group.rb +115 -0
  55. data/lib/2018-02-01/generated/azure_mgmt_resources/models/resource_group_export_result.rb +58 -0
  56. data/lib/2018-02-01/generated/azure_mgmt_resources/models/resource_group_filter.rb +57 -0
  57. data/lib/2018-02-01/generated/azure_mgmt_resources/models/resource_group_list_result.rb +99 -0
  58. data/lib/2018-02-01/generated/azure_mgmt_resources/models/resource_group_patchable.rb +90 -0
  59. data/lib/2018-02-01/generated/azure_mgmt_resources/models/resource_group_properties.rb +47 -0
  60. data/lib/2018-02-01/generated/azure_mgmt_resources/models/resource_identity_type.rb +18 -0
  61. data/lib/2018-02-01/generated/azure_mgmt_resources/models/resource_list_result.rb +99 -0
  62. data/lib/2018-02-01/generated/azure_mgmt_resources/models/resource_management_error_with_details.rb +92 -0
  63. data/lib/2018-02-01/generated/azure_mgmt_resources/models/resource_provider_operation_display_properties.rb +91 -0
  64. data/lib/2018-02-01/generated/azure_mgmt_resources/models/resources_move_info.rb +65 -0
  65. data/lib/2018-02-01/generated/azure_mgmt_resources/models/sku.rb +101 -0
  66. data/lib/2018-02-01/generated/azure_mgmt_resources/models/sub_resource.rb +46 -0
  67. data/lib/2018-02-01/generated/azure_mgmt_resources/models/tag_count.rb +57 -0
  68. data/lib/2018-02-01/generated/azure_mgmt_resources/models/tag_details.rb +92 -0
  69. data/lib/2018-02-01/generated/azure_mgmt_resources/models/tag_value.rb +70 -0
  70. data/lib/2018-02-01/generated/azure_mgmt_resources/models/tags_list_result.rb +99 -0
  71. data/lib/2018-02-01/generated/azure_mgmt_resources/models/target_resource.rb +68 -0
  72. data/lib/2018-02-01/generated/azure_mgmt_resources/models/template_link.rb +58 -0
  73. data/lib/2018-02-01/generated/azure_mgmt_resources/module_definition.rb +9 -0
  74. data/lib/2018-02-01/generated/azure_mgmt_resources/providers.rb +520 -0
  75. data/lib/2018-02-01/generated/azure_mgmt_resources/resource_groups.rb +891 -0
  76. data/lib/2018-02-01/generated/azure_mgmt_resources/resource_management_client.rb +151 -0
  77. data/lib/2018-02-01/generated/azure_mgmt_resources/resources.rb +2178 -0
  78. data/lib/2018-02-01/generated/azure_mgmt_resources/tags.rb +599 -0
  79. data/lib/2018-05-01/generated/azure_mgmt_resources.rb +84 -0
  80. data/lib/2018-05-01/generated/azure_mgmt_resources/deployment_operations.rb +653 -0
  81. data/lib/2018-05-01/generated/azure_mgmt_resources/deployments.rb +2148 -0
  82. data/lib/2018-05-01/generated/azure_mgmt_resources/models/alias_path_type.rb +65 -0
  83. data/lib/2018-05-01/generated/azure_mgmt_resources/models/alias_type.rb +66 -0
  84. data/lib/2018-05-01/generated/azure_mgmt_resources/models/basic_dependency.rb +68 -0
  85. data/lib/2018-05-01/generated/azure_mgmt_resources/models/debug_setting.rb +54 -0
  86. data/lib/2018-05-01/generated/azure_mgmt_resources/models/dependency.rb +88 -0
  87. data/lib/2018-05-01/generated/azure_mgmt_resources/models/deployment.rb +58 -0
  88. data/lib/2018-05-01/generated/azure_mgmt_resources/models/deployment_export_result.rb +46 -0
  89. data/lib/2018-05-01/generated/azure_mgmt_resources/models/deployment_extended.rb +81 -0
  90. data/lib/2018-05-01/generated/azure_mgmt_resources/models/deployment_extended_filter.rb +46 -0
  91. data/lib/2018-05-01/generated/azure_mgmt_resources/models/deployment_list_result.rb +99 -0
  92. data/lib/2018-05-01/generated/azure_mgmt_resources/models/deployment_mode.rb +16 -0
  93. data/lib/2018-05-01/generated/azure_mgmt_resources/models/deployment_operation.rb +71 -0
  94. data/lib/2018-05-01/generated/azure_mgmt_resources/models/deployment_operation_properties.rb +134 -0
  95. data/lib/2018-05-01/generated/azure_mgmt_resources/models/deployment_operations_list_result.rb +99 -0
  96. data/lib/2018-05-01/generated/azure_mgmt_resources/models/deployment_properties.rb +136 -0
  97. data/lib/2018-05-01/generated/azure_mgmt_resources/models/deployment_properties_extended.rb +210 -0
  98. data/lib/2018-05-01/generated/azure_mgmt_resources/models/deployment_validate_result.rb +60 -0
  99. data/lib/2018-05-01/generated/azure_mgmt_resources/models/export_template_request.rb +69 -0
  100. data/lib/2018-05-01/generated/azure_mgmt_resources/models/generic_resource.rb +158 -0
  101. data/lib/2018-05-01/generated/azure_mgmt_resources/models/generic_resource_filter.rb +68 -0
  102. data/lib/2018-05-01/generated/azure_mgmt_resources/models/http_message.rb +46 -0
  103. data/lib/2018-05-01/generated/azure_mgmt_resources/models/identity.rb +96 -0
  104. data/lib/2018-05-01/generated/azure_mgmt_resources/models/identity_user_assigned_identities_value.rb +60 -0
  105. data/lib/2018-05-01/generated/azure_mgmt_resources/models/on_error_deployment.rb +60 -0
  106. data/lib/2018-05-01/generated/azure_mgmt_resources/models/on_error_deployment_extended.rb +73 -0
  107. data/lib/2018-05-01/generated/azure_mgmt_resources/models/on_error_deployment_type.rb +16 -0
  108. data/lib/2018-05-01/generated/azure_mgmt_resources/models/parameters_link.rb +58 -0
  109. data/lib/2018-05-01/generated/azure_mgmt_resources/models/plan.rb +90 -0
  110. data/lib/2018-05-01/generated/azure_mgmt_resources/models/provider.rb +92 -0
  111. data/lib/2018-05-01/generated/azure_mgmt_resources/models/provider_list_result.rb +99 -0
  112. data/lib/2018-05-01/generated/azure_mgmt_resources/models/provider_resource_type.rb +125 -0
  113. data/lib/2018-05-01/generated/azure_mgmt_resources/models/resource.rb +101 -0
  114. data/lib/2018-05-01/generated/azure_mgmt_resources/models/resource_group.rb +115 -0
  115. data/lib/2018-05-01/generated/azure_mgmt_resources/models/resource_group_export_result.rb +58 -0
  116. data/lib/2018-05-01/generated/azure_mgmt_resources/models/resource_group_filter.rb +57 -0
  117. data/lib/2018-05-01/generated/azure_mgmt_resources/models/resource_group_list_result.rb +99 -0
  118. data/lib/2018-05-01/generated/azure_mgmt_resources/models/resource_group_patchable.rb +90 -0
  119. data/lib/2018-05-01/generated/azure_mgmt_resources/models/resource_group_properties.rb +47 -0
  120. data/lib/2018-05-01/generated/azure_mgmt_resources/models/resource_identity_type.rb +18 -0
  121. data/lib/2018-05-01/generated/azure_mgmt_resources/models/resource_list_result.rb +99 -0
  122. data/lib/2018-05-01/generated/azure_mgmt_resources/models/resource_management_error_with_details.rb +92 -0
  123. data/lib/2018-05-01/generated/azure_mgmt_resources/models/resource_provider_operation_display_properties.rb +91 -0
  124. data/lib/2018-05-01/generated/azure_mgmt_resources/models/resources_move_info.rb +65 -0
  125. data/lib/2018-05-01/generated/azure_mgmt_resources/models/sku.rb +101 -0
  126. data/lib/2018-05-01/generated/azure_mgmt_resources/models/sub_resource.rb +46 -0
  127. data/lib/2018-05-01/generated/azure_mgmt_resources/models/tag_count.rb +57 -0
  128. data/lib/2018-05-01/generated/azure_mgmt_resources/models/tag_details.rb +92 -0
  129. data/lib/2018-05-01/generated/azure_mgmt_resources/models/tag_value.rb +70 -0
  130. data/lib/2018-05-01/generated/azure_mgmt_resources/models/tags_list_result.rb +99 -0
  131. data/lib/2018-05-01/generated/azure_mgmt_resources/models/target_resource.rb +68 -0
  132. data/lib/2018-05-01/generated/azure_mgmt_resources/models/template_link.rb +58 -0
  133. data/lib/2018-05-01/generated/azure_mgmt_resources/module_definition.rb +9 -0
  134. data/lib/2018-05-01/generated/azure_mgmt_resources/providers.rb +520 -0
  135. data/lib/2018-05-01/generated/azure_mgmt_resources/resource_groups.rb +891 -0
  136. data/lib/2018-05-01/generated/azure_mgmt_resources/resource_management_client.rb +151 -0
  137. data/lib/2018-05-01/generated/azure_mgmt_resources/resources.rb +2178 -0
  138. data/lib/2018-05-01/generated/azure_mgmt_resources/tags.rb +599 -0
  139. data/lib/azure_mgmt_resources.rb +4 -2
  140. data/lib/profiles/latest/modules/resources_profile_module.rb +138 -122
  141. data/lib/version.rb +1 -1
  142. metadata +124 -5
@@ -0,0 +1,1136 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::Resources::Mgmt::V2018_02_01
7
+ #
8
+ # Provides operations for working with resources and resource groups.
9
+ #
10
+ class Deployments
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Deployments class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [ResourceManagementClient] reference to the ResourceManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Deletes a deployment from the deployment history.
26
+ #
27
+ # A template deployment that is currently running cannot be deleted. Deleting a
28
+ # template deployment removes the associated deployment operations. Deleting a
29
+ # template deployment does not affect the state of the resource group. This is
30
+ # an asynchronous operation that returns a status of 202 until the template
31
+ # deployment is successfully deleted. The Location response header contains the
32
+ # URI that is used to obtain the status of the process. While the process is
33
+ # running, a call to the URI in the Location header returns a status of 202.
34
+ # When the process finishes, the URI in the Location header returns a status of
35
+ # 204 on success. If the asynchronous request failed, the URI in the Location
36
+ # header returns an error-level status code.
37
+ #
38
+ # @param resource_group_name [String] The name of the resource group with the
39
+ # deployment to delete. The name is case insensitive.
40
+ # @param deployment_name [String] The name of the deployment to delete.
41
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
42
+ # will be added to the HTTP request.
43
+ #
44
+ def delete(resource_group_name, deployment_name, custom_headers:nil)
45
+ response = delete_async(resource_group_name, deployment_name, custom_headers:custom_headers).value!
46
+ nil
47
+ end
48
+
49
+ #
50
+ # @param resource_group_name [String] The name of the resource group with the
51
+ # deployment to delete. The name is case insensitive.
52
+ # @param deployment_name [String] The name of the deployment to delete.
53
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
54
+ # will be added to the HTTP request.
55
+ #
56
+ # @return [Concurrent::Promise] promise which provides async access to http
57
+ # response.
58
+ #
59
+ def delete_async(resource_group_name, deployment_name, custom_headers:nil)
60
+ # Send request
61
+ promise = begin_delete_async(resource_group_name, deployment_name, custom_headers:custom_headers)
62
+
63
+ promise = promise.then do |response|
64
+ # Defining deserialization method.
65
+ deserialize_method = lambda do |parsed_response|
66
+ end
67
+
68
+ # Waiting for response.
69
+ @client.get_long_running_operation_result(response, deserialize_method)
70
+ end
71
+
72
+ promise
73
+ end
74
+
75
+ #
76
+ # Checks whether the deployment exists.
77
+ #
78
+ # @param resource_group_name [String] The name of the resource group with the
79
+ # deployment to check. The name is case insensitive.
80
+ # @param deployment_name [String] The name of the deployment to check.
81
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
82
+ # will be added to the HTTP request.
83
+ #
84
+ # @return [Boolean] operation results.
85
+ #
86
+ def check_existence(resource_group_name, deployment_name, custom_headers:nil)
87
+ response = check_existence_async(resource_group_name, deployment_name, custom_headers:custom_headers).value!
88
+ response.body unless response.nil?
89
+ end
90
+
91
+ #
92
+ # Checks whether the deployment exists.
93
+ #
94
+ # @param resource_group_name [String] The name of the resource group with the
95
+ # deployment to check. The name is case insensitive.
96
+ # @param deployment_name [String] The name of the deployment to check.
97
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
98
+ # will be added to the HTTP request.
99
+ #
100
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
101
+ #
102
+ def check_existence_with_http_info(resource_group_name, deployment_name, custom_headers:nil)
103
+ check_existence_async(resource_group_name, deployment_name, custom_headers:custom_headers).value!
104
+ end
105
+
106
+ #
107
+ # Checks whether the deployment exists.
108
+ #
109
+ # @param resource_group_name [String] The name of the resource group with the
110
+ # deployment to check. The name is case insensitive.
111
+ # @param deployment_name [String] The name of the deployment to check.
112
+ # @param [Hash{String => String}] A hash of custom headers that will be added
113
+ # to the HTTP request.
114
+ #
115
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
116
+ #
117
+ def check_existence_async(resource_group_name, deployment_name, custom_headers:nil)
118
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
119
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
120
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
121
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
122
+ fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
123
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
124
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
125
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
126
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
127
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
128
+
129
+
130
+ request_headers = {}
131
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
132
+
133
+ # Set Headers
134
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
135
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
136
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}'
137
+
138
+ request_url = @base_url || @client.base_url
139
+
140
+ options = {
141
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
142
+ path_params: {'resourceGroupName' => resource_group_name,'deploymentName' => deployment_name,'subscriptionId' => @client.subscription_id},
143
+ query_params: {'api-version' => @client.api_version},
144
+ headers: request_headers.merge(custom_headers || {}),
145
+ base_url: request_url
146
+ }
147
+ promise = @client.make_request_async(:head, path_template, options)
148
+
149
+ promise = promise.then do |result|
150
+ http_response = result.response
151
+ status_code = http_response.status
152
+ response_content = http_response.body
153
+ unless status_code == 204 || status_code == 404
154
+ error_model = JSON.load(response_content)
155
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
156
+ end
157
+
158
+ result.body = (status_code == 204)
159
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
160
+
161
+ result
162
+ end
163
+
164
+ promise.execute
165
+ end
166
+
167
+ #
168
+ # Deploys resources to a resource group.
169
+ #
170
+ # You can provide the template and parameters directly in the request or link
171
+ # to JSON files.
172
+ #
173
+ # @param resource_group_name [String] The name of the resource group to deploy
174
+ # the resources to. The name is case insensitive. The resource group must
175
+ # already exist.
176
+ # @param deployment_name [String] The name of the deployment.
177
+ # @param parameters [Deployment] Additional parameters supplied to the
178
+ # operation.
179
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
180
+ # will be added to the HTTP request.
181
+ #
182
+ # @return [DeploymentExtended] operation results.
183
+ #
184
+ def create_or_update(resource_group_name, deployment_name, parameters, custom_headers:nil)
185
+ response = create_or_update_async(resource_group_name, deployment_name, parameters, custom_headers:custom_headers).value!
186
+ response.body unless response.nil?
187
+ end
188
+
189
+ #
190
+ # @param resource_group_name [String] The name of the resource group to deploy
191
+ # the resources to. The name is case insensitive. The resource group must
192
+ # already exist.
193
+ # @param deployment_name [String] The name of the deployment.
194
+ # @param parameters [Deployment] Additional parameters supplied to the
195
+ # operation.
196
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
197
+ # will be added to the HTTP request.
198
+ #
199
+ # @return [Concurrent::Promise] promise which provides async access to http
200
+ # response.
201
+ #
202
+ def create_or_update_async(resource_group_name, deployment_name, parameters, custom_headers:nil)
203
+ # Send request
204
+ promise = begin_create_or_update_async(resource_group_name, deployment_name, parameters, custom_headers:custom_headers)
205
+
206
+ promise = promise.then do |response|
207
+ # Defining deserialization method.
208
+ deserialize_method = lambda do |parsed_response|
209
+ result_mapper = Azure::Resources::Mgmt::V2018_02_01::Models::DeploymentExtended.mapper()
210
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
211
+ end
212
+
213
+ # Waiting for response.
214
+ @client.get_long_running_operation_result(response, deserialize_method)
215
+ end
216
+
217
+ promise
218
+ end
219
+
220
+ #
221
+ # Gets a deployment.
222
+ #
223
+ # @param resource_group_name [String] The name of the resource group. The name
224
+ # is case insensitive.
225
+ # @param deployment_name [String] The name of the deployment to get.
226
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
227
+ # will be added to the HTTP request.
228
+ #
229
+ # @return [DeploymentExtended] operation results.
230
+ #
231
+ def get(resource_group_name, deployment_name, custom_headers:nil)
232
+ response = get_async(resource_group_name, deployment_name, custom_headers:custom_headers).value!
233
+ response.body unless response.nil?
234
+ end
235
+
236
+ #
237
+ # Gets a deployment.
238
+ #
239
+ # @param resource_group_name [String] The name of the resource group. The name
240
+ # is case insensitive.
241
+ # @param deployment_name [String] The name of the deployment to get.
242
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
243
+ # will be added to the HTTP request.
244
+ #
245
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
246
+ #
247
+ def get_with_http_info(resource_group_name, deployment_name, custom_headers:nil)
248
+ get_async(resource_group_name, deployment_name, custom_headers:custom_headers).value!
249
+ end
250
+
251
+ #
252
+ # Gets a deployment.
253
+ #
254
+ # @param resource_group_name [String] The name of the resource group. The name
255
+ # is case insensitive.
256
+ # @param deployment_name [String] The name of the deployment to get.
257
+ # @param [Hash{String => String}] A hash of custom headers that will be added
258
+ # to the HTTP request.
259
+ #
260
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
261
+ #
262
+ def get_async(resource_group_name, deployment_name, custom_headers:nil)
263
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
264
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
265
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
266
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
267
+ fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
268
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
269
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
270
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
271
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
272
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
273
+
274
+
275
+ request_headers = {}
276
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
277
+
278
+ # Set Headers
279
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
280
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
281
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}'
282
+
283
+ request_url = @base_url || @client.base_url
284
+
285
+ options = {
286
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
287
+ path_params: {'resourceGroupName' => resource_group_name,'deploymentName' => deployment_name,'subscriptionId' => @client.subscription_id},
288
+ query_params: {'api-version' => @client.api_version},
289
+ headers: request_headers.merge(custom_headers || {}),
290
+ base_url: request_url
291
+ }
292
+ promise = @client.make_request_async(:get, path_template, options)
293
+
294
+ promise = promise.then do |result|
295
+ http_response = result.response
296
+ status_code = http_response.status
297
+ response_content = http_response.body
298
+ unless status_code == 200
299
+ error_model = JSON.load(response_content)
300
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
301
+ end
302
+
303
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
304
+ # Deserialize Response
305
+ if status_code == 200
306
+ begin
307
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
308
+ result_mapper = Azure::Resources::Mgmt::V2018_02_01::Models::DeploymentExtended.mapper()
309
+ result.body = @client.deserialize(result_mapper, parsed_response)
310
+ rescue Exception => e
311
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
312
+ end
313
+ end
314
+
315
+ result
316
+ end
317
+
318
+ promise.execute
319
+ end
320
+
321
+ #
322
+ # Cancels a currently running template deployment.
323
+ #
324
+ # You can cancel a deployment only if the provisioningState is Accepted or
325
+ # Running. After the deployment is canceled, the provisioningState is set to
326
+ # Canceled. Canceling a template deployment stops the currently running
327
+ # template deployment and leaves the resource group partially deployed.
328
+ #
329
+ # @param resource_group_name [String] The name of the resource group. The name
330
+ # is case insensitive.
331
+ # @param deployment_name [String] The name of the deployment to cancel.
332
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
333
+ # will be added to the HTTP request.
334
+ #
335
+ #
336
+ def cancel(resource_group_name, deployment_name, custom_headers:nil)
337
+ response = cancel_async(resource_group_name, deployment_name, custom_headers:custom_headers).value!
338
+ nil
339
+ end
340
+
341
+ #
342
+ # Cancels a currently running template deployment.
343
+ #
344
+ # You can cancel a deployment only if the provisioningState is Accepted or
345
+ # Running. After the deployment is canceled, the provisioningState is set to
346
+ # Canceled. Canceling a template deployment stops the currently running
347
+ # template deployment and leaves the resource group partially deployed.
348
+ #
349
+ # @param resource_group_name [String] The name of the resource group. The name
350
+ # is case insensitive.
351
+ # @param deployment_name [String] The name of the deployment to cancel.
352
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
353
+ # will be added to the HTTP request.
354
+ #
355
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
356
+ #
357
+ def cancel_with_http_info(resource_group_name, deployment_name, custom_headers:nil)
358
+ cancel_async(resource_group_name, deployment_name, custom_headers:custom_headers).value!
359
+ end
360
+
361
+ #
362
+ # Cancels a currently running template deployment.
363
+ #
364
+ # You can cancel a deployment only if the provisioningState is Accepted or
365
+ # Running. After the deployment is canceled, the provisioningState is set to
366
+ # Canceled. Canceling a template deployment stops the currently running
367
+ # template deployment and leaves the resource group partially deployed.
368
+ #
369
+ # @param resource_group_name [String] The name of the resource group. The name
370
+ # is case insensitive.
371
+ # @param deployment_name [String] The name of the deployment to cancel.
372
+ # @param [Hash{String => String}] A hash of custom headers that will be added
373
+ # to the HTTP request.
374
+ #
375
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
376
+ #
377
+ def cancel_async(resource_group_name, deployment_name, custom_headers:nil)
378
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
379
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
380
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
381
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
382
+ fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
383
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
384
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
385
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
386
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
387
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
388
+
389
+
390
+ request_headers = {}
391
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
392
+
393
+ # Set Headers
394
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
395
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
396
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel'
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: {'resourceGroupName' => resource_group_name,'deploymentName' => deployment_name,'subscriptionId' => @client.subscription_id},
403
+ query_params: {'api-version' => @client.api_version},
404
+ headers: request_headers.merge(custom_headers || {}),
405
+ base_url: request_url
406
+ }
407
+ promise = @client.make_request_async(:post, path_template, options)
408
+
409
+ promise = promise.then do |result|
410
+ http_response = result.response
411
+ status_code = http_response.status
412
+ response_content = http_response.body
413
+ unless status_code == 204
414
+ error_model = JSON.load(response_content)
415
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
416
+ end
417
+
418
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
419
+
420
+ result
421
+ end
422
+
423
+ promise.execute
424
+ end
425
+
426
+ #
427
+ # Validates whether the specified template is syntactically correct and will be
428
+ # accepted by Azure Resource Manager..
429
+ #
430
+ # @param resource_group_name [String] The name of the resource group the
431
+ # template will be deployed to. The name is case insensitive.
432
+ # @param deployment_name [String] The name of the deployment.
433
+ # @param parameters [Deployment] Parameters to validate.
434
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
435
+ # will be added to the HTTP request.
436
+ #
437
+ # @return [DeploymentValidateResult] operation results.
438
+ #
439
+ def validate(resource_group_name, deployment_name, parameters, custom_headers:nil)
440
+ response = validate_async(resource_group_name, deployment_name, parameters, custom_headers:custom_headers).value!
441
+ response.body unless response.nil?
442
+ end
443
+
444
+ #
445
+ # Validates whether the specified template is syntactically correct and will be
446
+ # accepted by Azure Resource Manager..
447
+ #
448
+ # @param resource_group_name [String] The name of the resource group the
449
+ # template will be deployed to. The name is case insensitive.
450
+ # @param deployment_name [String] The name of the deployment.
451
+ # @param parameters [Deployment] Parameters to validate.
452
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
453
+ # will be added to the HTTP request.
454
+ #
455
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
456
+ #
457
+ def validate_with_http_info(resource_group_name, deployment_name, parameters, custom_headers:nil)
458
+ validate_async(resource_group_name, deployment_name, parameters, custom_headers:custom_headers).value!
459
+ end
460
+
461
+ #
462
+ # Validates whether the specified template is syntactically correct and will be
463
+ # accepted by Azure Resource Manager..
464
+ #
465
+ # @param resource_group_name [String] The name of the resource group the
466
+ # template will be deployed to. The name is case insensitive.
467
+ # @param deployment_name [String] The name of the deployment.
468
+ # @param parameters [Deployment] Parameters to validate.
469
+ # @param [Hash{String => String}] A hash of custom headers that will be added
470
+ # to the HTTP request.
471
+ #
472
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
473
+ #
474
+ def validate_async(resource_group_name, deployment_name, parameters, custom_headers:nil)
475
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
476
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
477
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
478
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
479
+ fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
480
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
481
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
482
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
483
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
484
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
485
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
486
+
487
+
488
+ request_headers = {}
489
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
490
+
491
+ # Set Headers
492
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
493
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
494
+
495
+ # Serialize Request
496
+ request_mapper = Azure::Resources::Mgmt::V2018_02_01::Models::Deployment.mapper()
497
+ request_content = @client.serialize(request_mapper, parameters)
498
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
499
+
500
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/validate'
501
+
502
+ request_url = @base_url || @client.base_url
503
+
504
+ options = {
505
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
506
+ path_params: {'resourceGroupName' => resource_group_name,'deploymentName' => deployment_name,'subscriptionId' => @client.subscription_id},
507
+ query_params: {'api-version' => @client.api_version},
508
+ body: request_content,
509
+ headers: request_headers.merge(custom_headers || {}),
510
+ base_url: request_url
511
+ }
512
+ promise = @client.make_request_async(:post, path_template, options)
513
+
514
+ promise = promise.then do |result|
515
+ http_response = result.response
516
+ status_code = http_response.status
517
+ response_content = http_response.body
518
+ unless status_code == 200 || status_code == 400
519
+ error_model = JSON.load(response_content)
520
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
521
+ end
522
+
523
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
524
+ # Deserialize Response
525
+ if status_code == 200
526
+ begin
527
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
528
+ result_mapper = Azure::Resources::Mgmt::V2018_02_01::Models::DeploymentValidateResult.mapper()
529
+ result.body = @client.deserialize(result_mapper, parsed_response)
530
+ rescue Exception => e
531
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
532
+ end
533
+ end
534
+ # Deserialize Response
535
+ if status_code == 400
536
+ begin
537
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
538
+ result_mapper = Azure::Resources::Mgmt::V2018_02_01::Models::DeploymentValidateResult.mapper()
539
+ result.body = @client.deserialize(result_mapper, parsed_response)
540
+ rescue Exception => e
541
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
542
+ end
543
+ end
544
+
545
+ result
546
+ end
547
+
548
+ promise.execute
549
+ end
550
+
551
+ #
552
+ # Exports the template used for specified deployment.
553
+ #
554
+ # @param resource_group_name [String] The name of the resource group. The name
555
+ # is case insensitive.
556
+ # @param deployment_name [String] The name of the deployment from which to get
557
+ # the template.
558
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
559
+ # will be added to the HTTP request.
560
+ #
561
+ # @return [DeploymentExportResult] operation results.
562
+ #
563
+ def export_template(resource_group_name, deployment_name, custom_headers:nil)
564
+ response = export_template_async(resource_group_name, deployment_name, custom_headers:custom_headers).value!
565
+ response.body unless response.nil?
566
+ end
567
+
568
+ #
569
+ # Exports the template used for specified deployment.
570
+ #
571
+ # @param resource_group_name [String] The name of the resource group. The name
572
+ # is case insensitive.
573
+ # @param deployment_name [String] The name of the deployment from which to get
574
+ # the template.
575
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
576
+ # will be added to the HTTP request.
577
+ #
578
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
579
+ #
580
+ def export_template_with_http_info(resource_group_name, deployment_name, custom_headers:nil)
581
+ export_template_async(resource_group_name, deployment_name, custom_headers:custom_headers).value!
582
+ end
583
+
584
+ #
585
+ # Exports the template used for specified deployment.
586
+ #
587
+ # @param resource_group_name [String] The name of the resource group. The name
588
+ # is case insensitive.
589
+ # @param deployment_name [String] The name of the deployment from which to get
590
+ # the template.
591
+ # @param [Hash{String => String}] A hash of custom headers that will be added
592
+ # to the HTTP request.
593
+ #
594
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
595
+ #
596
+ def export_template_async(resource_group_name, deployment_name, custom_headers:nil)
597
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
598
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
599
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
600
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
601
+ fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
602
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
603
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
604
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
605
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
606
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
607
+
608
+
609
+ request_headers = {}
610
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
611
+
612
+ # Set Headers
613
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
614
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
615
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate'
616
+
617
+ request_url = @base_url || @client.base_url
618
+
619
+ options = {
620
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
621
+ path_params: {'resourceGroupName' => resource_group_name,'deploymentName' => deployment_name,'subscriptionId' => @client.subscription_id},
622
+ query_params: {'api-version' => @client.api_version},
623
+ headers: request_headers.merge(custom_headers || {}),
624
+ base_url: request_url
625
+ }
626
+ promise = @client.make_request_async(:post, path_template, options)
627
+
628
+ promise = promise.then do |result|
629
+ http_response = result.response
630
+ status_code = http_response.status
631
+ response_content = http_response.body
632
+ unless status_code == 200
633
+ error_model = JSON.load(response_content)
634
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
635
+ end
636
+
637
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
638
+ # Deserialize Response
639
+ if status_code == 200
640
+ begin
641
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
642
+ result_mapper = Azure::Resources::Mgmt::V2018_02_01::Models::DeploymentExportResult.mapper()
643
+ result.body = @client.deserialize(result_mapper, parsed_response)
644
+ rescue Exception => e
645
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
646
+ end
647
+ end
648
+
649
+ result
650
+ end
651
+
652
+ promise.execute
653
+ end
654
+
655
+ #
656
+ # Get all the deployments for a resource group.
657
+ #
658
+ # @param resource_group_name [String] The name of the resource group with the
659
+ # deployments to get. The name is case insensitive.
660
+ # @param filter [String] The filter to apply on the operation. For example, you
661
+ # can use $filter=provisioningState eq '{state}'.
662
+ # @param top [Integer] The number of results to get. If null is passed, returns
663
+ # all deployments.
664
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
665
+ # will be added to the HTTP request.
666
+ #
667
+ # @return [Array<DeploymentExtended>] operation results.
668
+ #
669
+ def list_by_resource_group(resource_group_name, filter:nil, top:nil, custom_headers:nil)
670
+ first_page = list_by_resource_group_as_lazy(resource_group_name, filter:filter, top:top, custom_headers:custom_headers)
671
+ first_page.get_all_items
672
+ end
673
+
674
+ #
675
+ # Get all the deployments for a resource group.
676
+ #
677
+ # @param resource_group_name [String] The name of the resource group with the
678
+ # deployments to get. The name is case insensitive.
679
+ # @param filter [String] The filter to apply on the operation. For example, you
680
+ # can use $filter=provisioningState eq '{state}'.
681
+ # @param top [Integer] The number of results to get. If null is passed, returns
682
+ # all deployments.
683
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
684
+ # will be added to the HTTP request.
685
+ #
686
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
687
+ #
688
+ def list_by_resource_group_with_http_info(resource_group_name, filter:nil, top:nil, custom_headers:nil)
689
+ list_by_resource_group_async(resource_group_name, filter:filter, top:top, custom_headers:custom_headers).value!
690
+ end
691
+
692
+ #
693
+ # Get all the deployments for a resource group.
694
+ #
695
+ # @param resource_group_name [String] The name of the resource group with the
696
+ # deployments to get. The name is case insensitive.
697
+ # @param filter [String] The filter to apply on the operation. For example, you
698
+ # can use $filter=provisioningState eq '{state}'.
699
+ # @param top [Integer] The number of results to get. If null is passed, returns
700
+ # all deployments.
701
+ # @param [Hash{String => String}] A hash of custom headers that will be added
702
+ # to the HTTP request.
703
+ #
704
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
705
+ #
706
+ def list_by_resource_group_async(resource_group_name, filter:nil, top:nil, custom_headers:nil)
707
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
708
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
709
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
710
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
711
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
712
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
713
+
714
+
715
+ request_headers = {}
716
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
717
+
718
+ # Set Headers
719
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
720
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
721
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/'
722
+
723
+ request_url = @base_url || @client.base_url
724
+
725
+ options = {
726
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
727
+ path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
728
+ query_params: {'$filter' => filter,'$top' => top,'api-version' => @client.api_version},
729
+ headers: request_headers.merge(custom_headers || {}),
730
+ base_url: request_url
731
+ }
732
+ promise = @client.make_request_async(:get, path_template, options)
733
+
734
+ promise = promise.then do |result|
735
+ http_response = result.response
736
+ status_code = http_response.status
737
+ response_content = http_response.body
738
+ unless status_code == 200
739
+ error_model = JSON.load(response_content)
740
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
741
+ end
742
+
743
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
744
+ # Deserialize Response
745
+ if status_code == 200
746
+ begin
747
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
748
+ result_mapper = Azure::Resources::Mgmt::V2018_02_01::Models::DeploymentListResult.mapper()
749
+ result.body = @client.deserialize(result_mapper, parsed_response)
750
+ rescue Exception => e
751
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
752
+ end
753
+ end
754
+
755
+ result
756
+ end
757
+
758
+ promise.execute
759
+ end
760
+
761
+ #
762
+ # Deletes a deployment from the deployment history.
763
+ #
764
+ # A template deployment that is currently running cannot be deleted. Deleting a
765
+ # template deployment removes the associated deployment operations. Deleting a
766
+ # template deployment does not affect the state of the resource group. This is
767
+ # an asynchronous operation that returns a status of 202 until the template
768
+ # deployment is successfully deleted. The Location response header contains the
769
+ # URI that is used to obtain the status of the process. While the process is
770
+ # running, a call to the URI in the Location header returns a status of 202.
771
+ # When the process finishes, the URI in the Location header returns a status of
772
+ # 204 on success. If the asynchronous request failed, the URI in the Location
773
+ # header returns an error-level status code.
774
+ #
775
+ # @param resource_group_name [String] The name of the resource group with the
776
+ # deployment to delete. The name is case insensitive.
777
+ # @param deployment_name [String] The name of the deployment to delete.
778
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
779
+ # will be added to the HTTP request.
780
+ #
781
+ #
782
+ def begin_delete(resource_group_name, deployment_name, custom_headers:nil)
783
+ response = begin_delete_async(resource_group_name, deployment_name, custom_headers:custom_headers).value!
784
+ nil
785
+ end
786
+
787
+ #
788
+ # Deletes a deployment from the deployment history.
789
+ #
790
+ # A template deployment that is currently running cannot be deleted. Deleting a
791
+ # template deployment removes the associated deployment operations. Deleting a
792
+ # template deployment does not affect the state of the resource group. This is
793
+ # an asynchronous operation that returns a status of 202 until the template
794
+ # deployment is successfully deleted. The Location response header contains the
795
+ # URI that is used to obtain the status of the process. While the process is
796
+ # running, a call to the URI in the Location header returns a status of 202.
797
+ # When the process finishes, the URI in the Location header returns a status of
798
+ # 204 on success. If the asynchronous request failed, the URI in the Location
799
+ # header returns an error-level status code.
800
+ #
801
+ # @param resource_group_name [String] The name of the resource group with the
802
+ # deployment to delete. The name is case insensitive.
803
+ # @param deployment_name [String] The name of the deployment to delete.
804
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
805
+ # will be added to the HTTP request.
806
+ #
807
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
808
+ #
809
+ def begin_delete_with_http_info(resource_group_name, deployment_name, custom_headers:nil)
810
+ begin_delete_async(resource_group_name, deployment_name, custom_headers:custom_headers).value!
811
+ end
812
+
813
+ #
814
+ # Deletes a deployment from the deployment history.
815
+ #
816
+ # A template deployment that is currently running cannot be deleted. Deleting a
817
+ # template deployment removes the associated deployment operations. Deleting a
818
+ # template deployment does not affect the state of the resource group. This is
819
+ # an asynchronous operation that returns a status of 202 until the template
820
+ # deployment is successfully deleted. The Location response header contains the
821
+ # URI that is used to obtain the status of the process. While the process is
822
+ # running, a call to the URI in the Location header returns a status of 202.
823
+ # When the process finishes, the URI in the Location header returns a status of
824
+ # 204 on success. If the asynchronous request failed, the URI in the Location
825
+ # header returns an error-level status code.
826
+ #
827
+ # @param resource_group_name [String] The name of the resource group with the
828
+ # deployment to delete. The name is case insensitive.
829
+ # @param deployment_name [String] The name of the deployment to delete.
830
+ # @param [Hash{String => String}] A hash of custom headers that will be added
831
+ # to the HTTP request.
832
+ #
833
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
834
+ #
835
+ def begin_delete_async(resource_group_name, deployment_name, custom_headers:nil)
836
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
837
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
838
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
839
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
840
+ fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
841
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
842
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
843
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
844
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
845
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
846
+
847
+
848
+ request_headers = {}
849
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
850
+
851
+ # Set Headers
852
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
853
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
854
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}'
855
+
856
+ request_url = @base_url || @client.base_url
857
+
858
+ options = {
859
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
860
+ path_params: {'resourceGroupName' => resource_group_name,'deploymentName' => deployment_name,'subscriptionId' => @client.subscription_id},
861
+ query_params: {'api-version' => @client.api_version},
862
+ headers: request_headers.merge(custom_headers || {}),
863
+ base_url: request_url
864
+ }
865
+ promise = @client.make_request_async(:delete, path_template, options)
866
+
867
+ promise = promise.then do |result|
868
+ http_response = result.response
869
+ status_code = http_response.status
870
+ response_content = http_response.body
871
+ unless status_code == 202 || status_code == 204
872
+ error_model = JSON.load(response_content)
873
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
874
+ end
875
+
876
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
877
+
878
+ result
879
+ end
880
+
881
+ promise.execute
882
+ end
883
+
884
+ #
885
+ # Deploys resources to a resource group.
886
+ #
887
+ # You can provide the template and parameters directly in the request or link
888
+ # to JSON files.
889
+ #
890
+ # @param resource_group_name [String] The name of the resource group to deploy
891
+ # the resources to. The name is case insensitive. The resource group must
892
+ # already exist.
893
+ # @param deployment_name [String] The name of the deployment.
894
+ # @param parameters [Deployment] Additional parameters supplied to the
895
+ # 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 [DeploymentExtended] operation results.
900
+ #
901
+ def begin_create_or_update(resource_group_name, deployment_name, parameters, custom_headers:nil)
902
+ response = begin_create_or_update_async(resource_group_name, deployment_name, parameters, custom_headers:custom_headers).value!
903
+ response.body unless response.nil?
904
+ end
905
+
906
+ #
907
+ # Deploys resources to a resource group.
908
+ #
909
+ # You can provide the template and parameters directly in the request or link
910
+ # to JSON files.
911
+ #
912
+ # @param resource_group_name [String] The name of the resource group to deploy
913
+ # the resources to. The name is case insensitive. The resource group must
914
+ # already exist.
915
+ # @param deployment_name [String] The name of the deployment.
916
+ # @param parameters [Deployment] Additional parameters supplied to the
917
+ # operation.
918
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
919
+ # will be added to the HTTP request.
920
+ #
921
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
922
+ #
923
+ def begin_create_or_update_with_http_info(resource_group_name, deployment_name, parameters, custom_headers:nil)
924
+ begin_create_or_update_async(resource_group_name, deployment_name, parameters, custom_headers:custom_headers).value!
925
+ end
926
+
927
+ #
928
+ # Deploys resources to a resource group.
929
+ #
930
+ # You can provide the template and parameters directly in the request or link
931
+ # to JSON files.
932
+ #
933
+ # @param resource_group_name [String] The name of the resource group to deploy
934
+ # the resources to. The name is case insensitive. The resource group must
935
+ # already exist.
936
+ # @param deployment_name [String] The name of the deployment.
937
+ # @param parameters [Deployment] Additional parameters supplied to the
938
+ # operation.
939
+ # @param [Hash{String => String}] A hash of custom headers that will be added
940
+ # to the HTTP request.
941
+ #
942
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
943
+ #
944
+ def begin_create_or_update_async(resource_group_name, deployment_name, parameters, custom_headers:nil)
945
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
946
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
947
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
948
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
949
+ fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
950
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
951
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
952
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
953
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
954
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
955
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
956
+
957
+
958
+ request_headers = {}
959
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
960
+
961
+ # Set Headers
962
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
963
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
964
+
965
+ # Serialize Request
966
+ request_mapper = Azure::Resources::Mgmt::V2018_02_01::Models::Deployment.mapper()
967
+ request_content = @client.serialize(request_mapper, parameters)
968
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
969
+
970
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}'
971
+
972
+ request_url = @base_url || @client.base_url
973
+
974
+ options = {
975
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
976
+ path_params: {'resourceGroupName' => resource_group_name,'deploymentName' => deployment_name,'subscriptionId' => @client.subscription_id},
977
+ query_params: {'api-version' => @client.api_version},
978
+ body: request_content,
979
+ headers: request_headers.merge(custom_headers || {}),
980
+ base_url: request_url
981
+ }
982
+ promise = @client.make_request_async(:put, path_template, options)
983
+
984
+ promise = promise.then do |result|
985
+ http_response = result.response
986
+ status_code = http_response.status
987
+ response_content = http_response.body
988
+ unless status_code == 200 || status_code == 201
989
+ error_model = JSON.load(response_content)
990
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
991
+ end
992
+
993
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
994
+ # Deserialize Response
995
+ if status_code == 200
996
+ begin
997
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
998
+ result_mapper = Azure::Resources::Mgmt::V2018_02_01::Models::DeploymentExtended.mapper()
999
+ result.body = @client.deserialize(result_mapper, parsed_response)
1000
+ rescue Exception => e
1001
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1002
+ end
1003
+ end
1004
+ # Deserialize Response
1005
+ if status_code == 201
1006
+ begin
1007
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1008
+ result_mapper = Azure::Resources::Mgmt::V2018_02_01::Models::DeploymentExtended.mapper()
1009
+ result.body = @client.deserialize(result_mapper, parsed_response)
1010
+ rescue Exception => e
1011
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1012
+ end
1013
+ end
1014
+
1015
+ result
1016
+ end
1017
+
1018
+ promise.execute
1019
+ end
1020
+
1021
+ #
1022
+ # Get all the deployments for a resource group.
1023
+ #
1024
+ # @param next_page_link [String] The NextLink from the previous successful call
1025
+ # to List operation.
1026
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1027
+ # will be added to the HTTP request.
1028
+ #
1029
+ # @return [DeploymentListResult] operation results.
1030
+ #
1031
+ def list_by_resource_group_next(next_page_link, custom_headers:nil)
1032
+ response = list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
1033
+ response.body unless response.nil?
1034
+ end
1035
+
1036
+ #
1037
+ # Get all the deployments for a resource group.
1038
+ #
1039
+ # @param next_page_link [String] The NextLink from the previous successful call
1040
+ # to List operation.
1041
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1042
+ # will be added to the HTTP request.
1043
+ #
1044
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1045
+ #
1046
+ def list_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil)
1047
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
1048
+ end
1049
+
1050
+ #
1051
+ # Get all the deployments for a resource group.
1052
+ #
1053
+ # @param next_page_link [String] The NextLink from the previous successful call
1054
+ # to List operation.
1055
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1056
+ # to the HTTP request.
1057
+ #
1058
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1059
+ #
1060
+ def list_by_resource_group_next_async(next_page_link, custom_headers:nil)
1061
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1062
+
1063
+
1064
+ request_headers = {}
1065
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1066
+
1067
+ # Set Headers
1068
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1069
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1070
+ path_template = '{nextLink}'
1071
+
1072
+ request_url = @base_url || @client.base_url
1073
+
1074
+ options = {
1075
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1076
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1077
+ headers: request_headers.merge(custom_headers || {}),
1078
+ base_url: request_url
1079
+ }
1080
+ promise = @client.make_request_async(:get, path_template, options)
1081
+
1082
+ promise = promise.then do |result|
1083
+ http_response = result.response
1084
+ status_code = http_response.status
1085
+ response_content = http_response.body
1086
+ unless status_code == 200
1087
+ error_model = JSON.load(response_content)
1088
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1089
+ end
1090
+
1091
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1092
+ # Deserialize Response
1093
+ if status_code == 200
1094
+ begin
1095
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1096
+ result_mapper = Azure::Resources::Mgmt::V2018_02_01::Models::DeploymentListResult.mapper()
1097
+ result.body = @client.deserialize(result_mapper, parsed_response)
1098
+ rescue Exception => e
1099
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1100
+ end
1101
+ end
1102
+
1103
+ result
1104
+ end
1105
+
1106
+ promise.execute
1107
+ end
1108
+
1109
+ #
1110
+ # Get all the deployments for a resource group.
1111
+ #
1112
+ # @param resource_group_name [String] The name of the resource group with the
1113
+ # deployments to get. The name is case insensitive.
1114
+ # @param filter [String] The filter to apply on the operation. For example, you
1115
+ # can use $filter=provisioningState eq '{state}'.
1116
+ # @param top [Integer] The number of results to get. If null is passed, returns
1117
+ # all deployments.
1118
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1119
+ # will be added to the HTTP request.
1120
+ #
1121
+ # @return [DeploymentListResult] which provide lazy access to pages of the
1122
+ # response.
1123
+ #
1124
+ def list_by_resource_group_as_lazy(resource_group_name, filter:nil, top:nil, custom_headers:nil)
1125
+ response = list_by_resource_group_async(resource_group_name, filter:filter, top:top, custom_headers:custom_headers).value!
1126
+ unless response.nil?
1127
+ page = response.body
1128
+ page.next_method = Proc.new do |next_page_link|
1129
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers)
1130
+ end
1131
+ page
1132
+ end
1133
+ end
1134
+
1135
+ end
1136
+ end