azure_mgmt_portal 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/lib/2015-08-01-preview/generated/azure_mgmt_portal.rb +40 -0
  4. data/lib/2015-08-01-preview/generated/azure_mgmt_portal/dashboards.rb +830 -0
  5. data/lib/2015-08-01-preview/generated/azure_mgmt_portal/models/dashboard.rb +140 -0
  6. data/lib/2015-08-01-preview/generated/azure_mgmt_portal/models/dashboard_lens.rb +85 -0
  7. data/lib/2015-08-01-preview/generated/azure_mgmt_portal/models/dashboard_list_result.rb +99 -0
  8. data/lib/2015-08-01-preview/generated/azure_mgmt_portal/models/dashboard_parts.rb +66 -0
  9. data/lib/2015-08-01-preview/generated/azure_mgmt_portal/models/dashboard_parts_position.rb +98 -0
  10. data/lib/2015-08-01-preview/generated/azure_mgmt_portal/models/error_definition.rb +81 -0
  11. data/lib/2015-08-01-preview/generated/azure_mgmt_portal/models/error_response.rb +47 -0
  12. data/lib/2015-08-01-preview/generated/azure_mgmt_portal/models/patchable_dashboard.rb +93 -0
  13. data/lib/2015-08-01-preview/generated/azure_mgmt_portal/models/resource_provider_operation.rb +71 -0
  14. data/lib/2015-08-01-preview/generated/azure_mgmt_portal/models/resource_provider_operation_display.rb +79 -0
  15. data/lib/2015-08-01-preview/generated/azure_mgmt_portal/models/resource_provider_operation_list.rb +99 -0
  16. data/lib/2015-08-01-preview/generated/azure_mgmt_portal/module_definition.rb +9 -0
  17. data/lib/2015-08-01-preview/generated/azure_mgmt_portal/operations.rb +219 -0
  18. data/lib/2015-08-01-preview/generated/azure_mgmt_portal/portal_client.rb +136 -0
  19. data/lib/2018-10-01-preview/generated/azure_mgmt_portal.rb +40 -0
  20. data/lib/2018-10-01-preview/generated/azure_mgmt_portal/dashboards.rb +830 -0
  21. data/lib/2018-10-01-preview/generated/azure_mgmt_portal/models/dashboard.rb +140 -0
  22. data/lib/2018-10-01-preview/generated/azure_mgmt_portal/models/dashboard_lens.rb +85 -0
  23. data/lib/2018-10-01-preview/generated/azure_mgmt_portal/models/dashboard_list_result.rb +99 -0
  24. data/lib/2018-10-01-preview/generated/azure_mgmt_portal/models/dashboard_parts.rb +66 -0
  25. data/lib/2018-10-01-preview/generated/azure_mgmt_portal/models/dashboard_parts_position.rb +98 -0
  26. data/lib/2018-10-01-preview/generated/azure_mgmt_portal/models/error_definition.rb +81 -0
  27. data/lib/2018-10-01-preview/generated/azure_mgmt_portal/models/error_response.rb +47 -0
  28. data/lib/2018-10-01-preview/generated/azure_mgmt_portal/models/patchable_dashboard.rb +93 -0
  29. data/lib/2018-10-01-preview/generated/azure_mgmt_portal/models/resource_provider_operation.rb +71 -0
  30. data/lib/2018-10-01-preview/generated/azure_mgmt_portal/models/resource_provider_operation_display.rb +79 -0
  31. data/lib/2018-10-01-preview/generated/azure_mgmt_portal/models/resource_provider_operation_list.rb +99 -0
  32. data/lib/2018-10-01-preview/generated/azure_mgmt_portal/module_definition.rb +9 -0
  33. data/lib/2018-10-01-preview/generated/azure_mgmt_portal/operations.rb +219 -0
  34. data/lib/2018-10-01-preview/generated/azure_mgmt_portal/portal_client.rb +136 -0
  35. data/lib/2019-01-01-preview/generated/azure_mgmt_portal.rb +40 -0
  36. data/lib/2019-01-01-preview/generated/azure_mgmt_portal/dashboards.rb +830 -0
  37. data/lib/2019-01-01-preview/generated/azure_mgmt_portal/models/dashboard.rb +140 -0
  38. data/lib/2019-01-01-preview/generated/azure_mgmt_portal/models/dashboard_lens.rb +85 -0
  39. data/lib/2019-01-01-preview/generated/azure_mgmt_portal/models/dashboard_list_result.rb +99 -0
  40. data/lib/2019-01-01-preview/generated/azure_mgmt_portal/models/dashboard_parts.rb +66 -0
  41. data/lib/2019-01-01-preview/generated/azure_mgmt_portal/models/dashboard_parts_position.rb +98 -0
  42. data/lib/2019-01-01-preview/generated/azure_mgmt_portal/models/error_definition.rb +81 -0
  43. data/lib/2019-01-01-preview/generated/azure_mgmt_portal/models/error_response.rb +47 -0
  44. data/lib/2019-01-01-preview/generated/azure_mgmt_portal/models/patchable_dashboard.rb +93 -0
  45. data/lib/2019-01-01-preview/generated/azure_mgmt_portal/models/resource_provider_operation.rb +71 -0
  46. data/lib/2019-01-01-preview/generated/azure_mgmt_portal/models/resource_provider_operation_display.rb +79 -0
  47. data/lib/2019-01-01-preview/generated/azure_mgmt_portal/models/resource_provider_operation_list.rb +99 -0
  48. data/lib/2019-01-01-preview/generated/azure_mgmt_portal/module_definition.rb +9 -0
  49. data/lib/2019-01-01-preview/generated/azure_mgmt_portal/operations.rb +219 -0
  50. data/lib/2019-01-01-preview/generated/azure_mgmt_portal/portal_client.rb +136 -0
  51. data/lib/azure_mgmt_portal.rb +7 -0
  52. data/lib/module_definition.rb +7 -0
  53. data/lib/version.rb +7 -0
  54. metadata +169 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: d123ce1aa9023394c89fbfbf7887ac17d62856f8
