azure_mgmt_monitor 0.17.6 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2015-04-01/generated/azure_mgmt_monitor.rb +11 -8
  3. data/lib/2015-04-01/generated/azure_mgmt_monitor/activity_logs.rb +24 -19
  4. data/lib/2015-04-01/generated/azure_mgmt_monitor/models/metric_trigger.rb +35 -1
  5. data/lib/2015-04-01/generated/azure_mgmt_monitor/models/recurrence.rb +9 -9
  6. data/lib/2015-04-01/generated/azure_mgmt_monitor/models/recurrence_frequency.rb +22 -0
  7. data/lib/2015-04-01/generated/azure_mgmt_monitor/models/recurrent_schedule.rb +1 -1
  8. data/lib/2015-04-01/generated/azure_mgmt_monitor/models/scale_rule_metric_dimension.rb +80 -0
  9. data/lib/2015-04-01/generated/azure_mgmt_monitor/models/scale_rule_metric_dimension_operation_type.rb +16 -0
  10. data/lib/2015-04-01/generated/azure_mgmt_monitor/models/time_aggregation_type.rb +1 -0
  11. data/lib/2015-04-01/generated/azure_mgmt_monitor/models/time_window.rb +1 -1
  12. data/lib/2015-04-01/generated/azure_mgmt_monitor/monitor_management_client.rb +1 -1
  13. data/lib/2015-05-01/generated/azure_mgmt_monitor/application_insights_management_client.rb +1 -1
  14. data/lib/2016-03-01/generated/azure_mgmt_monitor.rb +14 -14
  15. data/lib/2016-03-01/generated/azure_mgmt_monitor/alert_rules.rb +21 -21
  16. data/lib/2016-03-01/generated/azure_mgmt_monitor/monitor_management_client.rb +5 -5
  17. data/lib/2016-09-01/generated/azure_mgmt_monitor/monitor_client.rb +1 -1
  18. data/lib/2017-04-01/generated/azure_mgmt_monitor/monitor_management_client.rb +1 -1
  19. data/lib/2017-05-01-preview/generated/azure_mgmt_monitor.rb +16 -11
  20. data/lib/2017-05-01-preview/generated/azure_mgmt_monitor/models/diagnostic_settings_resource.rb +19 -5
  21. data/lib/2017-05-01-preview/generated/azure_mgmt_monitor/models/response.rb +1 -1
  22. data/lib/2017-05-01-preview/generated/azure_mgmt_monitor/models/subscription_diagnostic_settings_resource.rb +150 -0
  23. data/lib/2017-05-01-preview/generated/azure_mgmt_monitor/models/subscription_diagnostic_settings_resource_collection.rb +57 -0
  24. data/lib/2017-05-01-preview/generated/azure_mgmt_monitor/models/subscription_log_settings.rb +59 -0
  25. data/lib/2017-05-01-preview/generated/azure_mgmt_monitor/models/subscription_proxy_only_resource.rb +82 -0
  26. data/lib/2017-05-01-preview/generated/azure_mgmt_monitor/monitor_management_client.rb +10 -5
  27. data/lib/2017-05-01-preview/generated/azure_mgmt_monitor/subscription_diagnostic_settings_operations.rb +405 -0
  28. data/lib/2017-10-01-preview/generated/azure_mgmt_monitor/application_insights_management_client.rb +1 -1
  29. data/lib/2017-11-01-preview/generated/azure_mgmt_monitor/models/baseline_response.rb +1 -1
  30. data/lib/2017-11-01-preview/generated/azure_mgmt_monitor/models/calculate_baseline_response.rb +1 -1
  31. data/lib/2017-11-01-preview/generated/azure_mgmt_monitor/monitor_management_client.rb +1 -1
  32. data/lib/2017-12-01-preview/generated/azure_mgmt_monitor/metric_namespaces.rb +1 -1
  33. data/lib/2017-12-01-preview/generated/azure_mgmt_monitor/monitor_management_client.rb +1 -1
  34. data/lib/2018-01-01/generated/azure_mgmt_monitor/models/metric.rb +2 -1
  35. data/lib/2018-01-01/generated/azure_mgmt_monitor/models/metric_definition.rb +3 -2
  36. data/lib/2018-01-01/generated/azure_mgmt_monitor/models/metric_value.rb +3 -4
  37. data/lib/2018-01-01/generated/azure_mgmt_monitor/models/response.rb +1 -1
  38. data/lib/2018-01-01/generated/azure_mgmt_monitor/models/unit.rb +4 -0
  39. data/lib/2018-01-01/generated/azure_mgmt_monitor/monitor_management_client.rb +1 -1
  40. data/lib/2018-03-01/generated/azure_mgmt_monitor.rb +25 -17
  41. data/lib/2018-03-01/generated/azure_mgmt_monitor/metric_alerts.rb +10 -10
  42. data/lib/2018-03-01/generated/azure_mgmt_monitor/models/dynamic_metric_criteria.rb +175 -0
  43. data/lib/2018-03-01/generated/azure_mgmt_monitor/models/dynamic_threshold_failing_periods.rb +61 -0
  44. data/lib/2018-03-01/generated/azure_mgmt_monitor/models/dynamic_threshold_operator.rb +17 -0
  45. data/lib/2018-03-01/generated/azure_mgmt_monitor/models/dynamic_threshold_sensitivity.rb +17 -0
  46. data/lib/2018-03-01/generated/azure_mgmt_monitor/models/metric_alert_action.rb +3 -3
  47. data/lib/2018-03-01/generated/azure_mgmt_monitor/models/metric_alert_criteria.rb +2 -0
  48. data/lib/2018-03-01/generated/azure_mgmt_monitor/models/metric_alert_multiple_resource_multiple_metric_criteria.rb +90 -0
  49. data/lib/2018-03-01/generated/azure_mgmt_monitor/models/metric_alert_resource.rb +27 -1
  50. data/lib/2018-03-01/generated/azure_mgmt_monitor/models/metric_alert_resource_patch.rb +27 -1
  51. data/lib/2018-03-01/generated/azure_mgmt_monitor/models/metric_criteria.rb +56 -31
  52. data/lib/2018-03-01/generated/azure_mgmt_monitor/models/metric_dimension.rb +2 -1
  53. data/lib/2018-03-01/generated/azure_mgmt_monitor/models/multi_metric_criteria.rb +142 -0
  54. data/lib/2018-03-01/generated/azure_mgmt_monitor/models/operator.rb +20 -0
  55. data/lib/2018-03-01/generated/azure_mgmt_monitor/models/webtest_location_availability_criteria.rb +98 -0
  56. data/lib/2018-03-01/generated/azure_mgmt_monitor/monitor_management_client.rb +5 -5
  57. data/lib/2018-04-16/generated/azure_mgmt_monitor.rb +8 -5
  58. data/lib/2018-04-16/generated/azure_mgmt_monitor/models/action.rb +1 -0
  59. data/lib/2018-04-16/generated/azure_mgmt_monitor/models/alerting_action.rb +2 -2
  60. data/lib/2018-04-16/generated/azure_mgmt_monitor/models/az_ns_action_group.rb +1 -1
  61. data/lib/2018-04-16/generated/azure_mgmt_monitor/models/criteria.rb +66 -0
  62. data/lib/2018-04-16/generated/azure_mgmt_monitor/models/dimension.rb +79 -0
  63. data/lib/2018-04-16/generated/azure_mgmt_monitor/models/log_search_rule_resource.rb +4 -3
  64. data/lib/2018-04-16/generated/azure_mgmt_monitor/models/log_to_metric_action.rb +71 -0
  65. data/lib/2018-04-16/generated/azure_mgmt_monitor/models/source.rb +3 -2
  66. data/lib/2018-04-16/generated/azure_mgmt_monitor/monitor_client.rb +1 -1
  67. data/lib/2018-06-01-preview/generated/azure_mgmt_monitor/monitor_management_client.rb +1 -1
  68. data/lib/2018-06-17-preview/generated/azure_mgmt_monitor/application_insights_management_client.rb +1 -1
  69. data/lib/2018-09-01/generated/azure_mgmt_monitor/monitor_management_client.rb +1 -1
  70. data/lib/2018-11-27-preview/generated/azure_mgmt_monitor/monitor_management_client.rb +1 -1
  71. data/lib/2018-11-27-preview/generated/azure_mgmt_monitor/vminsights.rb +1 -1
  72. data/lib/2019-03-01/generated/azure_mgmt_monitor.rb +18 -9
  73. data/lib/2019-03-01/generated/azure_mgmt_monitor/action_groups.rb +1 -1
  74. data/lib/2019-03-01/generated/azure_mgmt_monitor/baselines.rb +186 -0
  75. data/lib/2019-03-01/generated/azure_mgmt_monitor/models/baseline_metadata.rb +57 -0
  76. data/lib/2019-03-01/generated/azure_mgmt_monitor/models/baseline_sensitivity.rb +17 -0
  77. data/lib/2019-03-01/generated/azure_mgmt_monitor/models/metric_baselines_response.rb +55 -0
  78. data/lib/2019-03-01/generated/azure_mgmt_monitor/models/metric_single_dimension.rb +57 -0
  79. data/lib/2019-03-01/generated/azure_mgmt_monitor/models/result_type.rb +16 -0
  80. data/lib/2019-03-01/generated/azure_mgmt_monitor/models/single_baseline.rb +85 -0
  81. data/lib/2019-03-01/generated/azure_mgmt_monitor/models/single_metric_baseline.rb +129 -0
  82. data/lib/2019-03-01/generated/azure_mgmt_monitor/models/time_series_baseline.rb +127 -0
  83. data/lib/2019-03-01/generated/azure_mgmt_monitor/monitor_management_client.rb +5 -1
  84. data/lib/2019-06-01/generated/azure_mgmt_monitor.rb +45 -0
  85. data/lib/2019-06-01/generated/azure_mgmt_monitor/action_groups.rb +707 -0
  86. data/lib/2019-06-01/generated/azure_mgmt_monitor/models/action_group_list.rb +67 -0
  87. data/lib/2019-06-01/generated/azure_mgmt_monitor/models/action_group_patch_body.rb +68 -0
  88. data/lib/2019-06-01/generated/azure_mgmt_monitor/models/action_group_resource.rb +326 -0
  89. data/lib/2019-06-01/generated/azure_mgmt_monitor/models/arm_role_receiver.rb +69 -0
  90. data/lib/2019-06-01/generated/azure_mgmt_monitor/models/automation_runbook_receiver.rb +113 -0
  91. data/lib/2019-06-01/generated/azure_mgmt_monitor/models/azure_app_push_receiver.rb +58 -0
  92. data/lib/2019-06-01/generated/azure_mgmt_monitor/models/azure_function_receiver.rb +91 -0
  93. data/lib/2019-06-01/generated/azure_mgmt_monitor/models/email_receiver.rb +83 -0
  94. data/lib/2019-06-01/generated/azure_mgmt_monitor/models/enable_request.rb +46 -0
  95. data/lib/2019-06-01/generated/azure_mgmt_monitor/models/error_response.rb +57 -0
  96. data/lib/2019-06-01/generated/azure_mgmt_monitor/models/itsm_receiver.rb +94 -0
  97. data/lib/2019-06-01/generated/azure_mgmt_monitor/models/logic_app_receiver.rb +80 -0
  98. data/lib/2019-06-01/generated/azure_mgmt_monitor/models/receiver_status.rb +17 -0
  99. data/lib/2019-06-01/generated/azure_mgmt_monitor/models/resource.rb +110 -0
  100. data/lib/2019-06-01/generated/azure_mgmt_monitor/models/sms_receiver.rb +83 -0
  101. data/lib/2019-06-01/generated/azure_mgmt_monitor/models/voice_receiver.rb +69 -0
  102. data/lib/2019-06-01/generated/azure_mgmt_monitor/models/webhook_receiver.rb +115 -0
  103. data/lib/2019-06-01/generated/azure_mgmt_monitor/module_definition.rb +9 -0
  104. data/lib/2019-06-01/generated/azure_mgmt_monitor/monitor_management_client.rb +131 -0
  105. data/lib/2019-10-17-preview/generated/azure_mgmt_monitor.rb +49 -0
  106. data/lib/2019-10-17-preview/generated/azure_mgmt_monitor/models/azure_monitor_private_link_scope.rb +123 -0
  107. data/lib/2019-10-17-preview/generated/azure_mgmt_monitor/models/azure_monitor_private_link_scope_list_result.rb +102 -0
  108. data/lib/2019-10-17-preview/generated/azure_mgmt_monitor/models/error_additional_info.rb +59 -0
  109. data/lib/2019-10-17-preview/generated/azure_mgmt_monitor/models/error_response.rb +57 -0
  110. data/lib/2019-10-17-preview/generated/azure_mgmt_monitor/models/error_response_common.rb +93 -0
  111. data/lib/2019-10-17-preview/generated/azure_mgmt_monitor/models/operation_status.rb +102 -0
  112. data/lib/2019-10-17-preview/generated/azure_mgmt_monitor/models/private_endpoint_connection.rb +100 -0
  113. data/lib/2019-10-17-preview/generated/azure_mgmt_monitor/models/private_endpoint_connection_list_result.rb +100 -0
  114. data/lib/2019-10-17-preview/generated/azure_mgmt_monitor/models/private_endpoint_property.rb +46 -0
  115. data/lib/2019-10-17-preview/generated/azure_mgmt_monitor/models/private_link_resource.rb +95 -0
  116. data/lib/2019-10-17-preview/generated/azure_mgmt_monitor/models/private_link_resource_list_result.rb +100 -0
  117. data/lib/2019-10-17-preview/generated/azure_mgmt_monitor/models/private_link_scopes_resource.rb +101 -0
  118. data/lib/2019-10-17-preview/generated/azure_mgmt_monitor/models/private_link_service_connection_state_property.rb +71 -0
  119. data/lib/2019-10-17-preview/generated/azure_mgmt_monitor/models/proxy_resource.rb +71 -0
  120. data/lib/2019-10-17-preview/generated/azure_mgmt_monitor/models/scoped_resource.rb +85 -0
  121. data/lib/2019-10-17-preview/generated/azure_mgmt_monitor/models/scoped_resource_list_result.rb +100 -0
  122. data/lib/2019-10-17-preview/generated/azure_mgmt_monitor/models/tags_resource.rb +55 -0
  123. data/lib/2019-10-17-preview/generated/azure_mgmt_monitor/module_definition.rb +9 -0
  124. data/lib/2019-10-17-preview/generated/azure_mgmt_monitor/monitor_management_client.rb +148 -0
  125. data/lib/2019-10-17-preview/generated/azure_mgmt_monitor/private_endpoint_connections.rb +641 -0
  126. data/lib/2019-10-17-preview/generated/azure_mgmt_monitor/private_link_resources.rb +346 -0
  127. data/lib/2019-10-17-preview/generated/azure_mgmt_monitor/private_link_scope_operation_status.rb +122 -0
  128. data/lib/2019-10-17-preview/generated/azure_mgmt_monitor/private_link_scoped_resources.rb +638 -0
  129. data/lib/2019-10-17-preview/generated/azure_mgmt_monitor/private_link_scopes.rb +889 -0
  130. data/lib/azure_mgmt_monitor.rb +13 -11
  131. data/lib/profiles/latest/modules/monitor_profile_module.rb +322 -132
  132. data/lib/profiles/v2019_03_01_hybrid/modules/monitor_profile_module.rb +65 -35
  133. data/lib/version.rb +1 -1
  134. metadata +77 -3