4
+ data.tar.gz: 16affa49c5e2f8fb1f362efc6327580f9f301d43
5
+ SHA512:
6
+ metadata.gz: 321da5de98834b890d06debf1ed26b52c17ae90d58944ba34c5eff209a434928f8f959139edb87255a26aebc3ea07829b1c83a8df8552d6e2933756f48d30a67
7
+ data.tar.gz: 2686e26b1cd36264bfc8edd4ad450368b20d554f5a7708bcee3ad57f43457295876c4366fb6c784dd335c6224b1d7c225205fbf729763556bfe060ffc71fd98d
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Microsoft Corporation
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,40 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ require 'uri'
7
+ require 'cgi'
8
+ require 'date'
9
+ require 'json'
10
+ require 'base64'
11
+ require 'erb'
12
+ require 'securerandom'
13
+ require 'time'
14
+ require 'timeliness'
15
+ require 'faraday'
16
+ require 'faraday-cookie_jar'
17
+ require 'concurrent'
18
+ require 'ms_rest'
19
+ require '2015-08-01-preview/generated/azure_mgmt_portal/module_definition'
20
+ require 'ms_rest_azure'
21
+
22
+ module Azure::Portal::Mgmt::V2015_08_01_preview
23
+ autoload :Operations, '2015-08-01-preview/generated/azure_mgmt_portal/operations.rb'
24
+ autoload :Dashboards, '2015-08-01-preview/generated/azure_mgmt_portal/dashboards.rb'
25
+ autoload :PortalClient, '2015-08-01-preview/generated/azure_mgmt_portal/portal_client.rb'
26
+
27
+ module Models
28
+ autoload :PatchableDashboard, '2015-08-01-preview/generated/azure_mgmt_portal/models/patchable_dashboard.rb'
29
+ autoload :ResourceProviderOperationDisplay, '2015-08-01-preview/generated/azure_mgmt_portal/models/resource_provider_operation_display.rb'
30
+ autoload :DashboardParts, '2015-08-01-preview/generated/azure_mgmt_portal/models/dashboard_parts.rb'
31
+ autoload :ResourceProviderOperation, '2015-08-01-preview/generated/azure_mgmt_portal/models/resource_provider_operation.rb'
32
+ autoload :Dashboard, '2015-08-01-preview/generated/azure_mgmt_portal/models/dashboard.rb'
33
+ autoload :ResourceProviderOperationList, '2015-08-01-preview/generated/azure_mgmt_portal/models/resource_provider_operation_list.rb'
34
+ autoload :DashboardPartsPosition, '2015-08-01-preview/generated/azure_mgmt_portal/models/dashboard_parts_position.rb'
35
+ autoload :ErrorDefinition, '2015-08-01-preview/generated/azure_mgmt_portal/models/error_definition.rb'
36
+ autoload :DashboardListResult, '2015-08-01-preview/generated/azure_mgmt_portal/models/dashboard_list_result.rb'
37
+ autoload :ErrorResponse, '2015-08-01-preview/generated/azure_mgmt_portal/models/error_response.rb'
38
+ autoload :DashboardLens, '2015-08-01-preview/generated/azure_mgmt_portal/models/dashboard_lens.rb'
39
+ end
40
+ end
@@ -0,0 +1,830 @@
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::Portal::Mgmt::V2015_08_01_preview
7
+ #
8
+ # Allows creation and deletion of Azure Shared Dashboards.
9
+ #
10
+ class Dashboards
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Dashboards class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [PortalClient] reference to the PortalClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Creates or updates a Dashboard.
26
+ #
27
+ # @param resource_group_name [String] The name of the resource group.
28
+ # @param dashboard_name [String] The name of the dashboard.
29
+ # @param dashboard [Dashboard] The parameters required to create or update a
30
+ # dashboard.
31
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
32
+ # will be added to the HTTP request.
33
+ #
34
+ # @return [Dashboard] operation results.
35
+ #
36
+ def create_or_update(resource_group_name, dashboard_name, dashboard, custom_headers:nil)
37
+ response = create_or_update_async(resource_group_name, dashboard_name, dashboard, custom_headers:custom_headers).value!
38
+ response.body unless response.nil?
39
+ end
40
+
41
+ #
42
+ # Creates or updates a Dashboard.
43
+ #
44
+ # @param resource_group_name [String] The name of the resource group.
45
+ # @param dashboard_name [String] The name of the dashboard.
46
+ # @param dashboard [Dashboard] The parameters required to create or update a
47
+ # dashboard.
48
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
49
+ # will be added to the HTTP request.
50
+ #
51
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
52
+ #
53
+ def create_or_update_with_http_info(resource_group_name, dashboard_name, dashboard, custom_headers:nil)
54
+ create_or_update_async(resource_group_name, dashboard_name, dashboard, custom_headers:custom_headers).value!
55
+ end
56
+
57
+ #
58
+ # Creates or updates a Dashboard.
59
+ #
60
+ # @param resource_group_name [String] The name of the resource group.
61
+ # @param dashboard_name [String] The name of the dashboard.
62
+ # @param dashboard [Dashboard] The parameters required to create or update a
63
+ # dashboard.
64
+ # @param [Hash{String => String}] A hash of custom headers that will be added
65
+ # to the HTTP request.
66
+ #
67
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
68
+ #
69
+ def create_or_update_async(resource_group_name, dashboard_name, dashboard, custom_headers:nil)
70
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
71
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
72
+ fail ArgumentError, 'dashboard_name is nil' if dashboard_name.nil?
73
+ fail ArgumentError, "'dashboard_name' should satisfy the constraint - 'MaxLength': '64'" if !dashboard_name.nil? && dashboard_name.length > 64
74
+ fail ArgumentError, "'dashboard_name' should satisfy the constraint - 'MinLength': '3'" if !dashboard_name.nil? && dashboard_name.length < 3
75
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
76
+ fail ArgumentError, 'dashboard is nil' if dashboard.nil?
77
+
78
+
79
+ request_headers = {}
80
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
81
+
82
+ # Set Headers
83
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
84
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
85
+
86
+ # Serialize Request
87
+ request_mapper = Azure::Portal::Mgmt::V2015_08_01_preview::Models::Dashboard.mapper()
88
+ request_content = @client.serialize(request_mapper, dashboard)
89
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
90
+
91
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Portal/dashboards/{dashboardName}'
92
+
93
+ request_url = @base_url || @client.base_url
94
+
95
+ options = {
96
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
97
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'dashboardName' => dashboard_name},
98
+ query_params: {'api-version' => @client.api_version},
99
+ body: request_content,
100
+ headers: request_headers.merge(custom_headers || {}),
101
+ base_url: request_url
102
+ }
103
+ promise = @client.make_request_async(:put, path_template, options)
104
+
105
+ promise = promise.then do |result|
106
+ http_response = result.response
107
+ status_code = http_response.status
108
+ response_content = http_response.body
109
+ unless status_code == 201 || status_code == 200
110
+ error_model = JSON.load(response_content)
111
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
112
+ end
113
+
114
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
115
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
116
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
117
+ # Deserialize Response
118
+ if status_code == 201
119
+ begin
120
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
121
+ result_mapper = Azure::Portal::Mgmt::V2015_08_01_preview::Models::Dashboard.mapper()
122
+ result.body = @client.deserialize(result_mapper, parsed_response)
123
+ rescue Exception => e
124
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
125
+ end
126
+ end
127
+ # Deserialize Response
128
+ if status_code == 200
129
+ begin
130
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
131
+ result_mapper = Azure::Portal::Mgmt::V2015_08_01_preview::Models::Dashboard.mapper()
132
+ result.body = @client.deserialize(result_mapper, parsed_response)
133
+ rescue Exception => e
134
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
135
+ end
136
+ end
137
+
138
+ result
139
+ end
140
+
141
+ promise.execute
142
+ end
143
+
144
+ #
145
+ # Deletes the Dashboard.
146
+ #
147
+ # @param resource_group_name [String] The name of the resource group.
148
+ # @param dashboard_name [String] The name of the dashboard.
149
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
150
+ # will be added to the HTTP request.
151
+ #
152
+ #
153
+ def delete(resource_group_name, dashboard_name, custom_headers:nil)
154
+ response = delete_async(resource_group_name, dashboard_name, custom_headers:custom_headers).value!
155
+ nil
156
+ end
157
+
158
+ #
159
+ # Deletes the Dashboard.
160
+ #
161
+ # @param resource_group_name [String] The name of the resource group.
162
+ # @param dashboard_name [String] The name of the dashboard.
163
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
164
+ # will be added to the HTTP request.
165
+ #
166
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
167
+ #
168
+ def delete_with_http_info(resource_group_name, dashboard_name, custom_headers:nil)
169
+ delete_async(resource_group_name, dashboard_name, custom_headers:custom_headers).value!
170
+ end
171
+
172
+ #
173
+ # Deletes the Dashboard.
174
+ #
175
+ # @param resource_group_name [String] The name of the resource group.
176
+ # @param dashboard_name [String] The name of the dashboard.
177
+ # @param [Hash{String => String}] A hash of custom headers that will be added
178
+ # to the HTTP request.
179
+ #
180
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
181
+ #
182
+ def delete_async(resource_group_name, dashboard_name, custom_headers:nil)
183
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
184
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
185
+ fail ArgumentError, 'dashboard_name is nil' if dashboard_name.nil?
186
+ fail ArgumentError, "'dashboard_name' should satisfy the constraint - 'MaxLength': '64'" if !dashboard_name.nil? && dashboard_name.length > 64
187
+ fail ArgumentError, "'dashboard_name' should satisfy the constraint - 'MinLength': '3'" if !dashboard_name.nil? && dashboard_name.length < 3
188
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
189
+
190
+
191
+ request_headers = {}
192
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
193
+
194
+ # Set Headers
195
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
196
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
197
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Portal/dashboards/{dashboardName}'
198
+
199
+ request_url = @base_url || @client.base_url
200
+
201
+ options = {
202
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
203
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'dashboardName' => dashboard_name},
204
+ query_params: {'api-version' => @client.api_version},
205
+ headers: request_headers.merge(custom_headers || {}),
206
+ base_url: request_url
207
+ }
208
+ promise = @client.make_request_async(:delete, path_template, options)
209
+
210
+ promise = promise.then do |result|
211
+ http_response = result.response
212
+ status_code = http_response.status
213
+ response_content = http_response.body
214
+ unless status_code == 200 || status_code == 204
215
+ error_model = JSON.load(response_content)
216
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
217
+ end
218
+
219
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
220
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
221
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
222
+
223
+ result
224
+ end
225
+
226
+ promise.execute
227
+ end
228
+
229
+ #
230
+ # Gets the Dashboard.
231
+ #
232
+ # @param resource_group_name [String] The name of the resource group.
233
+ # @param dashboard_name [String] The name of the dashboard.
234
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
235
+ # will be added to the HTTP request.
236
+ #
237
+ # @return [Dashboard] operation results.
238
+ #
239
+ def get(resource_group_name, dashboard_name, custom_headers:nil)
240
+ response = get_async(resource_group_name, dashboard_name, custom_headers:custom_headers).value!
241
+ response.body unless response.nil?
242
+ end
243
+
244
+ #
245
+ # Gets the Dashboard.
246
+ #
247
+ # @param resource_group_name [String] The name of the resource group.
248
+ # @param dashboard_name [String] The name of the dashboard.
249
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
250
+ # will be added to the HTTP request.
251
+ #
252
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
253
+ #
254
+ def get_with_http_info(resource_group_name, dashboard_name, custom_headers:nil)
255
+ get_async(resource_group_name, dashboard_name, custom_headers:custom_headers).value!
256
+ end
257
+
258
+ #
259
+ # Gets the Dashboard.
260
+ #
261
+ # @param resource_group_name [String] The name of the resource group.
262
+ # @param dashboard_name [String] The name of the dashboard.
263
+ # @param [Hash{String => String}] A hash of custom headers that will be added
264
+ # to the HTTP request.
265
+ #
266
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
267
+ #
268
+ def get_async(resource_group_name, dashboard_name, custom_headers:nil)
269
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
270
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
271
+ fail ArgumentError, 'dashboard_name is nil' if dashboard_name.nil?
272
+ fail ArgumentError, "'dashboard_name' should satisfy the constraint - 'MaxLength': '64'" if !dashboard_name.nil? && dashboard_name.length > 64
273
+ fail ArgumentError, "'dashboard_name' should satisfy the constraint - 'MinLength': '3'" if !dashboard_name.nil? && dashboard_name.length < 3
274
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
275
+
276
+
277
+ request_headers = {}
278
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
279
+
280
+ # Set Headers
281
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
282
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
283
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Portal/dashboards/{dashboardName}'
284
+
285
+ request_url = @base_url || @client.base_url
286
+
287
+ options = {
288
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
289
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'dashboardName' => dashboard_name},
290
+ query_params: {'api-version' => @client.api_version},
291
+ headers: request_headers.merge(custom_headers || {}),
292
+ base_url: request_url
293
+ }
294
+ promise = @client.make_request_async(:get, path_template, options)
295
+
296
+ promise = promise.then do |result|
297
+ http_response = result.response
298
+ status_code = http_response.status
299
+ response_content = http_response.body
300
+ unless status_code == 200
301
+ error_model = JSON.load(response_content)
302
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
303
+ end
304
+
305
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
306
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
307
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
308
+ # Deserialize Response
309
+ if status_code == 200
310
+ begin
311
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
312
+ result_mapper = Azure::Portal::Mgmt::V2015_08_01_preview::Models::Dashboard.mapper()
313
+ result.body = @client.deserialize(result_mapper, parsed_response)
314
+ rescue Exception => e
315
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
316
+ end
317
+ end
318
+
319
+ result
320
+ end
321
+
322
+ promise.execute
323
+ end
324
+
325
+ #
326
+ # Updates an existing Dashboard.
327
+ #
328
+ # @param resource_group_name [String] The name of the resource group.
329
+ # @param dashboard_name [String] The name of the dashboard.
330
+ # @param dashboard [PatchableDashboard] The updatable fields of a Dashboard.
331
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
332
+ # will be added to the HTTP request.
333
+ #
334
+ # @return [Dashboard] operation results.
335
+ #
336
+ def update(resource_group_name, dashboard_name, dashboard, custom_headers:nil)
337
+ response = update_async(resource_group_name, dashboard_name, dashboard, custom_headers:custom_headers).value!
338
+ response.body unless response.nil?
339
+ end
340
+
341
+ #
342
+ # Updates an existing Dashboard.
343
+ #
344
+ # @param resource_group_name [String] The name of the resource group.
345
+ # @param dashboard_name [String] The name of the dashboard.
346
+ # @param dashboard [PatchableDashboard] The updatable fields of a Dashboard.
347
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
348
+ # will be added to the HTTP request.
349
+ #
350
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
351
+ #
352
+ def update_with_http_info(resource_group_name, dashboard_name, dashboard, custom_headers:nil)
353
+ update_async(resource_group_name, dashboard_name, dashboard, custom_headers:custom_headers).value!
354
+ end
355
+
356
+ #
357
+ # Updates an existing Dashboard.
358
+ #
359
+ # @param resource_group_name [String] The name of the resource group.
360
+ # @param dashboard_name [String] The name of the dashboard.
361
+ # @param dashboard [PatchableDashboard] The updatable fields of a Dashboard.
362
+ # @param [Hash{String => String}] A hash of custom headers that will be added
363
+ # to the HTTP request.
364
+ #
365
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
366
+ #
367
+ def update_async(resource_group_name, dashboard_name, dashboard, custom_headers:nil)
368
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
369
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
370
+ fail ArgumentError, 'dashboard_name is nil' if dashboard_name.nil?
371
+ fail ArgumentError, "'dashboard_name' should satisfy the constraint - 'MaxLength': '64'" if !dashboard_name.nil? && dashboard_name.length > 64
372
+ fail ArgumentError, "'dashboard_name' should satisfy the constraint - 'MinLength': '3'" if !dashboard_name.nil? && dashboard_name.length < 3
373
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
374
+ fail ArgumentError, 'dashboard is nil' if dashboard.nil?
375
+
376
+
377
+ request_headers = {}
378
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
379
+
380
+ # Set Headers
381
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
382
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
383
+
384
+ # Serialize Request
385
+ request_mapper = Azure::Portal::Mgmt::V2015_08_01_preview::Models::PatchableDashboard.mapper()
386
+ request_content = @client.serialize(request_mapper, dashboard)
387
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
388
+
389
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Portal/dashboards/{dashboardName}'
390
+
391
+ request_url = @base_url || @client.base_url
392
+
393
+ options = {
394
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
395
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'dashboardName' => dashboard_name},
396
+ query_params: {'api-version' => @client.api_version},
397
+ body: request_content,
398
+ headers: request_headers.merge(custom_headers || {}),
399
+ base_url: request_url
400
+ }
401
+ promise = @client.make_request_async(:patch, path_template, options)
402
+
403
+ promise = promise.then do |result|
404
+ http_response = result.response
405
+ status_code = http_response.status
406
+ response_content = http_response.body
407
+ unless status_code == 200
408
+ error_model = JSON.load(response_content)
409
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
410
+ end
411
+
412
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
413
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
414
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
415
+ # Deserialize Response
416
+ if status_code == 200
417
+ begin
418
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
419
+ result_mapper = Azure::Portal::Mgmt::V2015_08_01_preview::Models::Dashboard.mapper()
420
+ result.body = @client.deserialize(result_mapper, parsed_response)
421
+ rescue Exception => e
422
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
423
+ end
424
+ end
425
+
426
+ result
427
+ end
428
+
429
+ promise.execute
430
+ end
431
+
432
+ #
433
+ # Gets all the Dashboards within a resource group.
434
+ #
435
+ # @param resource_group_name [String] The name of the resource group.
436
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
437
+ # will be added to the HTTP request.
438
+ #
439
+ # @return [Array<Dashboard>] operation results.
440
+ #
441
+ def list_by_resource_group(resource_group_name, custom_headers:nil)
442
+ first_page = list_by_resource_group_as_lazy(resource_group_name, custom_headers:custom_headers)
443
+ first_page.get_all_items
444
+ end
445
+
446
+ #
447
+ # Gets all the Dashboards within a resource group.
448
+ #
449
+ # @param resource_group_name [String] The name of the resource group.
450
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
451
+ # will be added to the HTTP request.
452
+ #
453
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
454
+ #
455
+ def list_by_resource_group_with_http_info(resource_group_name, custom_headers:nil)
456
+ list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
457
+ end
458
+
459
+ #
460
+ # Gets all the Dashboards within a resource group.
461
+ #
462
+ # @param resource_group_name [String] The name of the resource group.
463
+ # @param [Hash{String => String}] A hash of custom headers that will be added
464
+ # to the HTTP request.
465
+ #
466
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
467
+ #
468
+ def list_by_resource_group_async(resource_group_name, custom_headers:nil)
469
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
470
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
471
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
472
+
473
+
474
+ request_headers = {}
475
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
476
+
477
+ # Set Headers
478
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
479
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
480
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Portal/dashboards'
481
+
482
+ request_url = @base_url || @client.base_url
483
+
484
+ options = {
485
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
486
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
487
+ query_params: {'api-version' => @client.api_version},
488
+ headers: request_headers.merge(custom_headers || {}),
489
+ base_url: request_url
490
+ }
491
+ promise = @client.make_request_async(:get, path_template, options)
492
+
493
+ promise = promise.then do |result|
494
+ http_response = result.response
495
+ status_code = http_response.status
496
+ response_content = http_response.body
497
+ unless status_code == 200
498
+ error_model = JSON.load(response_content)
499
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
500
+ end
501
+
502
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
503
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
504
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
505
+ # Deserialize Response
506
+ if status_code == 200
507
+ begin
508
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
509
+ result_mapper = Azure::Portal::Mgmt::V2015_08_01_preview::Models::DashboardListResult.mapper()
510
+ result.body = @client.deserialize(result_mapper, parsed_response)
511
+ rescue Exception => e
512
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
513
+ end
514
+ end
515
+
516
+ result
517
+ end
518
+
519
+ promise.execute
520
+ end
521
+
522
+ #
523
+ # Gets all the dashboards within a subscription.
524
+ #
525
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
526
+ # will be added to the HTTP request.
527
+ #
528
+ # @return [Array<Dashboard>] operation results.
529
+ #
530
+ def list_by_subscription(custom_headers:nil)
531
+ first_page = list_by_subscription_as_lazy(custom_headers:custom_headers)
532
+ first_page.get_all_items
533
+ end
534
+
535
+ #
536
+ # Gets all the dashboards within a subscription.
537
+ #
538
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
539
+ # will be added to the HTTP request.
540
+ #
541
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
542
+ #
543
+ def list_by_subscription_with_http_info(custom_headers:nil)
544
+ list_by_subscription_async(custom_headers:custom_headers).value!
545
+ end
546
+
547
+ #
548
+ # Gets all the dashboards within a subscription.
549
+ #
550
+ # @param [Hash{String => String}] A hash of custom headers that will be added
551
+ # to the HTTP request.
552
+ #
553
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
554
+ #
555
+ def list_by_subscription_async(custom_headers:nil)
556
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
557
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
558
+
559
+
560
+ request_headers = {}
561
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
562
+
563
+ # Set Headers
564
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
565
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
566
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Portal/dashboards'
567
+
568
+ request_url = @base_url || @client.base_url
569
+
570
+ options = {
571
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
572
+ path_params: {'subscriptionId' => @client.subscription_id},
573
+ query_params: {'api-version' => @client.api_version},
574
+ headers: request_headers.merge(custom_headers || {}),
575
+ base_url: request_url
576
+ }
577
+ promise = @client.make_request_async(:get, path_template, options)
578
+
579
+ promise = promise.then do |result|
580
+ http_response = result.response
581
+ status_code = http_response.status
582
+ response_content = http_response.body
583
+ unless status_code == 200
584
+ error_model = JSON.load(response_content)
585
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
586
+ end
587
+
588
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
589
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
590
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
591
+ # Deserialize Response
592
+ if status_code == 200
593
+ begin
594
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
595
+ result_mapper = Azure::Portal::Mgmt::V2015_08_01_preview::Models::DashboardListResult.mapper()
596
+ result.body = @client.deserialize(result_mapper, parsed_response)
597
+ rescue Exception => e
598
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
599
+ end
600
+ end
601
+
602
+ result
603
+ end
604
+
605
+ promise.execute
606
+ end
607
+
608
+ #
609
+ # Gets all the Dashboards within a resource group.
610
+ #
611
+ # @param next_page_link [String] The NextLink from the previous successful call
612
+ # to List operation.
613
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
614
+ # will be added to the HTTP request.
615
+ #
616
+ # @return [DashboardListResult] operation results.
617
+ #
618
+ def list_by_resource_group_next(next_page_link, custom_headers:nil)
619
+ response = list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
620
+ response.body unless response.nil?
621
+ end
622
+
623
+ #
624
+ # Gets all the Dashboards within a resource group.
625
+ #
626
+ # @param next_page_link [String] The NextLink from the previous successful call
627
+ # to List operation.
628
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
629
+ # will be added to the HTTP request.
630
+ #
631
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
632
+ #
633
+ def list_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil)
634
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
635
+ end
636
+
637
+ #
638
+ # Gets all the Dashboards within a resource group.
639
+ #
640
+ # @param next_page_link [String] The NextLink from the previous successful call
641
+ # to List operation.
642
+ # @param [Hash{String => String}] A hash of custom headers that will be added
643
+ # to the HTTP request.
644
+ #
645
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
646
+ #
647
+ def list_by_resource_group_next_async(next_page_link, custom_headers:nil)
648
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
649
+
650
+
651
+ request_headers = {}
652
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
653
+
654
+ # Set Headers
655
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
656
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
657
+ path_template = '{nextLink}'
658
+
659
+ request_url = @base_url || @client.base_url
660
+
661
+ options = {
662
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
663
+ skip_encoding_path_params: {'nextLink' => next_page_link},
664
+ headers: request_headers.merge(custom_headers || {}),
665
+ base_url: request_url
666
+ }
667
+ promise = @client.make_request_async(:get, path_template, options)
668
+
669
+ promise = promise.then do |result|
670
+ http_response = result.response
671
+ status_code = http_response.status
672
+ response_content = http_response.body
673
+ unless status_code == 200
674
+ error_model = JSON.load(response_content)
675
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
676
+ end
677
+
678
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
679
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
680
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
681
+ # Deserialize Response
682
+ if status_code == 200
683
+ begin
684
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
685
+ result_mapper = Azure::Portal::Mgmt::V2015_08_01_preview::Models::DashboardListResult.mapper()
686
+ result.body = @client.deserialize(result_mapper, parsed_response)
687
+ rescue Exception => e
688
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
689
+ end
690
+ end
691
+
692
+ result
693
+ end
694
+
695
+ promise.execute
696
+ end
697
+
698
+ #
699
+ # Gets all the dashboards within a subscription.
700
+ #
701
+ # @param next_page_link [String] The NextLink from the previous successful call
702
+ # to List operation.
703
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
704
+ # will be added to the HTTP request.
705
+ #
706
+ # @return [DashboardListResult] operation results.
707
+ #
708
+ def list_by_subscription_next(next_page_link, custom_headers:nil)
709
+ response = list_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value!
710
+ response.body unless response.nil?
711
+ end
712
+
713
+ #
714
+ # Gets all the dashboards within a subscription.
715
+ #
716
+ # @param next_page_link [String] The NextLink from the previous successful call
717
+ # to List operation.
718
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
719
+ # will be added to the HTTP request.
720
+ #
721
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
722
+ #
723
+ def list_by_subscription_next_with_http_info(next_page_link, custom_headers:nil)
724
+ list_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value!
725
+ end
726
+
727
+ #
728
+ # Gets all the dashboards within a subscription.
729
+ #
730
+ # @param next_page_link [String] The NextLink from the previous successful call
731
+ # to List operation.
732
+ # @param [Hash{String => String}] A hash of custom headers that will be added
733
+ # to the HTTP request.
734
+ #
735
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
736
+ #
737
+ def list_by_subscription_next_async(next_page_link, custom_headers:nil)
738
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
739
+
740
+
741
+ request_headers = {}
742
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
743
+
744
+ # Set Headers
745
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
746
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
747
+ path_template = '{nextLink}'
748
+
749
+ request_url = @base_url || @client.base_url
750
+
751
+ options = {
752
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
753
+ skip_encoding_path_params: {'nextLink' => next_page_link},
754
+ headers: request_headers.merge(custom_headers || {}),
755
+ base_url: request_url
756
+ }
757
+ promise = @client.make_request_async(:get, path_template, options)
758
+
759
+ promise = promise.then do |result|
760
+ http_response = result.response
761
+ status_code = http_response.status
762
+ response_content = http_response.body
763
+ unless status_code == 200
764
+ error_model = JSON.load(response_content)
765
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
766
+ end
767
+
768
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
769
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
770
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
771
+ # Deserialize Response
772
+ if status_code == 200
773
+ begin
774
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
775
+ result_mapper = Azure::Portal::Mgmt::V2015_08_01_preview::Models::DashboardListResult.mapper()
776
+ result.body = @client.deserialize(result_mapper, parsed_response)
777
+ rescue Exception => e
778
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
779
+ end
780
+ end
781
+
782
+ result
783
+ end
784
+
785
+ promise.execute
786
+ end
787
+
788
+ #
789
+ # Gets all the Dashboards within a resource group.
790
+ #
791
+ # @param resource_group_name [String] The name of the resource group.
792
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
793
+ # will be added to the HTTP request.
794
+ #
795
+ # @return [DashboardListResult] which provide lazy access to pages of the
796
+ # response.
797
+ #
798
+ def list_by_resource_group_as_lazy(resource_group_name, custom_headers:nil)
799
+ response = list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
800
+ unless response.nil?
801
+ page = response.body
802
+ page.next_method = Proc.new do |next_page_link|
803
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers)
804
+ end
805
+ page
806
+ end
807
+ end
808
+
809
+ #
810
+ # Gets all the dashboards within a subscription.
811
+ #
812
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
813
+ # will be added to the HTTP request.
814
+ #
815
+ # @return [DashboardListResult] which provide lazy access to pages of the
816
+ # response.
817
+ #
818
+ def list_by_subscription_as_lazy(custom_headers:nil)
819
+ response = list_by_subscription_async(custom_headers:custom_headers).value!
820
+ unless response.nil?
821
+ page = response.body
822
+ page.next_method = Proc.new do |next_page_link|
823
+ list_by_subscription_next_async(next_page_link, custom_headers:custom_headers)
824
+ end
825
+ page
826
+ end
827
+ end
828
+
829
+ end
830
+ end