@@ -0,0 +1,889 @@
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::Monitor::Mgmt::V2019_10_17_preview
7
+ #
8
+ # Monitor Management Client
9
+ #
10
+ class PrivateLinkScopes
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the PrivateLinkScopes class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [MonitorManagementClient] reference to the MonitorManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Gets a list of all Azure Monitor PrivateLinkScopes within a subscription.
26
+ #
27
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
28
+ # will be added to the HTTP request.
29
+ #
30
+ # @return [Array<AzureMonitorPrivateLinkScope>] operation results.
31
+ #
32
+ def list(custom_headers:nil)
33
+ first_page = list_as_lazy(custom_headers:custom_headers)
34
+ first_page.get_all_items
35
+ end
36
+
37
+ #
38
+ # Gets a list of all Azure Monitor PrivateLinkScopes within a subscription.
39
+ #
40
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
41
+ # will be added to the HTTP request.
42
+ #
43
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
44
+ #
45
+ def list_with_http_info(custom_headers:nil)
46
+ list_async(custom_headers:custom_headers).value!
47
+ end
48
+
49
+ #
50
+ # Gets a list of all Azure Monitor PrivateLinkScopes within a subscription.
51
+ #
52
+ # @param [Hash{String => String}] A hash of custom headers that will be added
53
+ # to the HTTP request.
54
+ #
55
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
56
+ #
57
+ def list_async(custom_headers:nil)
58
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
59
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
60
+
61
+
62
+ request_headers = {}
63
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
64
+
65
+ # Set Headers
66
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
67
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
68
+ path_template = 'subscriptions/{subscriptionId}/providers/microsoft.insights/privateLinkScopes'
69
+
70
+ request_url = @base_url || @client.base_url
71
+
72
+ options = {
73
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
74
+ path_params: {'subscriptionId' => @client.subscription_id},
75
+ query_params: {'api-version' => @client.api_version},
76
+ headers: request_headers.merge(custom_headers || {}),
77
+ base_url: request_url
78
+ }
79
+ promise = @client.make_request_async(:get, path_template, options)
80
+
81
+ promise = promise.then do |result|
82
+ http_response = result.response
83
+ status_code = http_response.status
84
+ response_content = http_response.body
85
+ unless status_code == 200
86
+ error_model = JSON.load(response_content)
87
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
88
+ end
89
+
90
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
91
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
92
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
93
+ # Deserialize Response
94
+ if status_code == 200
95
+ begin
96
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
97
+ result_mapper = Azure::Monitor::Mgmt::V2019_10_17_preview::Models::AzureMonitorPrivateLinkScopeListResult.mapper()
98
+ result.body = @client.deserialize(result_mapper, parsed_response)
99
+ rescue Exception => e
100
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
101
+ end
102
+ end
103
+
104
+ result
105
+ end
106
+
107
+ promise.execute
108
+ end
109
+
110
+ #
111
+ # Gets a list of Azure Monitor PrivateLinkScopes within a resource group.
112
+ #
113
+ # @param resource_group_name [String] The name of the resource group.
114
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
115
+ # will be added to the HTTP request.
116
+ #
117
+ # @return [Array<AzureMonitorPrivateLinkScope>] operation results.
118
+ #
119
+ def list_by_resource_group(resource_group_name, custom_headers:nil)
120
+ first_page = list_by_resource_group_as_lazy(resource_group_name, custom_headers:custom_headers)
121
+ first_page.get_all_items
122
+ end
123
+
124
+ #
125
+ # Gets a list of Azure Monitor PrivateLinkScopes within a resource group.
126
+ #
127
+ # @param resource_group_name [String] The name of the resource group.
128
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
129
+ # will be added to the HTTP request.
130
+ #
131
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
132
+ #
133
+ def list_by_resource_group_with_http_info(resource_group_name, custom_headers:nil)
134
+ list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
135
+ end
136
+
137
+ #
138
+ # Gets a list of Azure Monitor PrivateLinkScopes within a resource group.
139
+ #
140
+ # @param resource_group_name [String] The name of the resource group.
141
+ # @param [Hash{String => String}] A hash of custom headers that will be added
142
+ # to the HTTP request.
143
+ #
144
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
145
+ #
146
+ def list_by_resource_group_async(resource_group_name, custom_headers:nil)
147
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
148
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
149
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
150
+
151
+
152
+ request_headers = {}
153
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
154
+
155
+ # Set Headers
156
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
157
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
158
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/privateLinkScopes'
159
+
160
+ request_url = @base_url || @client.base_url
161
+
162
+ options = {
163
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
164
+ path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
165
+ query_params: {'api-version' => @client.api_version},
166
+ headers: request_headers.merge(custom_headers || {}),
167
+ base_url: request_url
168
+ }
169
+ promise = @client.make_request_async(:get, path_template, options)
170
+
171
+ promise = promise.then do |result|
172
+ http_response = result.response
173
+ status_code = http_response.status
174
+ response_content = http_response.body
175
+ unless status_code == 200
176
+ error_model = JSON.load(response_content)
177
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
178
+ end
179
+
180
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
181
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
182
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
183
+ # Deserialize Response
184
+ if status_code == 200
185
+ begin
186
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
187
+ result_mapper = Azure::Monitor::Mgmt::V2019_10_17_preview::Models::AzureMonitorPrivateLinkScopeListResult.mapper()
188
+ result.body = @client.deserialize(result_mapper, parsed_response)
189
+ rescue Exception => e
190
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
191
+ end
192
+ end
193
+
194
+ result
195
+ end
196
+
197
+ promise.execute
198
+ end
199
+
200
+ #
201
+ # Deletes a Azure Monitor PrivateLinkScope.
202
+ #
203
+ # @param resource_group_name [String] The name of the resource group.
204
+ # @param scope_name [String] The name of the Azure Monitor PrivateLinkScope
205
+ # resource.
206
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
207
+ # will be added to the HTTP request.
208
+ #
209
+ def delete(resource_group_name, scope_name, custom_headers:nil)
210
+ response = delete_async(resource_group_name, scope_name, custom_headers:custom_headers).value!
211
+ nil
212
+ end
213
+
214
+ #
215
+ # @param resource_group_name [String] The name of the resource group.
216
+ # @param scope_name [String] The name of the Azure Monitor PrivateLinkScope
217
+ # resource.
218
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
219
+ # will be added to the HTTP request.
220
+ #
221
+ # @return [Concurrent::Promise] promise which provides async access to http
222
+ # response.
223
+ #
224
+ def delete_async(resource_group_name, scope_name, custom_headers:nil)
225
+ # Send request
226
+ promise = begin_delete_async(resource_group_name, scope_name, custom_headers:custom_headers)
227
+
228
+ promise = promise.then do |response|
229
+ # Defining deserialization method.
230
+ deserialize_method = lambda do |parsed_response|
231
+ end
232
+
233
+ # Waiting for response.
234
+ @client.get_long_running_operation_result(response, deserialize_method)
235
+ end
236
+
237
+ promise
238
+ end
239
+
240
+ #
241
+ # Returns a Azure Monitor PrivateLinkScope.
242
+ #
243
+ # @param resource_group_name [String] The name of the resource group.
244
+ # @param scope_name [String] The name of the Azure Monitor PrivateLinkScope
245
+ # resource.
246
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
247
+ # will be added to the HTTP request.
248
+ #
249
+ # @return [AzureMonitorPrivateLinkScope] operation results.
250
+ #
251
+ def get(resource_group_name, scope_name, custom_headers:nil)
252
+ response = get_async(resource_group_name, scope_name, custom_headers:custom_headers).value!
253
+ response.body unless response.nil?
254
+ end
255
+
256
+ #
257
+ # Returns a Azure Monitor PrivateLinkScope.
258
+ #
259
+ # @param resource_group_name [String] The name of the resource group.
260
+ # @param scope_name [String] The name of the Azure Monitor PrivateLinkScope
261
+ # resource.
262
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
263
+ # will be added to the HTTP request.
264
+ #
265
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
266
+ #
267
+ def get_with_http_info(resource_group_name, scope_name, custom_headers:nil)
268
+ get_async(resource_group_name, scope_name, custom_headers:custom_headers).value!
269
+ end
270
+
271
+ #
272
+ # Returns a Azure Monitor PrivateLinkScope.
273
+ #
274
+ # @param resource_group_name [String] The name of the resource group.
275
+ # @param scope_name [String] The name of the Azure Monitor PrivateLinkScope
276
+ # resource.
277
+ # @param [Hash{String => String}] A hash of custom headers that will be added
278
+ # to the HTTP request.
279
+ #
280
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
281
+ #
282
+ def get_async(resource_group_name, scope_name, custom_headers:nil)
283
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
284
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
285
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
286
+ fail ArgumentError, 'scope_name is nil' if scope_name.nil?
287
+
288
+
289
+ request_headers = {}
290
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
291
+
292
+ # Set Headers
293
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
294
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
295
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/privateLinkScopes/{scopeName}'
296
+
297
+ request_url = @base_url || @client.base_url
298
+
299
+ options = {
300
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
301
+ path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id,'scopeName' => scope_name},
302
+ query_params: {'api-version' => @client.api_version},
303
+ headers: request_headers.merge(custom_headers || {}),
304
+ base_url: request_url
305
+ }
306
+ promise = @client.make_request_async(:get, path_template, options)
307
+
308
+ promise = promise.then do |result|
309
+ http_response = result.response
310
+ status_code = http_response.status
311
+ response_content = http_response.body
312
+ unless status_code == 200
313
+ error_model = JSON.load(response_content)
314
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
315
+ end
316
+
317
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
318
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
319
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
320
+ # Deserialize Response
321
+ if status_code == 200
322
+ begin
323
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
324
+ result_mapper = Azure::Monitor::Mgmt::V2019_10_17_preview::Models::AzureMonitorPrivateLinkScope.mapper()
325
+ result.body = @client.deserialize(result_mapper, parsed_response)
326
+ rescue Exception => e
327
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
328
+ end
329
+ end
330
+
331
+ result
332
+ end
333
+
334
+ promise.execute
335
+ end
336
+
337
+ #
338
+ # Creates (or updates) a Azure Monitor PrivateLinkScope. Note: You cannot
339
+ # specify a different value for InstrumentationKey nor AppId in the Put
340
+ # operation.
341
+ #
342
+ # @param resource_group_name [String] The name of the resource group.
343
+ # @param scope_name [String] The name of the Azure Monitor PrivateLinkScope
344
+ # resource.
345
+ # @param azure_monitor_private_link_scope_payload
346
+ # [AzureMonitorPrivateLinkScope] Properties that need to be specified to create
347
+ # or update a Azure Monitor PrivateLinkScope.
348
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
349
+ # will be added to the HTTP request.
350
+ #
351
+ # @return [AzureMonitorPrivateLinkScope] operation results.
352
+ #
353
+ def create_or_update(resource_group_name, scope_name, azure_monitor_private_link_scope_payload, custom_headers:nil)
354
+ response = create_or_update_async(resource_group_name, scope_name, azure_monitor_private_link_scope_payload, custom_headers:custom_headers).value!
355
+ response.body unless response.nil?
356
+ end
357
+
358
+ #
359
+ # Creates (or updates) a Azure Monitor PrivateLinkScope. Note: You cannot
360
+ # specify a different value for InstrumentationKey nor AppId in the Put
361
+ # operation.
362
+ #
363
+ # @param resource_group_name [String] The name of the resource group.
364
+ # @param scope_name [String] The name of the Azure Monitor PrivateLinkScope
365
+ # resource.
366
+ # @param azure_monitor_private_link_scope_payload
367
+ # [AzureMonitorPrivateLinkScope] Properties that need to be specified to create
368
+ # or update a Azure Monitor PrivateLinkScope.
369
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
370
+ # will be added to the HTTP request.
371
+ #
372
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
373
+ #
374
+ def create_or_update_with_http_info(resource_group_name, scope_name, azure_monitor_private_link_scope_payload, custom_headers:nil)
375
+ create_or_update_async(resource_group_name, scope_name, azure_monitor_private_link_scope_payload, custom_headers:custom_headers).value!
376
+ end
377
+
378
+ #
379
+ # Creates (or updates) a Azure Monitor PrivateLinkScope. Note: You cannot
380
+ # specify a different value for InstrumentationKey nor AppId in the Put
381
+ # operation.
382
+ #
383
+ # @param resource_group_name [String] The name of the resource group.
384
+ # @param scope_name [String] The name of the Azure Monitor PrivateLinkScope
385
+ # resource.
386
+ # @param azure_monitor_private_link_scope_payload
387
+ # [AzureMonitorPrivateLinkScope] Properties that need to be specified to create
388
+ # or update a Azure Monitor PrivateLinkScope.
389
+ # @param [Hash{String => String}] A hash of custom headers that will be added
390
+ # to the HTTP request.
391
+ #
392
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
393
+ #
394
+ def create_or_update_async(resource_group_name, scope_name, azure_monitor_private_link_scope_payload, custom_headers:nil)
395
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
396
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
397
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
398
+ fail ArgumentError, 'scope_name is nil' if scope_name.nil?
399
+ fail ArgumentError, 'azure_monitor_private_link_scope_payload is nil' if azure_monitor_private_link_scope_payload.nil?
400
+
401
+
402
+ request_headers = {}
403
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
404
+
405
+ # Set Headers
406
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
407
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
408
+
409
+ # Serialize Request
410
+ request_mapper = Azure::Monitor::Mgmt::V2019_10_17_preview::Models::AzureMonitorPrivateLinkScope.mapper()
411
+ request_content = @client.serialize(request_mapper, azure_monitor_private_link_scope_payload)
412
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
413
+
414
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/privateLinkScopes/{scopeName}'
415
+
416
+ request_url = @base_url || @client.base_url
417
+
418
+ options = {
419
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
420
+ path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id,'scopeName' => scope_name},
421
+ query_params: {'api-version' => @client.api_version},
422
+ body: request_content,
423
+ headers: request_headers.merge(custom_headers || {}),
424
+ base_url: request_url
425
+ }
426
+ promise = @client.make_request_async(:put, path_template, options)
427
+
428
+ promise = promise.then do |result|
429
+ http_response = result.response
430
+ status_code = http_response.status
431
+ response_content = http_response.body
432
+ unless status_code == 200 || status_code == 201
433
+ error_model = JSON.load(response_content)
434
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
435
+ end
436
+
437
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
438
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
439
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
440
+ # Deserialize Response
441
+ if status_code == 200
442
+ begin
443
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
444
+ result_mapper = Azure::Monitor::Mgmt::V2019_10_17_preview::Models::AzureMonitorPrivateLinkScope.mapper()
445
+ result.body = @client.deserialize(result_mapper, parsed_response)
446
+ rescue Exception => e
447
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
448
+ end
449
+ end
450
+ # Deserialize Response
451
+ if status_code == 201
452
+ begin
453
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
454
+ result_mapper = Azure::Monitor::Mgmt::V2019_10_17_preview::Models::AzureMonitorPrivateLinkScope.mapper()
455
+ result.body = @client.deserialize(result_mapper, parsed_response)
456
+ rescue Exception => e
457
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
458
+ end
459
+ end
460
+
461
+ result
462
+ end
463
+
464
+ promise.execute
465
+ end
466
+
467
+ #
468
+ # Updates an existing PrivateLinkScope's tags. To update other fields use the
469
+ # CreateOrUpdate method.
470
+ #
471
+ # @param resource_group_name [String] The name of the resource group.
472
+ # @param scope_name [String] The name of the Azure Monitor PrivateLinkScope
473
+ # resource.
474
+ # @param private_link_scope_tags [TagsResource] Updated tag information to set
475
+ # into the PrivateLinkScope instance.
476
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
477
+ # will be added to the HTTP request.
478
+ #
479
+ # @return [AzureMonitorPrivateLinkScope] operation results.
480
+ #
481
+ def update_tags(resource_group_name, scope_name, private_link_scope_tags, custom_headers:nil)
482
+ response = update_tags_async(resource_group_name, scope_name, private_link_scope_tags, custom_headers:custom_headers).value!
483
+ response.body unless response.nil?
484
+ end
485
+
486
+ #
487
+ # Updates an existing PrivateLinkScope's tags. To update other fields use the
488
+ # CreateOrUpdate method.
489
+ #
490
+ # @param resource_group_name [String] The name of the resource group.
491
+ # @param scope_name [String] The name of the Azure Monitor PrivateLinkScope
492
+ # resource.
493
+ # @param private_link_scope_tags [TagsResource] Updated tag information to set
494
+ # into the PrivateLinkScope instance.
495
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
496
+ # will be added to the HTTP request.
497
+ #
498
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
499
+ #
500
+ def update_tags_with_http_info(resource_group_name, scope_name, private_link_scope_tags, custom_headers:nil)
501
+ update_tags_async(resource_group_name, scope_name, private_link_scope_tags, custom_headers:custom_headers).value!
502
+ end
503
+
504
+ #
505
+ # Updates an existing PrivateLinkScope's tags. To update other fields use the
506
+ # CreateOrUpdate method.
507
+ #
508
+ # @param resource_group_name [String] The name of the resource group.
509
+ # @param scope_name [String] The name of the Azure Monitor PrivateLinkScope
510
+ # resource.
511
+ # @param private_link_scope_tags [TagsResource] Updated tag information to set
512
+ # into the PrivateLinkScope instance.
513
+ # @param [Hash{String => String}] A hash of custom headers that will be added
514
+ # to the HTTP request.
515
+ #
516
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
517
+ #
518
+ def update_tags_async(resource_group_name, scope_name, private_link_scope_tags, custom_headers:nil)
519
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
520
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
521
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
522
+ fail ArgumentError, 'scope_name is nil' if scope_name.nil?
523
+ fail ArgumentError, 'private_link_scope_tags is nil' if private_link_scope_tags.nil?
524
+
525
+
526
+ request_headers = {}
527
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
528
+
529
+ # Set Headers
530
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
531
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
532
+
533
+ # Serialize Request
534
+ request_mapper = Azure::Monitor::Mgmt::V2019_10_17_preview::Models::TagsResource.mapper()
535
+ request_content = @client.serialize(request_mapper, private_link_scope_tags)
536
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
537
+
538
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/privateLinkScopes/{scopeName}'
539
+
540
+ request_url = @base_url || @client.base_url
541
+
542
+ options = {
543
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
544
+ path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id,'scopeName' => scope_name},
545
+ query_params: {'api-version' => @client.api_version},
546
+ body: request_content,
547
+ headers: request_headers.merge(custom_headers || {}),
548
+ base_url: request_url
549
+ }
550
+ promise = @client.make_request_async(:patch, path_template, options)
551
+
552
+ promise = promise.then do |result|
553
+ http_response = result.response
554
+ status_code = http_response.status
555
+ response_content = http_response.body
556
+ unless status_code == 200
557
+ error_model = JSON.load(response_content)
558
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
559
+ end
560
+
561
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
562
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
563
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
564
+ # Deserialize Response
565
+ if status_code == 200
566
+ begin
567
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
568
+ result_mapper = Azure::Monitor::Mgmt::V2019_10_17_preview::Models::AzureMonitorPrivateLinkScope.mapper()
569
+ result.body = @client.deserialize(result_mapper, parsed_response)
570
+ rescue Exception => e
571
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
572
+ end
573
+ end
574
+
575
+ result
576
+ end
577
+
578
+ promise.execute
579
+ end
580
+
581
+ #
582
+ # Deletes a Azure Monitor PrivateLinkScope.
583
+ #
584
+ # @param resource_group_name [String] The name of the resource group.
585
+ # @param scope_name [String] The name of the Azure Monitor PrivateLinkScope
586
+ # resource.
587
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
588
+ # will be added to the HTTP request.
589
+ #
590
+ #
591
+ def begin_delete(resource_group_name, scope_name, custom_headers:nil)
592
+ response = begin_delete_async(resource_group_name, scope_name, custom_headers:custom_headers).value!
593
+ nil
594
+ end
595
+
596
+ #
597
+ # Deletes a Azure Monitor PrivateLinkScope.
598
+ #
599
+ # @param resource_group_name [String] The name of the resource group.
600
+ # @param scope_name [String] The name of the Azure Monitor PrivateLinkScope
601
+ # resource.
602
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
603
+ # will be added to the HTTP request.
604
+ #
605
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
606
+ #
607
+ def begin_delete_with_http_info(resource_group_name, scope_name, custom_headers:nil)
608
+ begin_delete_async(resource_group_name, scope_name, custom_headers:custom_headers).value!
609
+ end
610
+
611
+ #
612
+ # Deletes a Azure Monitor PrivateLinkScope.
613
+ #
614
+ # @param resource_group_name [String] The name of the resource group.
615
+ # @param scope_name [String] The name of the Azure Monitor PrivateLinkScope
616
+ # resource.
617
+ # @param [Hash{String => String}] A hash of custom headers that will be added
618
+ # to the HTTP request.
619
+ #
620
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
621
+ #
622
+ def begin_delete_async(resource_group_name, scope_name, custom_headers:nil)
623
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
624
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
625
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
626
+ fail ArgumentError, 'scope_name is nil' if scope_name.nil?
627
+
628
+
629
+ request_headers = {}
630
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
631
+
632
+ # Set Headers
633
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
634
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
635
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/privateLinkScopes/{scopeName}'
636
+
637
+ request_url = @base_url || @client.base_url
638
+
639
+ options = {
640
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
641
+ path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id,'scopeName' => scope_name},
642
+ query_params: {'api-version' => @client.api_version},
643
+ headers: request_headers.merge(custom_headers || {}),
644
+ base_url: request_url
645
+ }
646
+ promise = @client.make_request_async(:delete, path_template, options)
647
+
648
+ promise = promise.then do |result|
649
+ http_response = result.response
650
+ status_code = http_response.status
651
+ response_content = http_response.body
652
+ unless status_code == 200 || status_code == 204 || status_code == 202
653
+ error_model = JSON.load(response_content)
654
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
655
+ end
656
+
657
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
658
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
659
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
660
+
661
+ result
662
+ end
663
+
664
+ promise.execute
665
+ end
666
+
667
+ #
668
+ # Gets a list of all Azure Monitor PrivateLinkScopes within a subscription.
669
+ #
670
+ # @param next_page_link [String] The NextLink from the previous successful call
671
+ # to List operation.
672
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
673
+ # will be added to the HTTP request.
674
+ #
675
+ # @return [AzureMonitorPrivateLinkScopeListResult] operation results.
676
+ #
677
+ def list_next(next_page_link, custom_headers:nil)
678
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
679
+ response.body unless response.nil?
680
+ end
681
+
682
+ #
683
+ # Gets a list of all Azure Monitor PrivateLinkScopes within a subscription.
684
+ #
685
+ # @param next_page_link [String] The NextLink from the previous successful call
686
+ # to List operation.
687
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
688
+ # will be added to the HTTP request.
689
+ #
690
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
691
+ #
692
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
693
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
694
+ end
695
+
696
+ #
697
+ # Gets a list of all Azure Monitor PrivateLinkScopes within a subscription.
698
+ #
699
+ # @param next_page_link [String] The NextLink from the previous successful call
700
+ # to List operation.
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_next_async(next_page_link, custom_headers:nil)
707
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
708
+
709
+
710
+ request_headers = {}
711
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
712
+
713
+ # Set Headers
714
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
715
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
716
+ path_template = '{nextLink}'
717
+
718
+ request_url = @base_url || @client.base_url
719
+
720
+ options = {
721
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
722
+ skip_encoding_path_params: {'nextLink' => next_page_link},
723
+ headers: request_headers.merge(custom_headers || {}),
724
+ base_url: request_url
725
+ }
726
+ promise = @client.make_request_async(:get, path_template, options)
727
+
728
+ promise = promise.then do |result|
729
+ http_response = result.response
730
+ status_code = http_response.status
731
+ response_content = http_response.body
732
+ unless status_code == 200
733
+ error_model = JSON.load(response_content)
734
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
735
+ end
736
+
737
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
738
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
739
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
740
+ # Deserialize Response
741
+ if status_code == 200
742
+ begin
743
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
744
+ result_mapper = Azure::Monitor::Mgmt::V2019_10_17_preview::Models::AzureMonitorPrivateLinkScopeListResult.mapper()
745
+ result.body = @client.deserialize(result_mapper, parsed_response)
746
+ rescue Exception => e
747
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
748
+ end
749
+ end
750
+
751
+ result
752
+ end
753
+
754
+ promise.execute
755
+ end
756
+
757
+ #
758
+ # Gets a list of Azure Monitor PrivateLinkScopes within a resource group.
759
+ #
760
+ # @param next_page_link [String] The NextLink from the previous successful call
761
+ # to List operation.
762
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
763
+ # will be added to the HTTP request.
764
+ #
765
+ # @return [AzureMonitorPrivateLinkScopeListResult] operation results.
766
+ #
767
+ def list_by_resource_group_next(next_page_link, custom_headers:nil)
768
+ response = list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
769
+ response.body unless response.nil?
770
+ end
771
+
772
+ #
773
+ # Gets a list of Azure Monitor PrivateLinkScopes within a resource group.
774
+ #
775
+ # @param next_page_link [String] The NextLink from the previous successful call
776
+ # to List operation.
777
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
778
+ # will be added to the HTTP request.
779
+ #
780
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
781
+ #
782
+ def list_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil)
783
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
784
+ end
785
+
786
+ #
787
+ # Gets a list of Azure Monitor PrivateLinkScopes within a resource group.
788
+ #
789
+ # @param next_page_link [String] The NextLink from the previous successful call
790
+ # to List operation.
791
+ # @param [Hash{String => String}] A hash of custom headers that will be added
792
+ # to the HTTP request.
793
+ #
794
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
795
+ #
796
+ def list_by_resource_group_next_async(next_page_link, custom_headers:nil)
797
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
798
+
799
+
800
+ request_headers = {}
801
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
802
+
803
+ # Set Headers
804
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
805
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
806
+ path_template = '{nextLink}'
807
+
808
+ request_url = @base_url || @client.base_url
809
+
810
+ options = {
811
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
812
+ skip_encoding_path_params: {'nextLink' => next_page_link},
813
+ headers: request_headers.merge(custom_headers || {}),
814
+ base_url: request_url
815
+ }
816
+ promise = @client.make_request_async(:get, path_template, options)
817
+
818
+ promise = promise.then do |result|
819
+ http_response = result.response
820
+ status_code = http_response.status
821
+ response_content = http_response.body
822
+ unless status_code == 200
823
+ error_model = JSON.load(response_content)
824
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
825
+ end
826
+
827
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
828
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
829
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
830
+ # Deserialize Response
831
+ if status_code == 200
832
+ begin
833
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
834
+ result_mapper = Azure::Monitor::Mgmt::V2019_10_17_preview::Models::AzureMonitorPrivateLinkScopeListResult.mapper()
835
+ result.body = @client.deserialize(result_mapper, parsed_response)
836
+ rescue Exception => e
837
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
838
+ end
839
+ end
840
+
841
+ result
842
+ end
843
+
844
+ promise.execute
845
+ end
846
+
847
+ #
848
+ # Gets a list of all Azure Monitor PrivateLinkScopes within a subscription.
849
+ #
850
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
851
+ # will be added to the HTTP request.
852
+ #
853
+ # @return [AzureMonitorPrivateLinkScopeListResult] which provide lazy access to
854
+ # pages of the response.
855
+ #
856
+ def list_as_lazy(custom_headers:nil)
857
+ response = list_async(custom_headers:custom_headers).value!
858
+ unless response.nil?
859
+ page = response.body
860
+ page.next_method = Proc.new do |next_page_link|
861
+ list_next_async(next_page_link, custom_headers:custom_headers)
862
+ end
863
+ page
864
+ end
865
+ end
866
+
867
+ #
868
+ # Gets a list of Azure Monitor PrivateLinkScopes within a resource group.
869
+ #
870
+ # @param resource_group_name [String] The name of the resource group.
871
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
872
+ # will be added to the HTTP request.
873
+ #
874
+ # @return [AzureMonitorPrivateLinkScopeListResult] which provide lazy access to
875
+ # pages of the response.
876
+ #
877
+ def list_by_resource_group_as_lazy(resource_group_name, custom_headers:nil)
878
+ response = list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
879
+ unless response.nil?
880
+ page = response.body
881
+ page.next_method = Proc.new do |next_page_link|
882
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers)
883
+ end
884
+ page
885
+ end
886
+ end
887
+
888
+ end
889
+ end