azure_mgmt_adhybridhealth_service 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (128) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service.rb +143 -0
  4. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/ad_domain_service_members.rb +259 -0
  5. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_service.rb +131 -0
  6. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_service_members_operations.rb +535 -0
  7. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services.rb +2287 -0
  8. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services_replication_status.rb +117 -0
  9. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services_service_members.rb +356 -0
  10. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adds_services_user_preference.rb +293 -0
  11. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/adhybrid_health_service.rb +185 -0
  12. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/alerts_operations.rb +240 -0
  13. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/configuration.rb +500 -0
  14. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/dimensions_operations.rb +229 -0
  15. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/additional_information.rb +80 -0
  16. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/adds_configuration.rb +120 -0
  17. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/adds_service_member.rb +499 -0
  18. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/adds_service_members.rb +120 -0
  19. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/agent.rb +113 -0
  20. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/alert.rb +290 -0
  21. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/alert_feedback.rb +127 -0
  22. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/alert_feedbacks.rb +55 -0
  23. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/alerts.rb +120 -0
  24. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/algorithm_step_type.rb +27 -0
  25. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/associated_object.rb +167 -0
  26. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/attribute_delta.rb +103 -0
  27. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/attribute_delta_operation_type.rb +19 -0
  28. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/attribute_mapping.rb +81 -0
  29. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/attribute_mapping_type.rb +18 -0
  30. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/attribute_mpping_source.rb +87 -0
  31. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/change_not_reimported.rb +61 -0
  32. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/change_not_reimported_delta.rb +100 -0
  33. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/change_not_reimported_entry.rb +139 -0
  34. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/connector.rb +236 -0
  35. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/connector_connection_error.rb +123 -0
  36. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/connector_connection_errors.rb +56 -0
  37. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/connector_metadata.rb +74 -0
  38. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/connector_metadata_details.rb +57 -0
  39. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/connector_object_error.rb +197 -0
  40. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/connector_object_errors.rb +56 -0
  41. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/connectors.rb +55 -0
  42. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/credential.rb +76 -0
  43. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/credentials.rb +55 -0
  44. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/data_freshness_details.rb +55 -0
  45. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/delta_operation_type.rb +22 -0
  46. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/dimension.rb +142 -0
  47. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/dimensions.rb +120 -0
  48. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/display.rb +69 -0
  49. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/error_count.rb +68 -0
  50. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/error_counts.rb +55 -0
  51. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/error_detail.rb +93 -0
  52. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/error_report_users_entries.rb +56 -0
  53. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/error_report_users_entry.rb +91 -0
  54. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/export_error.rb +444 -0
  55. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/export_errors.rb +55 -0
  56. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/export_status.rb +80 -0
  57. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/export_statuses.rb +120 -0
  58. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/extension_error_info.rb +68 -0
  59. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/forest_summary.rb +129 -0
  60. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/global_configuration.rb +99 -0
  61. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/global_configurations.rb +56 -0
  62. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/health_status.rb +19 -0
  63. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/help_link.rb +57 -0
  64. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/hotfix.rb +69 -0
  65. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/hotfixes.rb +55 -0
  66. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/import_error.rb +186 -0
  67. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/import_errors.rb +55 -0
  68. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/inbound_replication_neighbor.rb +179 -0
  69. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/inbound_replication_neighbors.rb +57 -0
  70. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/item.rb +57 -0
  71. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/items.rb +55 -0
  72. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/level.rb +17 -0
  73. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/merged_export_error.rb +280 -0
  74. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/merged_export_errors.rb +55 -0
  75. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/metric_group.rb +69 -0
  76. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/metric_metadata.rb +169 -0
  77. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/metric_metadata_list.rb +120 -0
  78. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/metric_set.rb +66 -0
  79. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/metric_sets.rb +75 -0
  80. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/metrics.rb +120 -0
  81. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/module_configuration.rb +78 -0
  82. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/module_configurations.rb +56 -0
  83. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/monitoring_level.rb +17 -0
  84. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/object_with_sync_error.rb +211 -0
  85. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/operation.rb +57 -0
  86. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/operation_list_response.rb +125 -0
  87. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/partition.rb +136 -0
  88. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/partition_scope.rb +103 -0
  89. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/password_hash_sync_configuration.rb +58 -0
  90. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/password_management_settings.rb +148 -0
  91. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/password_operation_types.rb +17 -0
  92. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/replication_details_list.rb +89 -0
  93. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/replication_status.rb +70 -0
  94. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/replication_summary.rb +124 -0
  95. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/replication_summary_list.rb +56 -0
  96. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/result.rb +46 -0
  97. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/risky_ipblob_uri.rb +102 -0
  98. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/risky_ipblob_uris.rb +55 -0
  99. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/rule_error_info.rb +91 -0
  100. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/run_profile.rb +77 -0
  101. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/run_profiles.rb +55 -0
  102. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/run_step.rb +113 -0
  103. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/service_configuration.rb +134 -0
  104. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/service_member.rb +336 -0
  105. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/service_members.rb +120 -0
  106. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/service_properties.rb +331 -0
  107. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/services.rb +120 -0
  108. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/state.rb +19 -0
  109. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/tabular_export_error.rb +79 -0
  110. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/tenant.rb +292 -0
  111. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/tenant_onboarding_details.rb +60 -0
  112. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/user_preference.rb +54 -0
  113. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/value_delta.rb +58 -0
  114. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/value_delta_operation_type.rb +18 -0
  115. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/models/value_type.rb +20 -0
  116. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/module_definition.rb +9 -0
  117. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/operations.rb +219 -0
  118. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/reports.rb +109 -0
  119. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/service.rb +131 -0
  120. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/service_members_operations.rb +1736 -0
  121. data/lib/2014-01-01/generated/azure_mgmt_adhybridhealth_service/services_operations.rb +3162 -0
  122. data/lib/azure_mgmt_adhybridhealth_service.rb +6 -0
  123. data/lib/module_definition.rb +7 -0
  124. data/lib/profiles/latest/adhybridhealthservice_latest_profile_client.rb +40 -0
  125. data/lib/profiles/latest/adhybridhealthservice_module_definition.rb +8 -0
  126. data/lib/profiles/latest/modules/adhybridhealthservice_profile_module.rb +493 -0
  127. data/lib/version.rb +7 -0
  128. metadata +243 -0
@@ -0,0 +1,3162 @@
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::ADHybridHealthService::Mgmt::V2014_01_01
7
+ #
8
+ # REST APIs for Azure Active Directory Connect Health
9
+ #
10
+ class ServicesOperations
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the ServicesOperations class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [ADHybridHealthService] reference to the ADHybridHealthService
22
+ attr_reader :client
23
+
24
+ #
25
+ # Gets the details of services, for a tenant, that are onboarded to Azure
26
+ # Active Directory Connect Health.
27
+ #
28
+ # @param filter [String] The service property filter to apply.
29
+ # @param service_type [String] The service type for the services onboarded to
30
+ # Azure Active Directory Connect Health. Depending on whether the service is
31
+ # monitoring, ADFS, Sync or ADDS roles, the service type can either be
32
+ # AdFederationService or AadSyncService or AdDomainService.
33
+ # @param skip_count [Integer] The skip count, which specifies the number of
34
+ # elements that can be bypassed from a sequence and then return the remaining
35
+ # elements.
36
+ # @param take_count [Integer] The take count , which specifies the number of
37
+ # elements that can be returned from a sequence.
38
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
39
+ # will be added to the HTTP request.
40
+ #
41
+ # @return [Array<ServiceProperties>] operation results.
42
+ #
43
+ def list(filter:nil, service_type:nil, skip_count:nil, take_count:nil, custom_headers:nil)
44
+ first_page = list_as_lazy(filter:filter, service_type:service_type, skip_count:skip_count, take_count:take_count, custom_headers:custom_headers)
45
+ first_page.get_all_items
46
+ end
47
+
48
+ #
49
+ # Gets the details of services, for a tenant, that are onboarded to Azure
50
+ # Active Directory Connect Health.
51
+ #
52
+ # @param filter [String] The service property filter to apply.
53
+ # @param service_type [String] The service type for the services onboarded to
54
+ # Azure Active Directory Connect Health. Depending on whether the service is
55
+ # monitoring, ADFS, Sync or ADDS roles, the service type can either be
56
+ # AdFederationService or AadSyncService or AdDomainService.
57
+ # @param skip_count [Integer] The skip count, which specifies the number of
58
+ # elements that can be bypassed from a sequence and then return the remaining
59
+ # elements.
60
+ # @param take_count [Integer] The take count , which specifies the number of
61
+ # elements that can be returned from a sequence.
62
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
63
+ # will be added to the HTTP request.
64
+ #
65
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
66
+ #
67
+ def list_with_http_info(filter:nil, service_type:nil, skip_count:nil, take_count:nil, custom_headers:nil)
68
+ list_async(filter:filter, service_type:service_type, skip_count:skip_count, take_count:take_count, custom_headers:custom_headers).value!
69
+ end
70
+
71
+ #
72
+ # Gets the details of services, for a tenant, that are onboarded to Azure
73
+ # Active Directory Connect Health.
74
+ #
75
+ # @param filter [String] The service property filter to apply.
76
+ # @param service_type [String] The service type for the services onboarded to
77
+ # Azure Active Directory Connect Health. Depending on whether the service is
78
+ # monitoring, ADFS, Sync or ADDS roles, the service type can either be
79
+ # AdFederationService or AadSyncService or AdDomainService.
80
+ # @param skip_count [Integer] The skip count, which specifies the number of
81
+ # elements that can be bypassed from a sequence and then return the remaining
82
+ # elements.
83
+ # @param take_count [Integer] The take count , which specifies the number of
84
+ # elements that can be returned from a sequence.
85
+ # @param [Hash{String => String}] A hash of custom headers that will be added
86
+ # to the HTTP request.
87
+ #
88
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
89
+ #
90
+ def list_async(filter:nil, service_type:nil, skip_count:nil, take_count:nil, custom_headers:nil)
91
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
92
+
93
+
94
+ request_headers = {}
95
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
96
+
97
+ # Set Headers
98
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
99
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
100
+ path_template = 'providers/Microsoft.ADHybridHealthService/services'
101
+
102
+ request_url = @base_url || @client.base_url
103
+
104
+ options = {
105
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
106
+ query_params: {'$filter' => filter,'serviceType' => service_type,'skipCount' => skip_count,'takeCount' => take_count,'api-version' => @client.api_version},
107
+ headers: request_headers.merge(custom_headers || {}),
108
+ base_url: request_url
109
+ }
110
+ promise = @client.make_request_async(:get, path_template, options)
111
+
112
+ promise = promise.then do |result|
113
+ http_response = result.response
114
+ status_code = http_response.status
115
+ response_content = http_response.body
116
+ unless status_code == 200
117
+ error_model = JSON.load(response_content)
118
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
119
+ end
120
+
121
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
122
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
123
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
124
+ # Deserialize Response
125
+ if status_code == 200
126
+ begin
127
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
128
+ result_mapper = Azure::ADHybridHealthService::Mgmt::V2014_01_01::Models::Services.mapper()
129
+ result.body = @client.deserialize(result_mapper, parsed_response)
130
+ rescue Exception => e
131
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
132
+ end
133
+ end
134
+
135
+ result
136
+ end
137
+
138
+ promise.execute
139
+ end
140
+
141
+ #
142
+ # Onboards a service for a given tenant in Azure Active Directory Connect
143
+ # Health.
144
+ #
145
+ # @param service [ServiceProperties] The service object.
146
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
147
+ # will be added to the HTTP request.
148
+ #
149
+ # @return [ServiceProperties] operation results.
150
+ #
151
+ def add(service, custom_headers:nil)
152
+ response = add_async(service, custom_headers:custom_headers).value!
153
+ response.body unless response.nil?
154
+ end
155
+
156
+ #
157
+ # Onboards a service for a given tenant in Azure Active Directory Connect
158
+ # Health.
159
+ #
160
+ # @param service [ServiceProperties] The service object.
161
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
162
+ # will be added to the HTTP request.
163
+ #
164
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
165
+ #
166
+ def add_with_http_info(service, custom_headers:nil)
167
+ add_async(service, custom_headers:custom_headers).value!
168
+ end
169
+
170
+ #
171
+ # Onboards a service for a given tenant in Azure Active Directory Connect
172
+ # Health.
173
+ #
174
+ # @param service [ServiceProperties] The service object.
175
+ # @param [Hash{String => String}] A hash of custom headers that will be added
176
+ # to the HTTP request.
177
+ #
178
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
179
+ #
180
+ def add_async(service, custom_headers:nil)
181
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
182
+ fail ArgumentError, 'service is nil' if service.nil?
183
+
184
+
185
+ request_headers = {}
186
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
187
+
188
+ # Set Headers
189
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
190
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
191
+
192
+ # Serialize Request
193
+ request_mapper = Azure::ADHybridHealthService::Mgmt::V2014_01_01::Models::ServiceProperties.mapper()
194
+ request_content = @client.serialize(request_mapper, service)
195
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
196
+
197
+ path_template = 'providers/Microsoft.ADHybridHealthService/services'
198
+
199
+ request_url = @base_url || @client.base_url
200
+
201
+ options = {
202
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
203
+ query_params: {'api-version' => @client.api_version},
204
+ body: request_content,
205
+ headers: request_headers.merge(custom_headers || {}),
206
+ base_url: request_url
207
+ }
208
+ promise = @client.make_request_async(:post, path_template, options)
209
+
210
+ promise = promise.then do |result|
211
+ http_response = result.response
212
+ status_code = http_response.status
213
+ response_content = http_response.body
214
+ unless status_code == 200
215
+ error_model = JSON.load(response_content)
216
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
217
+ end
218
+
219
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
220
+ 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
+ # Deserialize Response
223
+ if status_code == 200
224
+ begin
225
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
226
+ result_mapper = Azure::ADHybridHealthService::Mgmt::V2014_01_01::Models::ServiceProperties.mapper()
227
+ result.body = @client.deserialize(result_mapper, parsed_response)
228
+ rescue Exception => e
229
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
230
+ end
231
+ end
232
+
233
+ result
234
+ end
235
+
236
+ promise.execute
237
+ end
238
+
239
+ #
240
+ # Gets the details of services for a tenant having Azure AD Premium license and
241
+ # is onboarded to Azure Active Directory Connect Health.
242
+ #
243
+ # @param filter [String] The service property filter to apply.
244
+ # @param service_type [String] The service type for the services onboarded to
245
+ # Azure Active Directory Connect Health. Depending on whether the service is
246
+ # monitoring, ADFS, Sync or ADDS roles, the service type can either be
247
+ # AdFederationService or AadSyncService or AdDomainService.
248
+ # @param skip_count [Integer] The skip count, which specifies the number of
249
+ # elements that can be bypassed from a sequence and then return the remaining
250
+ # elements.
251
+ # @param take_count [Integer] The take count , which specifies the number of
252
+ # elements that can be returned from a sequence.
253
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
254
+ # will be added to the HTTP request.
255
+ #
256
+ # @return [Array<ServiceProperties>] operation results.
257
+ #
258
+ def list_premium(filter:nil, service_type:nil, skip_count:nil, take_count:nil, custom_headers:nil)
259
+ first_page = list_premium_as_lazy(filter:filter, service_type:service_type, skip_count:skip_count, take_count:take_count, custom_headers:custom_headers)
260
+ first_page.get_all_items
261
+ end
262
+
263
+ #
264
+ # Gets the details of services for a tenant having Azure AD Premium license and
265
+ # is onboarded to Azure Active Directory Connect Health.
266
+ #
267
+ # @param filter [String] The service property filter to apply.
268
+ # @param service_type [String] The service type for the services onboarded to
269
+ # Azure Active Directory Connect Health. Depending on whether the service is
270
+ # monitoring, ADFS, Sync or ADDS roles, the service type can either be
271
+ # AdFederationService or AadSyncService or AdDomainService.
272
+ # @param skip_count [Integer] The skip count, which specifies the number of
273
+ # elements that can be bypassed from a sequence and then return the remaining
274
+ # elements.
275
+ # @param take_count [Integer] The take count , which specifies the number of
276
+ # elements that can be returned from a sequence.
277
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
278
+ # will be added to the HTTP request.
279
+ #
280
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
281
+ #
282
+ def list_premium_with_http_info(filter:nil, service_type:nil, skip_count:nil, take_count:nil, custom_headers:nil)
283
+ list_premium_async(filter:filter, service_type:service_type, skip_count:skip_count, take_count:take_count, custom_headers:custom_headers).value!
284
+ end
285
+
286
+ #
287
+ # Gets the details of services for a tenant having Azure AD Premium license and
288
+ # is onboarded to Azure Active Directory Connect Health.
289
+ #
290
+ # @param filter [String] The service property filter to apply.
291
+ # @param service_type [String] The service type for the services onboarded to
292
+ # Azure Active Directory Connect Health. Depending on whether the service is
293
+ # monitoring, ADFS, Sync or ADDS roles, the service type can either be
294
+ # AdFederationService or AadSyncService or AdDomainService.
295
+ # @param skip_count [Integer] The skip count, which specifies the number of
296
+ # elements that can be bypassed from a sequence and then return the remaining
297
+ # elements.
298
+ # @param take_count [Integer] The take count , which specifies the number of
299
+ # elements that can be returned from a sequence.
300
+ # @param [Hash{String => String}] A hash of custom headers that will be added
301
+ # to the HTTP request.
302
+ #
303
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
304
+ #
305
+ def list_premium_async(filter:nil, service_type:nil, skip_count:nil, take_count:nil, custom_headers:nil)
306
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
307
+
308
+
309
+ request_headers = {}
310
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
311
+
312
+ # Set Headers
313
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
314
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
315
+ path_template = 'providers/Microsoft.ADHybridHealthService/services/premiumCheck'
316
+
317
+ request_url = @base_url || @client.base_url
318
+
319
+ options = {
320
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
321
+ query_params: {'$filter' => filter,'serviceType' => service_type,'skipCount' => skip_count,'takeCount' => take_count,'api-version' => @client.api_version},
322
+ headers: request_headers.merge(custom_headers || {}),
323
+ base_url: request_url
324
+ }
325
+ promise = @client.make_request_async(:get, path_template, options)
326
+
327
+ promise = promise.then do |result|
328
+ http_response = result.response
329
+ status_code = http_response.status
330
+ response_content = http_response.body
331
+ unless status_code == 200
332
+ error_model = JSON.load(response_content)
333
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
334
+ end
335
+
336
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
337
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
338
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
339
+ # Deserialize Response
340
+ if status_code == 200
341
+ begin
342
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
343
+ result_mapper = Azure::ADHybridHealthService::Mgmt::V2014_01_01::Models::Services.mapper()
344
+ result.body = @client.deserialize(result_mapper, parsed_response)
345
+ rescue Exception => e
346
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
347
+ end
348
+ end
349
+
350
+ result
351
+ end
352
+
353
+ promise.execute
354
+ end
355
+
356
+ #
357
+ # Gets the details of a service for a tenant having Azure AD Premium license
358
+ # and is onboarded to Azure Active Directory Connect Health.
359
+ #
360
+ # @param service_name [String] The name of the service.
361
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
362
+ # will be added to the HTTP request.
363
+ #
364
+ # @return [ServiceProperties] operation results.
365
+ #
366
+ def get(service_name, custom_headers:nil)
367
+ response = get_async(service_name, custom_headers:custom_headers).value!
368
+ response.body unless response.nil?
369
+ end
370
+
371
+ #
372
+ # Gets the details of a service for a tenant having Azure AD Premium license
373
+ # and is onboarded to Azure Active Directory Connect Health.
374
+ #
375
+ # @param service_name [String] The name of the service.
376
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
377
+ # will be added to the HTTP request.
378
+ #
379
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
380
+ #
381
+ def get_with_http_info(service_name, custom_headers:nil)
382
+ get_async(service_name, custom_headers:custom_headers).value!
383
+ end
384
+
385
+ #
386
+ # Gets the details of a service for a tenant having Azure AD Premium license
387
+ # and is onboarded to Azure Active Directory Connect Health.
388
+ #
389
+ # @param service_name [String] The name of the service.
390
+ # @param [Hash{String => String}] A hash of custom headers that will be added
391
+ # to the HTTP request.
392
+ #
393
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
394
+ #
395
+ def get_async(service_name, custom_headers:nil)
396
+ fail ArgumentError, 'service_name is nil' if service_name.nil?
397
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
398
+
399
+
400
+ request_headers = {}
401
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
402
+
403
+ # Set Headers
404
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
405
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
406
+ path_template = 'providers/Microsoft.ADHybridHealthService/services/{serviceName}'
407
+
408
+ request_url = @base_url || @client.base_url
409
+
410
+ options = {
411
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
412
+ path_params: {'serviceName' => service_name},
413
+ query_params: {'api-version' => @client.api_version},
414
+ headers: request_headers.merge(custom_headers || {}),
415
+ base_url: request_url
416
+ }
417
+ promise = @client.make_request_async(:get, path_template, options)
418
+
419
+ promise = promise.then do |result|
420
+ http_response = result.response
421
+ status_code = http_response.status
422
+ response_content = http_response.body
423
+ unless status_code == 200
424
+ error_model = JSON.load(response_content)
425
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
426
+ end
427
+
428
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
429
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
430
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
431
+ # Deserialize Response
432
+ if status_code == 200
433
+ begin
434
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
435
+ result_mapper = Azure::ADHybridHealthService::Mgmt::V2014_01_01::Models::ServiceProperties.mapper()
436
+ result.body = @client.deserialize(result_mapper, parsed_response)
437
+ rescue Exception => e
438
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
439
+ end
440
+ end
441
+
442
+ result
443
+ end
444
+
445
+ promise.execute
446
+ end
447
+
448
+ #
449
+ # Deletes a service which is onboarded to Azure Active Directory Connect
450
+ # Health.
451
+ #
452
+ # @param service_name [String] The name of the service which needs to be
453
+ # deleted.
454
+ # @param confirm [Boolean] Indicates if the service will be permanently deleted
455
+ # or disabled. True indicates that the service will be permanently deleted and
456
+ # False indicates that the service will be marked disabled and then deleted
457
+ # after 30 days, if it is not re-registered.
458
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
459
+ # will be added to the HTTP request.
460
+ #
461
+ #
462
+ def delete(service_name, confirm:nil, custom_headers:nil)
463
+ response = delete_async(service_name, confirm:confirm, custom_headers:custom_headers).value!
464
+ nil
465
+ end
466
+
467
+ #
468
+ # Deletes a service which is onboarded to Azure Active Directory Connect
469
+ # Health.
470
+ #
471
+ # @param service_name [String] The name of the service which needs to be
472
+ # deleted.
473
+ # @param confirm [Boolean] Indicates if the service will be permanently deleted
474
+ # or disabled. True indicates that the service will be permanently deleted and
475
+ # False indicates that the service will be marked disabled and then deleted
476
+ # after 30 days, if it is not re-registered.
477
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
478
+ # will be added to the HTTP request.
479
+ #
480
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
481
+ #
482
+ def delete_with_http_info(service_name, confirm:nil, custom_headers:nil)
483
+ delete_async(service_name, confirm:confirm, custom_headers:custom_headers).value!
484
+ end
485
+
486
+ #
487
+ # Deletes a service which is onboarded to Azure Active Directory Connect
488
+ # Health.
489
+ #
490
+ # @param service_name [String] The name of the service which needs to be
491
+ # deleted.
492
+ # @param confirm [Boolean] Indicates if the service will be permanently deleted
493
+ # or disabled. True indicates that the service will be permanently deleted and
494
+ # False indicates that the service will be marked disabled and then deleted
495
+ # after 30 days, if it is not re-registered.
496
+ # @param [Hash{String => String}] A hash of custom headers that will be added
497
+ # to the HTTP request.
498
+ #
499
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
500
+ #
501
+ def delete_async(service_name, confirm:nil, custom_headers:nil)
502
+ fail ArgumentError, 'service_name is nil' if service_name.nil?
503
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
504
+
505
+
506
+ request_headers = {}
507
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
508
+
509
+ # Set Headers
510
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
511
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
512
+ path_template = 'providers/Microsoft.ADHybridHealthService/services/{serviceName}'
513
+
514
+ request_url = @base_url || @client.base_url
515
+
516
+ options = {
517
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
518
+ path_params: {'serviceName' => service_name},
519
+ query_params: {'confirm' => confirm,'api-version' => @client.api_version},
520
+ headers: request_headers.merge(custom_headers || {}),
521
+ base_url: request_url
522
+ }
523
+ promise = @client.make_request_async(:delete, path_template, options)
524
+
525
+ promise = promise.then do |result|
526
+ http_response = result.response
527
+ status_code = http_response.status
528
+ response_content = http_response.body
529
+ unless status_code == 204
530
+ error_model = JSON.load(response_content)
531
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
532
+ end
533
+
534
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
535
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
536
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
537
+
538
+ result
539
+ end
540
+
541
+ promise.execute
542
+ end
543
+
544
+ #
545
+ # Updates the service properties of an onboarded service.
546
+ #
547
+ # @param service_name [String] The name of the service which needs to be
548
+ # deleted.
549
+ # @param service [ServiceProperties] The service object.
550
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
551
+ # will be added to the HTTP request.
552
+ #
553
+ # @return [ServiceProperties] operation results.
554
+ #
555
+ def update(service_name, service, custom_headers:nil)
556
+ response = update_async(service_name, service, custom_headers:custom_headers).value!
557
+ response.body unless response.nil?
558
+ end
559
+
560
+ #
561
+ # Updates the service properties of an onboarded service.
562
+ #
563
+ # @param service_name [String] The name of the service which needs to be
564
+ # deleted.
565
+ # @param service [ServiceProperties] The service object.
566
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
567
+ # will be added to the HTTP request.
568
+ #
569
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
570
+ #
571
+ def update_with_http_info(service_name, service, custom_headers:nil)
572
+ update_async(service_name, service, custom_headers:custom_headers).value!
573
+ end
574
+
575
+ #
576
+ # Updates the service properties of an onboarded service.
577
+ #
578
+ # @param service_name [String] The name of the service which needs to be
579
+ # deleted.
580
+ # @param service [ServiceProperties] The service object.
581
+ # @param [Hash{String => String}] A hash of custom headers that will be added
582
+ # to the HTTP request.
583
+ #
584
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
585
+ #
586
+ def update_async(service_name, service, custom_headers:nil)
587
+ fail ArgumentError, 'service_name is nil' if service_name.nil?
588
+ fail ArgumentError, 'service is nil' if service.nil?
589
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
590
+
591
+
592
+ request_headers = {}
593
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
594
+
595
+ # Set Headers
596
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
597
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
598
+
599
+ # Serialize Request
600
+ request_mapper = Azure::ADHybridHealthService::Mgmt::V2014_01_01::Models::ServiceProperties.mapper()
601
+ request_content = @client.serialize(request_mapper, service)
602
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
603
+
604
+ path_template = 'providers/Microsoft.ADHybridHealthService/services/{serviceName}'
605
+
606
+ request_url = @base_url || @client.base_url
607
+
608
+ options = {
609
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
610
+ path_params: {'serviceName' => service_name},
611
+ query_params: {'api-version' => @client.api_version},
612
+ body: request_content,
613
+ headers: request_headers.merge(custom_headers || {}),
614
+ base_url: request_url
615
+ }
616
+ promise = @client.make_request_async(:patch, path_template, options)
617
+
618
+ promise = promise.then do |result|
619
+ http_response = result.response
620
+ status_code = http_response.status
621
+ response_content = http_response.body
622
+ unless status_code == 200
623
+ error_model = JSON.load(response_content)
624
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
625
+ end
626
+
627
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
628
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
629
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
630
+ # Deserialize Response
631
+ if status_code == 200
632
+ begin
633
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
634
+ result_mapper = Azure::ADHybridHealthService::Mgmt::V2014_01_01::Models::ServiceProperties.mapper()
635
+ result.body = @client.deserialize(result_mapper, parsed_response)
636
+ rescue Exception => e
637
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
638
+ end
639
+ end
640
+
641
+ result
642
+ end
643
+
644
+ promise.execute
645
+ end
646
+
647
+ #
648
+ # Gets the alerts for a given service.
649
+ #
650
+ # @param service_name [String] The name of the service.
651
+ # @param filter [String] The alert property filter to apply.
652
+ # @param state [String] The alert state to query for.
653
+ # @param from [DateTime] The start date to query for.
654
+ # @param to [DateTime] The end date till when to query for.
655
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
656
+ # will be added to the HTTP request.
657
+ #
658
+ # @return [Array<Alert>] operation results.
659
+ #
660
+ def list_alerts(service_name, filter:nil, state:nil, from:nil, to:nil, custom_headers:nil)
661
+ first_page = list_alerts_as_lazy(service_name, filter:filter, state:state, from:from, to:to, custom_headers:custom_headers)
662
+ first_page.get_all_items
663
+ end
664
+
665
+ #
666
+ # Gets the alerts for a given service.
667
+ #
668
+ # @param service_name [String] The name of the service.
669
+ # @param filter [String] The alert property filter to apply.
670
+ # @param state [String] The alert state to query for.
671
+ # @param from [DateTime] The start date to query for.
672
+ # @param to [DateTime] The end date till when to query for.
673
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
674
+ # will be added to the HTTP request.
675
+ #
676
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
677
+ #
678
+ def list_alerts_with_http_info(service_name, filter:nil, state:nil, from:nil, to:nil, custom_headers:nil)
679
+ list_alerts_async(service_name, filter:filter, state:state, from:from, to:to, custom_headers:custom_headers).value!
680
+ end
681
+
682
+ #
683
+ # Gets the alerts for a given service.
684
+ #
685
+ # @param service_name [String] The name of the service.
686
+ # @param filter [String] The alert property filter to apply.
687
+ # @param state [String] The alert state to query for.
688
+ # @param from [DateTime] The start date to query for.
689
+ # @param to [DateTime] The end date till when to query for.
690
+ # @param [Hash{String => String}] A hash of custom headers that will be added
691
+ # to the HTTP request.
692
+ #
693
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
694
+ #
695
+ def list_alerts_async(service_name, filter:nil, state:nil, from:nil, to:nil, custom_headers:nil)
696
+ fail ArgumentError, 'service_name is nil' if service_name.nil?
697
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
698
+
699
+
700
+ request_headers = {}
701
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
702
+
703
+ # Set Headers
704
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
705
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
706
+ path_template = 'providers/Microsoft.ADHybridHealthService/services/{serviceName}/alerts'
707
+
708
+ request_url = @base_url || @client.base_url
709
+
710
+ options = {
711
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
712
+ path_params: {'serviceName' => service_name},
713
+ query_params: {'$filter' => filter,'state' => state,'from' => from,'to' => to,'api-version' => @client.api_version},
714
+ headers: request_headers.merge(custom_headers || {}),
715
+ base_url: request_url
716
+ }
717
+ promise = @client.make_request_async(:get, path_template, options)
718
+
719
+ promise = promise.then do |result|
720
+ http_response = result.response
721
+ status_code = http_response.status
722
+ response_content = http_response.body
723
+ unless status_code == 200
724
+ error_model = JSON.load(response_content)
725
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
726
+ end
727
+
728
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
729
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
730
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
731
+ # Deserialize Response
732
+ if status_code == 200
733
+ begin
734
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
735
+ result_mapper = Azure::ADHybridHealthService::Mgmt::V2014_01_01::Models::Alerts.mapper()
736
+ result.body = @client.deserialize(result_mapper, parsed_response)
737
+ rescue Exception => e
738
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
739
+ end
740
+ end
741
+
742
+ result
743
+ end
744
+
745
+ promise.execute
746
+ end
747
+
748
+ #
749
+ # Checks if the service has all the pre-requisites met to use a feature.
750
+ #
751
+ # @param service_name [String] The name of the service.
752
+ # @param feature_name [String] The name of the feature.
753
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
754
+ # will be added to the HTTP request.
755
+ #
756
+ # @return [Result] operation results.
757
+ #
758
+ def get_feature_availibility(service_name, feature_name, custom_headers:nil)
759
+ response = get_feature_availibility_async(service_name, feature_name, custom_headers:custom_headers).value!
760
+ response.body unless response.nil?
761
+ end
762
+
763
+ #
764
+ # Checks if the service has all the pre-requisites met to use a feature.
765
+ #
766
+ # @param service_name [String] The name of the service.
767
+ # @param feature_name [String] The name of the feature.
768
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
769
+ # will be added to the HTTP request.
770
+ #
771
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
772
+ #
773
+ def get_feature_availibility_with_http_info(service_name, feature_name, custom_headers:nil)
774
+ get_feature_availibility_async(service_name, feature_name, custom_headers:custom_headers).value!
775
+ end
776
+
777
+ #
778
+ # Checks if the service has all the pre-requisites met to use a feature.
779
+ #
780
+ # @param service_name [String] The name of the service.
781
+ # @param feature_name [String] The name of the feature.
782
+ # @param [Hash{String => String}] A hash of custom headers that will be added
783
+ # to the HTTP request.
784
+ #
785
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
786
+ #
787
+ def get_feature_availibility_async(service_name, feature_name, custom_headers:nil)
788
+ fail ArgumentError, 'service_name is nil' if service_name.nil?
789
+ fail ArgumentError, 'feature_name is nil' if feature_name.nil?
790
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
791
+
792
+
793
+ request_headers = {}
794
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
795
+
796
+ # Set Headers
797
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
798
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
799
+ path_template = 'providers/Microsoft.ADHybridHealthService/services/{serviceName}/checkServiceFeatureAvailibility/{featureName}'
800
+
801
+ request_url = @base_url || @client.base_url
802
+
803
+ options = {
804
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
805
+ path_params: {'serviceName' => service_name,'featureName' => feature_name},
806
+ query_params: {'api-version' => @client.api_version},
807
+ headers: request_headers.merge(custom_headers || {}),
808
+ base_url: request_url
809
+ }
810
+ promise = @client.make_request_async(:get, path_template, options)
811
+
812
+ promise = promise.then do |result|
813
+ http_response = result.response
814
+ status_code = http_response.status
815
+ response_content = http_response.body
816
+ unless status_code == 200
817
+ error_model = JSON.load(response_content)
818
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
819
+ end
820
+
821
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
822
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
823
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
824
+ # Deserialize Response
825
+ if status_code == 200
826
+ begin
827
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
828
+ result_mapper = Azure::ADHybridHealthService::Mgmt::V2014_01_01::Models::Result.mapper()
829
+ result.body = @client.deserialize(result_mapper, parsed_response)
830
+ rescue Exception => e
831
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
832
+ end
833
+ end
834
+
835
+ result
836
+ end
837
+
838
+ promise.execute
839
+ end
840
+
841
+ #
842
+ # Gets the count of latest AAD export errors.
843
+ #
844
+ # @param service_name [String] The name of the service.
845
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
846
+ # will be added to the HTTP request.
847
+ #
848
+ # @return [ErrorCounts] operation results.
849
+ #
850
+ def list_export_errors(service_name, custom_headers:nil)
851
+ response = list_export_errors_async(service_name, custom_headers:custom_headers).value!
852
+ response.body unless response.nil?
853
+ end
854
+
855
+ #
856
+ # Gets the count of latest AAD export errors.
857
+ #
858
+ # @param service_name [String] The name of the service.
859
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
860
+ # will be added to the HTTP request.
861
+ #
862
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
863
+ #
864
+ def list_export_errors_with_http_info(service_name, custom_headers:nil)
865
+ list_export_errors_async(service_name, custom_headers:custom_headers).value!
866
+ end
867
+
868
+ #
869
+ # Gets the count of latest AAD export errors.
870
+ #
871
+ # @param service_name [String] The name of the service.
872
+ # @param [Hash{String => String}] A hash of custom headers that will be added
873
+ # to the HTTP request.
874
+ #
875
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
876
+ #
877
+ def list_export_errors_async(service_name, custom_headers:nil)
878
+ fail ArgumentError, 'service_name is nil' if service_name.nil?
879
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
880
+
881
+
882
+ request_headers = {}
883
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
884
+
885
+ # Set Headers
886
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
887
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
888
+ path_template = 'providers/Microsoft.ADHybridHealthService/services/{serviceName}/exporterrors/counts'
889
+
890
+ request_url = @base_url || @client.base_url
891
+
892
+ options = {
893
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
894
+ path_params: {'serviceName' => service_name},
895
+ query_params: {'api-version' => @client.api_version},
896
+ headers: request_headers.merge(custom_headers || {}),
897
+ base_url: request_url
898
+ }
899
+ promise = @client.make_request_async(:get, path_template, options)
900
+
901
+ promise = promise.then do |result|
902
+ http_response = result.response
903
+ status_code = http_response.status
904
+ response_content = http_response.body
905
+ unless status_code == 200
906
+ error_model = JSON.load(response_content)
907
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
908
+ end
909
+
910
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
911
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
912
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
913
+ # Deserialize Response
914
+ if status_code == 200
915
+ begin
916
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
917
+ result_mapper = Azure::ADHybridHealthService::Mgmt::V2014_01_01::Models::ErrorCounts.mapper()
918
+ result.body = @client.deserialize(result_mapper, parsed_response)
919
+ rescue Exception => e
920
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
921
+ end
922
+ end
923
+
924
+ result
925
+ end
926
+
927
+ promise.execute
928
+ end
929
+
930
+ #
931
+ # Gets the categorized export errors.
932
+ #
933
+ # @param service_name [String] The name of the service.
934
+ # @param error_bucket [String] The error category to query for.
935
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
936
+ # will be added to the HTTP request.
937
+ #
938
+ # @return [MergedExportErrors] operation results.
939
+ #
940
+ def list_export_errors_v2(service_name, error_bucket, custom_headers:nil)
941
+ response = list_export_errors_v2_async(service_name, error_bucket, custom_headers:custom_headers).value!
942
+ response.body unless response.nil?
943
+ end
944
+
945
+ #
946
+ # Gets the categorized export errors.
947
+ #
948
+ # @param service_name [String] The name of the service.
949
+ # @param error_bucket [String] The error category to query for.
950
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
951
+ # will be added to the HTTP request.
952
+ #
953
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
954
+ #
955
+ def list_export_errors_v2_with_http_info(service_name, error_bucket, custom_headers:nil)
956
+ list_export_errors_v2_async(service_name, error_bucket, custom_headers:custom_headers).value!
957
+ end
958
+
959
+ #
960
+ # Gets the categorized export errors.
961
+ #
962
+ # @param service_name [String] The name of the service.
963
+ # @param error_bucket [String] The error category to query for.
964
+ # @param [Hash{String => String}] A hash of custom headers that will be added
965
+ # to the HTTP request.
966
+ #
967
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
968
+ #
969
+ def list_export_errors_v2_async(service_name, error_bucket, custom_headers:nil)
970
+ fail ArgumentError, 'service_name is nil' if service_name.nil?
971
+ fail ArgumentError, 'error_bucket is nil' if error_bucket.nil?
972
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
973
+
974
+
975
+ request_headers = {}
976
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
977
+
978
+ # Set Headers
979
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
980
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
981
+ path_template = 'providers/Microsoft.ADHybridHealthService/services/{serviceName}/exporterrors/listV2'
982
+
983
+ request_url = @base_url || @client.base_url
984
+
985
+ options = {
986
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
987
+ path_params: {'serviceName' => service_name},
988
+ query_params: {'errorBucket' => error_bucket,'api-version' => @client.api_version},
989
+ headers: request_headers.merge(custom_headers || {}),
990
+ base_url: request_url
991
+ }
992
+ promise = @client.make_request_async(:get, path_template, options)
993
+
994
+ promise = promise.then do |result|
995
+ http_response = result.response
996
+ status_code = http_response.status
997
+ response_content = http_response.body
998
+ unless status_code == 200
999
+ error_model = JSON.load(response_content)
1000
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1001
+ end
1002
+
1003
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1004
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1005
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1006
+ # Deserialize Response
1007
+ if status_code == 200
1008
+ begin
1009
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1010
+ result_mapper = Azure::ADHybridHealthService::Mgmt::V2014_01_01::Models::MergedExportErrors.mapper()
1011
+ result.body = @client.deserialize(result_mapper, parsed_response)
1012
+ rescue Exception => e
1013
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1014
+ end
1015
+ end
1016
+
1017
+ result
1018
+ end
1019
+
1020
+ promise.execute
1021
+ end
1022
+
1023
+ #
1024
+ # Gets the export status.
1025
+ #
1026
+ # @param service_name [String] The name of the service.
1027
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1028
+ # will be added to the HTTP request.
1029
+ #
1030
+ # @return [Array<ExportStatus>] operation results.
1031
+ #
1032
+ def list_export_status(service_name, custom_headers:nil)
1033
+ first_page = list_export_status_as_lazy(service_name, custom_headers:custom_headers)
1034
+ first_page.get_all_items
1035
+ end
1036
+
1037
+ #
1038
+ # Gets the export status.
1039
+ #
1040
+ # @param service_name [String] The name of the service.
1041
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1042
+ # will be added to the HTTP request.
1043
+ #
1044
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1045
+ #
1046
+ def list_export_status_with_http_info(service_name, custom_headers:nil)
1047
+ list_export_status_async(service_name, custom_headers:custom_headers).value!
1048
+ end
1049
+
1050
+ #
1051
+ # Gets the export status.
1052
+ #
1053
+ # @param service_name [String] The name of the service.
1054
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1055
+ # to the HTTP request.
1056
+ #
1057
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1058
+ #
1059
+ def list_export_status_async(service_name, custom_headers:nil)
1060
+ fail ArgumentError, 'service_name is nil' if service_name.nil?
1061
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1062
+
1063
+
1064
+ request_headers = {}
1065
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1066
+
1067
+ # Set Headers
1068
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1069
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1070
+ path_template = 'providers/Microsoft.ADHybridHealthService/services/{serviceName}/exportstatus'
1071
+
1072
+ request_url = @base_url || @client.base_url
1073
+
1074
+ options = {
1075
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1076
+ path_params: {'serviceName' => service_name},
1077
+ query_params: {'api-version' => @client.api_version},
1078
+ headers: request_headers.merge(custom_headers || {}),
1079
+ base_url: request_url
1080
+ }
1081
+ promise = @client.make_request_async(:get, path_template, options)
1082
+
1083
+ promise = promise.then do |result|
1084
+ http_response = result.response
1085
+ status_code = http_response.status
1086
+ response_content = http_response.body
1087
+ unless status_code == 200
1088
+ error_model = JSON.load(response_content)
1089
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1090
+ end
1091
+
1092
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1093
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1094
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1095
+ # Deserialize Response
1096
+ if status_code == 200
1097
+ begin
1098
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1099
+ result_mapper = Azure::ADHybridHealthService::Mgmt::V2014_01_01::Models::ExportStatuses.mapper()
1100
+ result.body = @client.deserialize(result_mapper, parsed_response)
1101
+ rescue Exception => e
1102
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1103
+ end
1104
+ end
1105
+
1106
+ result
1107
+ end
1108
+
1109
+ promise.execute
1110
+ end
1111
+
1112
+ #
1113
+ # Adds an alert feedback submitted by customer.
1114
+ #
1115
+ # @param service_name [String] The name of the service.
1116
+ # @param alert_feedback [AlertFeedback] The alert feedback.
1117
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1118
+ # will be added to the HTTP request.
1119
+ #
1120
+ # @return [AlertFeedback] operation results.
1121
+ #
1122
+ def add_alert_feedback(service_name, alert_feedback, custom_headers:nil)
1123
+ response = add_alert_feedback_async(service_name, alert_feedback, custom_headers:custom_headers).value!
1124
+ response.body unless response.nil?
1125
+ end
1126
+
1127
+ #
1128
+ # Adds an alert feedback submitted by customer.
1129
+ #
1130
+ # @param service_name [String] The name of the service.
1131
+ # @param alert_feedback [AlertFeedback] The alert feedback.
1132
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1133
+ # will be added to the HTTP request.
1134
+ #
1135
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1136
+ #
1137
+ def add_alert_feedback_with_http_info(service_name, alert_feedback, custom_headers:nil)
1138
+ add_alert_feedback_async(service_name, alert_feedback, custom_headers:custom_headers).value!
1139
+ end
1140
+
1141
+ #
1142
+ # Adds an alert feedback submitted by customer.
1143
+ #
1144
+ # @param service_name [String] The name of the service.
1145
+ # @param alert_feedback [AlertFeedback] The alert feedback.
1146
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1147
+ # to the HTTP request.
1148
+ #
1149
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1150
+ #
1151
+ def add_alert_feedback_async(service_name, alert_feedback, custom_headers:nil)
1152
+ fail ArgumentError, 'service_name is nil' if service_name.nil?
1153
+ fail ArgumentError, 'alert_feedback is nil' if alert_feedback.nil?
1154
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1155
+
1156
+
1157
+ request_headers = {}
1158
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1159
+
1160
+ # Set Headers
1161
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1162
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1163
+
1164
+ # Serialize Request
1165
+ request_mapper = Azure::ADHybridHealthService::Mgmt::V2014_01_01::Models::AlertFeedback.mapper()
1166
+ request_content = @client.serialize(request_mapper, alert_feedback)
1167
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1168
+
1169
+ path_template = 'providers/Microsoft.ADHybridHealthService/services/{serviceName}/feedbacktype/alerts/feedback'
1170
+
1171
+ request_url = @base_url || @client.base_url
1172
+
1173
+ options = {
1174
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1175
+ path_params: {'serviceName' => service_name},
1176
+ query_params: {'api-version' => @client.api_version},
1177
+ body: request_content,
1178
+ headers: request_headers.merge(custom_headers || {}),
1179
+ base_url: request_url
1180
+ }
1181
+ promise = @client.make_request_async(:post, path_template, options)
1182
+
1183
+ promise = promise.then do |result|
1184
+ http_response = result.response
1185
+ status_code = http_response.status
1186
+ response_content = http_response.body
1187
+ unless status_code == 200
1188
+ error_model = JSON.load(response_content)
1189
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1190
+ end
1191
+
1192
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1193
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1194
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1195
+ # Deserialize Response
1196
+ if status_code == 200
1197
+ begin
1198
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1199
+ result_mapper = Azure::ADHybridHealthService::Mgmt::V2014_01_01::Models::AlertFeedback.mapper()
1200
+ result.body = @client.deserialize(result_mapper, parsed_response)
1201
+ rescue Exception => e
1202
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1203
+ end
1204
+ end
1205
+
1206
+ result
1207
+ end
1208
+
1209
+ promise.execute
1210
+ end
1211
+
1212
+ #
1213
+ # Gets a list of all alert feedback for a given tenant and alert type.
1214
+ #
1215
+ # @param service_name [String] The name of the service.
1216
+ # @param short_name [String] The name of the alert.
1217
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1218
+ # will be added to the HTTP request.
1219
+ #
1220
+ # @return [AlertFeedbacks] operation results.
1221
+ #
1222
+ def list_alert_feedback(service_name, short_name, custom_headers:nil)
1223
+ response = list_alert_feedback_async(service_name, short_name, custom_headers:custom_headers).value!
1224
+ response.body unless response.nil?
1225
+ end
1226
+
1227
+ #
1228
+ # Gets a list of all alert feedback for a given tenant and alert type.
1229
+ #
1230
+ # @param service_name [String] The name of the service.
1231
+ # @param short_name [String] The name of the alert.
1232
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1233
+ # will be added to the HTTP request.
1234
+ #
1235
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1236
+ #
1237
+ def list_alert_feedback_with_http_info(service_name, short_name, custom_headers:nil)
1238
+ list_alert_feedback_async(service_name, short_name, custom_headers:custom_headers).value!
1239
+ end
1240
+
1241
+ #
1242
+ # Gets a list of all alert feedback for a given tenant and alert type.
1243
+ #
1244
+ # @param service_name [String] The name of the service.
1245
+ # @param short_name [String] The name of the alert.
1246
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1247
+ # to the HTTP request.
1248
+ #
1249
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1250
+ #
1251
+ def list_alert_feedback_async(service_name, short_name, custom_headers:nil)
1252
+ fail ArgumentError, 'service_name is nil' if service_name.nil?
1253
+ fail ArgumentError, 'short_name is nil' if short_name.nil?
1254
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1255
+
1256
+
1257
+ request_headers = {}
1258
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1259
+
1260
+ # Set Headers
1261
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1262
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1263
+ path_template = 'providers/Microsoft.ADHybridHealthService/services/{serviceName}/feedbacktype/alerts/{shortName}/alertfeedback'
1264
+
1265
+ request_url = @base_url || @client.base_url
1266
+
1267
+ options = {
1268
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1269
+ path_params: {'serviceName' => service_name,'shortName' => short_name},
1270
+ query_params: {'api-version' => @client.api_version},
1271
+ headers: request_headers.merge(custom_headers || {}),
1272
+ base_url: request_url
1273
+ }
1274
+ promise = @client.make_request_async(:get, path_template, options)
1275
+
1276
+ promise = promise.then do |result|
1277
+ http_response = result.response
1278
+ status_code = http_response.status
1279
+ response_content = http_response.body
1280
+ unless status_code == 200
1281
+ error_model = JSON.load(response_content)
1282
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1283
+ end
1284
+
1285
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1286
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1287
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1288
+ # Deserialize Response
1289
+ if status_code == 200
1290
+ begin
1291
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1292
+ result_mapper = Azure::ADHybridHealthService::Mgmt::V2014_01_01::Models::AlertFeedbacks.mapper()
1293
+ result.body = @client.deserialize(result_mapper, parsed_response)
1294
+ rescue Exception => e
1295
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1296
+ end
1297
+ end
1298
+
1299
+ result
1300
+ end
1301
+
1302
+ promise.execute
1303
+ end
1304
+
1305
+ #
1306
+ # Gets the average of the metric values for a given metric and group
1307
+ # combination.
1308
+ #
1309
+ # @param service_name [String] The name of the service.
1310
+ # @param metric_name [String] The metric name
1311
+ # @param group_name [String] The group name
1312
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1313
+ # will be added to the HTTP request.
1314
+ #
1315
+ # @return [Array<Item>] operation results.
1316
+ #
1317
+ def list_metrics_average(service_name, metric_name, group_name, custom_headers:nil)
1318
+ first_page = list_metrics_average_as_lazy(service_name, metric_name, group_name, custom_headers:custom_headers)
1319
+ first_page.get_all_items
1320
+ end
1321
+
1322
+ #
1323
+ # Gets the average of the metric values for a given metric and group
1324
+ # combination.
1325
+ #
1326
+ # @param service_name [String] The name of the service.
1327
+ # @param metric_name [String] The metric name
1328
+ # @param group_name [String] The group name
1329
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1330
+ # will be added to the HTTP request.
1331
+ #
1332
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1333
+ #
1334
+ def list_metrics_average_with_http_info(service_name, metric_name, group_name, custom_headers:nil)
1335
+ list_metrics_average_async(service_name, metric_name, group_name, custom_headers:custom_headers).value!
1336
+ end
1337
+
1338
+ #
1339
+ # Gets the average of the metric values for a given metric and group
1340
+ # combination.
1341
+ #
1342
+ # @param service_name [String] The name of the service.
1343
+ # @param metric_name [String] The metric name
1344
+ # @param group_name [String] The group name
1345
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1346
+ # to the HTTP request.
1347
+ #
1348
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1349
+ #
1350
+ def list_metrics_average_async(service_name, metric_name, group_name, custom_headers:nil)
1351
+ fail ArgumentError, 'service_name is nil' if service_name.nil?
1352
+ fail ArgumentError, 'metric_name is nil' if metric_name.nil?
1353
+ fail ArgumentError, 'group_name is nil' if group_name.nil?
1354
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1355
+
1356
+
1357
+ request_headers = {}
1358
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1359
+
1360
+ # Set Headers
1361
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1362
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1363
+ path_template = 'providers/Microsoft.ADHybridHealthService/services/{serviceName}/metrics/{metricName}/groups/{groupName}/average'
1364
+
1365
+ request_url = @base_url || @client.base_url
1366
+
1367
+ options = {
1368
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1369
+ path_params: {'serviceName' => service_name,'metricName' => metric_name,'groupName' => group_name},
1370
+ query_params: {'api-version' => @client.api_version},
1371
+ headers: request_headers.merge(custom_headers || {}),
1372
+ base_url: request_url
1373
+ }
1374
+ promise = @client.make_request_async(:get, path_template, options)
1375
+
1376
+ promise = promise.then do |result|
1377
+ http_response = result.response
1378
+ status_code = http_response.status
1379
+ response_content = http_response.body
1380
+ unless status_code == 200
1381
+ error_model = JSON.load(response_content)
1382
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1383
+ end
1384
+
1385
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1386
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1387
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1388
+ # Deserialize Response
1389
+ if status_code == 200
1390
+ begin
1391
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1392
+ result_mapper = Azure::ADHybridHealthService::Mgmt::V2014_01_01::Models::Metrics.mapper()
1393
+ result.body = @client.deserialize(result_mapper, parsed_response)
1394
+ rescue Exception => e
1395
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1396
+ end
1397
+ end
1398
+
1399
+ result
1400
+ end
1401
+
1402
+ promise.execute
1403
+ end
1404
+
1405
+ #
1406
+ # Gets the sum of the metric values for a given metric and group combination.
1407
+ #
1408
+ # @param service_name [String] The name of the service.
1409
+ # @param metric_name [String] The metric name
1410
+ # @param group_name [String] The group name
1411
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1412
+ # will be added to the HTTP request.
1413
+ #
1414
+ # @return [Array<Item>] operation results.
1415
+ #
1416
+ def list_metrics_sum(service_name, metric_name, group_name, custom_headers:nil)
1417
+ first_page = list_metrics_sum_as_lazy(service_name, metric_name, group_name, custom_headers:custom_headers)
1418
+ first_page.get_all_items
1419
+ end
1420
+
1421
+ #
1422
+ # Gets the sum of the metric values for a given metric and group combination.
1423
+ #
1424
+ # @param service_name [String] The name of the service.
1425
+ # @param metric_name [String] The metric name
1426
+ # @param group_name [String] The group name
1427
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1428
+ # will be added to the HTTP request.
1429
+ #
1430
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1431
+ #
1432
+ def list_metrics_sum_with_http_info(service_name, metric_name, group_name, custom_headers:nil)
1433
+ list_metrics_sum_async(service_name, metric_name, group_name, custom_headers:custom_headers).value!
1434
+ end
1435
+
1436
+ #
1437
+ # Gets the sum of the metric values for a given metric and group combination.
1438
+ #
1439
+ # @param service_name [String] The name of the service.
1440
+ # @param metric_name [String] The metric name
1441
+ # @param group_name [String] The group name
1442
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1443
+ # to the HTTP request.
1444
+ #
1445
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1446
+ #
1447
+ def list_metrics_sum_async(service_name, metric_name, group_name, custom_headers:nil)
1448
+ fail ArgumentError, 'service_name is nil' if service_name.nil?
1449
+ fail ArgumentError, 'metric_name is nil' if metric_name.nil?
1450
+ fail ArgumentError, 'group_name is nil' if group_name.nil?
1451
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1452
+
1453
+
1454
+ request_headers = {}
1455
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1456
+
1457
+ # Set Headers
1458
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1459
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1460
+ path_template = 'providers/Microsoft.ADHybridHealthService/services/{serviceName}/metrics/{metricName}/groups/{groupName}/sum'
1461
+
1462
+ request_url = @base_url || @client.base_url
1463
+
1464
+ options = {
1465
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1466
+ path_params: {'serviceName' => service_name,'metricName' => metric_name,'groupName' => group_name},
1467
+ query_params: {'api-version' => @client.api_version},
1468
+ headers: request_headers.merge(custom_headers || {}),
1469
+ base_url: request_url
1470
+ }
1471
+ promise = @client.make_request_async(:get, path_template, options)
1472
+
1473
+ promise = promise.then do |result|
1474
+ http_response = result.response
1475
+ status_code = http_response.status
1476
+ response_content = http_response.body
1477
+ unless status_code == 200
1478
+ error_model = JSON.load(response_content)
1479
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1480
+ end
1481
+
1482
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1483
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1484
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1485
+ # Deserialize Response
1486
+ if status_code == 200
1487
+ begin
1488
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1489
+ result_mapper = Azure::ADHybridHealthService::Mgmt::V2014_01_01::Models::Metrics.mapper()
1490
+ result.body = @client.deserialize(result_mapper, parsed_response)
1491
+ rescue Exception => e
1492
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1493
+ end
1494
+ end
1495
+
1496
+ result
1497
+ end
1498
+
1499
+ promise.execute
1500
+ end
1501
+
1502
+ #
1503
+ # Gets the service related metrics information.
1504
+ #
1505
+ # @param service_name [String] The name of the service.
1506
+ # @param filter [String] The metric metadata property filter to apply.
1507
+ # @param perf_counter [Boolean] Indicates if only performance counter metrics
1508
+ # are requested.
1509
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1510
+ # will be added to the HTTP request.
1511
+ #
1512
+ # @return [Array<MetricMetadata>] operation results.
1513
+ #
1514
+ def list_metric_metadata(service_name, filter:nil, perf_counter:nil, custom_headers:nil)
1515
+ first_page = list_metric_metadata_as_lazy(service_name, filter:filter, perf_counter:perf_counter, custom_headers:custom_headers)
1516
+ first_page.get_all_items
1517
+ end
1518
+
1519
+ #
1520
+ # Gets the service related metrics information.
1521
+ #
1522
+ # @param service_name [String] The name of the service.
1523
+ # @param filter [String] The metric metadata property filter to apply.
1524
+ # @param perf_counter [Boolean] Indicates if only performance counter metrics
1525
+ # are requested.
1526
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1527
+ # will be added to the HTTP request.
1528
+ #
1529
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1530
+ #
1531
+ def list_metric_metadata_with_http_info(service_name, filter:nil, perf_counter:nil, custom_headers:nil)
1532
+ list_metric_metadata_async(service_name, filter:filter, perf_counter:perf_counter, custom_headers:custom_headers).value!
1533
+ end
1534
+
1535
+ #
1536
+ # Gets the service related metrics information.
1537
+ #
1538
+ # @param service_name [String] The name of the service.
1539
+ # @param filter [String] The metric metadata property filter to apply.
1540
+ # @param perf_counter [Boolean] Indicates if only performance counter metrics
1541
+ # are requested.
1542
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1543
+ # to the HTTP request.
1544
+ #
1545
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1546
+ #
1547
+ def list_metric_metadata_async(service_name, filter:nil, perf_counter:nil, custom_headers:nil)
1548
+ fail ArgumentError, 'service_name is nil' if service_name.nil?
1549
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1550
+
1551
+
1552
+ request_headers = {}
1553
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1554
+
1555
+ # Set Headers
1556
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1557
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1558
+ path_template = 'providers/Microsoft.ADHybridHealthService/services/{serviceName}/metricmetadata'
1559
+
1560
+ request_url = @base_url || @client.base_url
1561
+
1562
+ options = {
1563
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1564
+ path_params: {'serviceName' => service_name},
1565
+ query_params: {'$filter' => filter,'perfCounter' => perf_counter,'api-version' => @client.api_version},
1566
+ headers: request_headers.merge(custom_headers || {}),
1567
+ base_url: request_url
1568
+ }
1569
+ promise = @client.make_request_async(:get, path_template, options)
1570
+
1571
+ promise = promise.then do |result|
1572
+ http_response = result.response
1573
+ status_code = http_response.status
1574
+ response_content = http_response.body
1575
+ unless status_code == 200
1576
+ error_model = JSON.load(response_content)
1577
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1578
+ end
1579
+
1580
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1581
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1582
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1583
+ # Deserialize Response
1584
+ if status_code == 200
1585
+ begin
1586
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1587
+ result_mapper = Azure::ADHybridHealthService::Mgmt::V2014_01_01::Models::MetricMetadataList.mapper()
1588
+ result.body = @client.deserialize(result_mapper, parsed_response)
1589
+ rescue Exception => e
1590
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1591
+ end
1592
+ end
1593
+
1594
+ result
1595
+ end
1596
+
1597
+ promise.execute
1598
+ end
1599
+
1600
+ #
1601
+ # Gets the service related metrics information.
1602
+ #
1603
+ # @param service_name [String] The name of the service.
1604
+ # @param metric_name [String] The metric name
1605
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1606
+ # will be added to the HTTP request.
1607
+ #
1608
+ # @return [MetricMetadata] operation results.
1609
+ #
1610
+ def get_metric_metadata(service_name, metric_name, custom_headers:nil)
1611
+ response = get_metric_metadata_async(service_name, metric_name, custom_headers:custom_headers).value!
1612
+ response.body unless response.nil?
1613
+ end
1614
+
1615
+ #
1616
+ # Gets the service related metrics information.
1617
+ #
1618
+ # @param service_name [String] The name of the service.
1619
+ # @param metric_name [String] The metric name
1620
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1621
+ # will be added to the HTTP request.
1622
+ #
1623
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1624
+ #
1625
+ def get_metric_metadata_with_http_info(service_name, metric_name, custom_headers:nil)
1626
+ get_metric_metadata_async(service_name, metric_name, custom_headers:custom_headers).value!
1627
+ end
1628
+
1629
+ #
1630
+ # Gets the service related metrics information.
1631
+ #
1632
+ # @param service_name [String] The name of the service.
1633
+ # @param metric_name [String] The metric name
1634
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1635
+ # to the HTTP request.
1636
+ #
1637
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1638
+ #
1639
+ def get_metric_metadata_async(service_name, metric_name, custom_headers:nil)
1640
+ fail ArgumentError, 'service_name is nil' if service_name.nil?
1641
+ fail ArgumentError, 'metric_name is nil' if metric_name.nil?
1642
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1643
+
1644
+
1645
+ request_headers = {}
1646
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1647
+
1648
+ # Set Headers
1649
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1650
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1651
+ path_template = 'providers/Microsoft.ADHybridHealthService/services/{serviceName}/metricmetadata/{metricName}'
1652
+
1653
+ request_url = @base_url || @client.base_url
1654
+
1655
+ options = {
1656
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1657
+ path_params: {'serviceName' => service_name,'metricName' => metric_name},
1658
+ query_params: {'api-version' => @client.api_version},
1659
+ headers: request_headers.merge(custom_headers || {}),
1660
+ base_url: request_url
1661
+ }
1662
+ promise = @client.make_request_async(:get, path_template, options)
1663
+
1664
+ promise = promise.then do |result|
1665
+ http_response = result.response
1666
+ status_code = http_response.status
1667
+ response_content = http_response.body
1668
+ unless status_code == 200
1669
+ error_model = JSON.load(response_content)
1670
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1671
+ end
1672
+
1673
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1674
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1675
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1676
+ # Deserialize Response
1677
+ if status_code == 200
1678
+ begin
1679
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1680
+ result_mapper = Azure::ADHybridHealthService::Mgmt::V2014_01_01::Models::MetricMetadata.mapper()
1681
+ result.body = @client.deserialize(result_mapper, parsed_response)
1682
+ rescue Exception => e
1683
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1684
+ end
1685
+ end
1686
+
1687
+ result
1688
+ end
1689
+
1690
+ promise.execute
1691
+ end
1692
+
1693
+ #
1694
+ # Gets the service related metrics for a given metric and group combination.
1695
+ #
1696
+ # @param service_name [String] The name of the service.
1697
+ # @param metric_name [String] The metric name
1698
+ # @param group_name [String] The group name
1699
+ # @param group_key [String] The group key
1700
+ # @param from_date [DateTime] The start date.
1701
+ # @param to_date [DateTime] The end date.
1702
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1703
+ # will be added to the HTTP request.
1704
+ #
1705
+ # @return [MetricSets] operation results.
1706
+ #
1707
+ def get_metric_metadata_for_group(service_name, metric_name, group_name, group_key:nil, from_date:nil, to_date:nil, custom_headers:nil)
1708
+ response = get_metric_metadata_for_group_async(service_name, metric_name, group_name, group_key:group_key, from_date:from_date, to_date:to_date, custom_headers:custom_headers).value!
1709
+ response.body unless response.nil?
1710
+ end
1711
+
1712
+ #
1713
+ # Gets the service related metrics for a given metric and group combination.
1714
+ #
1715
+ # @param service_name [String] The name of the service.
1716
+ # @param metric_name [String] The metric name
1717
+ # @param group_name [String] The group name
1718
+ # @param group_key [String] The group key
1719
+ # @param from_date [DateTime] The start date.
1720
+ # @param to_date [DateTime] The end date.
1721
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1722
+ # will be added to the HTTP request.
1723
+ #
1724
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1725
+ #
1726
+ def get_metric_metadata_for_group_with_http_info(service_name, metric_name, group_name, group_key:nil, from_date:nil, to_date:nil, custom_headers:nil)
1727
+ get_metric_metadata_for_group_async(service_name, metric_name, group_name, group_key:group_key, from_date:from_date, to_date:to_date, custom_headers:custom_headers).value!
1728
+ end
1729
+
1730
+ #
1731
+ # Gets the service related metrics for a given metric and group combination.
1732
+ #
1733
+ # @param service_name [String] The name of the service.
1734
+ # @param metric_name [String] The metric name
1735
+ # @param group_name [String] The group name
1736
+ # @param group_key [String] The group key
1737
+ # @param from_date [DateTime] The start date.
1738
+ # @param to_date [DateTime] The end date.
1739
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1740
+ # to the HTTP request.
1741
+ #
1742
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1743
+ #
1744
+ def get_metric_metadata_for_group_async(service_name, metric_name, group_name, group_key:nil, from_date:nil, to_date:nil, custom_headers:nil)
1745
+ fail ArgumentError, 'service_name is nil' if service_name.nil?
1746
+ fail ArgumentError, 'metric_name is nil' if metric_name.nil?
1747
+ fail ArgumentError, 'group_name is nil' if group_name.nil?
1748
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1749
+
1750
+
1751
+ request_headers = {}
1752
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1753
+
1754
+ # Set Headers
1755
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1756
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1757
+ path_template = 'providers/Microsoft.ADHybridHealthService/services/{serviceName}/metricmetadata/{metricName}/groups/{groupName}'
1758
+
1759
+ request_url = @base_url || @client.base_url
1760
+
1761
+ options = {
1762
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1763
+ path_params: {'serviceName' => service_name,'metricName' => metric_name,'groupName' => group_name},
1764
+ query_params: {'groupKey' => group_key,'fromDate' => from_date,'toDate' => to_date,'api-version' => @client.api_version},
1765
+ headers: request_headers.merge(custom_headers || {}),
1766
+ base_url: request_url
1767
+ }
1768
+ promise = @client.make_request_async(:get, path_template, options)
1769
+
1770
+ promise = promise.then do |result|
1771
+ http_response = result.response
1772
+ status_code = http_response.status
1773
+ response_content = http_response.body
1774
+ unless status_code == 200
1775
+ error_model = JSON.load(response_content)
1776
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1777
+ end
1778
+
1779
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1780
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1781
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1782
+ # Deserialize Response
1783
+ if status_code == 200
1784
+ begin
1785
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1786
+ result_mapper = Azure::ADHybridHealthService::Mgmt::V2014_01_01::Models::MetricSets.mapper()
1787
+ result.body = @client.deserialize(result_mapper, parsed_response)
1788
+ rescue Exception => e
1789
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1790
+ end
1791
+ end
1792
+
1793
+ result
1794
+ end
1795
+
1796
+ promise.execute
1797
+ end
1798
+
1799
+ #
1800
+ # Updates the service level monitoring configuration.
1801
+ #
1802
+ # @param service_name [String] The name of the service.
1803
+ # @param configuration_setting [Item] The monitoring configuration to update
1804
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1805
+ # will be added to the HTTP request.
1806
+ #
1807
+ #
1808
+ def update_monitoring_configuration(service_name, configuration_setting, custom_headers:nil)
1809
+ response = update_monitoring_configuration_async(service_name, configuration_setting, custom_headers:custom_headers).value!
1810
+ nil
1811
+ end
1812
+
1813
+ #
1814
+ # Updates the service level monitoring configuration.
1815
+ #
1816
+ # @param service_name [String] The name of the service.
1817
+ # @param configuration_setting [Item] The monitoring configuration to update
1818
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1819
+ # will be added to the HTTP request.
1820
+ #
1821
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1822
+ #
1823
+ def update_monitoring_configuration_with_http_info(service_name, configuration_setting, custom_headers:nil)
1824
+ update_monitoring_configuration_async(service_name, configuration_setting, custom_headers:custom_headers).value!
1825
+ end
1826
+
1827
+ #
1828
+ # Updates the service level monitoring configuration.
1829
+ #
1830
+ # @param service_name [String] The name of the service.
1831
+ # @param configuration_setting [Item] The monitoring configuration to update
1832
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1833
+ # to the HTTP request.
1834
+ #
1835
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1836
+ #
1837
+ def update_monitoring_configuration_async(service_name, configuration_setting, custom_headers:nil)
1838
+ fail ArgumentError, 'service_name is nil' if service_name.nil?
1839
+ fail ArgumentError, 'configuration_setting is nil' if configuration_setting.nil?
1840
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1841
+
1842
+
1843
+ request_headers = {}
1844
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1845
+
1846
+ # Set Headers
1847
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1848
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1849
+
1850
+ # Serialize Request
1851
+ request_mapper = Azure::ADHybridHealthService::Mgmt::V2014_01_01::Models::Item.mapper()
1852
+ request_content = @client.serialize(request_mapper, configuration_setting)
1853
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1854
+
1855
+ path_template = 'providers/Microsoft.ADHybridHealthService/services/{serviceName}/monitoringconfiguration'
1856
+
1857
+ request_url = @base_url || @client.base_url
1858
+
1859
+ options = {
1860
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1861
+ path_params: {'serviceName' => service_name},
1862
+ query_params: {'api-version' => @client.api_version},
1863
+ body: request_content,
1864
+ headers: request_headers.merge(custom_headers || {}),
1865
+ base_url: request_url
1866
+ }
1867
+ promise = @client.make_request_async(:patch, path_template, options)
1868
+
1869
+ promise = promise.then do |result|
1870
+ http_response = result.response
1871
+ status_code = http_response.status
1872
+ response_content = http_response.body
1873
+ unless status_code == 200
1874
+ error_model = JSON.load(response_content)
1875
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1876
+ end
1877
+
1878
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1879
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1880
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1881
+
1882
+ result
1883
+ end
1884
+
1885
+ promise.execute
1886
+ end
1887
+
1888
+ #
1889
+ # Gets the service level monitoring configurations.
1890
+ #
1891
+ # @param service_name [String] The name of the service.
1892
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1893
+ # will be added to the HTTP request.
1894
+ #
1895
+ # @return [Items] operation results.
1896
+ #
1897
+ def list_monitoring_configurations(service_name, custom_headers:nil)
1898
+ response = list_monitoring_configurations_async(service_name, custom_headers:custom_headers).value!
1899
+ response.body unless response.nil?
1900
+ end
1901
+
1902
+ #
1903
+ # Gets the service level monitoring configurations.
1904
+ #
1905
+ # @param service_name [String] The name of the service.
1906
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1907
+ # will be added to the HTTP request.
1908
+ #
1909
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1910
+ #
1911
+ def list_monitoring_configurations_with_http_info(service_name, custom_headers:nil)
1912
+ list_monitoring_configurations_async(service_name, custom_headers:custom_headers).value!
1913
+ end
1914
+
1915
+ #
1916
+ # Gets the service level monitoring configurations.
1917
+ #
1918
+ # @param service_name [String] The name of the service.
1919
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1920
+ # to the HTTP request.
1921
+ #
1922
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1923
+ #
1924
+ def list_monitoring_configurations_async(service_name, custom_headers:nil)
1925
+ fail ArgumentError, 'service_name is nil' if service_name.nil?
1926
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1927
+
1928
+
1929
+ request_headers = {}
1930
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1931
+
1932
+ # Set Headers
1933
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1934
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1935
+ path_template = 'providers/Microsoft.ADHybridHealthService/services/{serviceName}/monitoringconfigurations'
1936
+
1937
+ request_url = @base_url || @client.base_url
1938
+
1939
+ options = {
1940
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1941
+ path_params: {'serviceName' => service_name},
1942
+ query_params: {'api-version' => @client.api_version},
1943
+ headers: request_headers.merge(custom_headers || {}),
1944
+ base_url: request_url
1945
+ }
1946
+ promise = @client.make_request_async(:get, path_template, options)
1947
+
1948
+ promise = promise.then do |result|
1949
+ http_response = result.response
1950
+ status_code = http_response.status
1951
+ response_content = http_response.body
1952
+ unless status_code == 200
1953
+ error_model = JSON.load(response_content)
1954
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1955
+ end
1956
+
1957
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1958
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1959
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1960
+ # Deserialize Response
1961
+ if status_code == 200
1962
+ begin
1963
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1964
+ result_mapper = Azure::ADHybridHealthService::Mgmt::V2014_01_01::Models::Items.mapper()
1965
+ result.body = @client.deserialize(result_mapper, parsed_response)
1966
+ rescue Exception => e
1967
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1968
+ end
1969
+ end
1970
+
1971
+ result
1972
+ end
1973
+
1974
+ promise.execute
1975
+ end
1976
+
1977
+ #
1978
+ # Gets the bad password login attempt report for an user
1979
+ #
1980
+ # @param service_name [String] The name of the service.
1981
+ # @param data_source [String] The source of data, if its test data or customer
1982
+ # data.
1983
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1984
+ # will be added to the HTTP request.
1985
+ #
1986
+ # @return [ErrorReportUsersEntries] operation results.
1987
+ #
1988
+ def list_user_bad_password_report(service_name, data_source:nil, custom_headers:nil)
1989
+ response = list_user_bad_password_report_async(service_name, data_source:data_source, custom_headers:custom_headers).value!
1990
+ response.body unless response.nil?
1991
+ end
1992
+
1993
+ #
1994
+ # Gets the bad password login attempt report for an user
1995
+ #
1996
+ # @param service_name [String] The name of the service.
1997
+ # @param data_source [String] The source of data, if its test data or customer
1998
+ # data.
1999
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2000
+ # will be added to the HTTP request.
2001
+ #
2002
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2003
+ #
2004
+ def list_user_bad_password_report_with_http_info(service_name, data_source:nil, custom_headers:nil)
2005
+ list_user_bad_password_report_async(service_name, data_source:data_source, custom_headers:custom_headers).value!
2006
+ end
2007
+
2008
+ #
2009
+ # Gets the bad password login attempt report for an user
2010
+ #
2011
+ # @param service_name [String] The name of the service.
2012
+ # @param data_source [String] The source of data, if its test data or customer
2013
+ # data.
2014
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2015
+ # to the HTTP request.
2016
+ #
2017
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2018
+ #
2019
+ def list_user_bad_password_report_async(service_name, data_source:nil, custom_headers:nil)
2020
+ fail ArgumentError, 'service_name is nil' if service_name.nil?
2021
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
2022
+
2023
+
2024
+ request_headers = {}
2025
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2026
+
2027
+ # Set Headers
2028
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2029
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2030
+ path_template = 'providers/Microsoft.ADHybridHealthService/services/{serviceName}/reports/badpassword/details/user'
2031
+
2032
+ request_url = @base_url || @client.base_url
2033
+
2034
+ options = {
2035
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2036
+ path_params: {'serviceName' => service_name},
2037
+ query_params: {'dataSource' => data_source,'api-version' => @client.api_version},
2038
+ headers: request_headers.merge(custom_headers || {}),
2039
+ base_url: request_url
2040
+ }
2041
+ promise = @client.make_request_async(:get, path_template, options)
2042
+
2043
+ promise = promise.then do |result|
2044
+ http_response = result.response
2045
+ status_code = http_response.status
2046
+ response_content = http_response.body
2047
+ unless status_code == 200
2048
+ error_model = JSON.load(response_content)
2049
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2050
+ end
2051
+
2052
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2053
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2054
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2055
+ # Deserialize Response
2056
+ if status_code == 200
2057
+ begin
2058
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2059
+ result_mapper = Azure::ADHybridHealthService::Mgmt::V2014_01_01::Models::ErrorReportUsersEntries.mapper()
2060
+ result.body = @client.deserialize(result_mapper, parsed_response)
2061
+ rescue Exception => e
2062
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2063
+ end
2064
+ end
2065
+
2066
+ result
2067
+ end
2068
+
2069
+ promise.execute
2070
+ end
2071
+
2072
+ #
2073
+ # Checks if the tenant, to which a service is registered, is whitelisted to use
2074
+ # a feature.
2075
+ #
2076
+ # @param service_name [String] The name of the service.
2077
+ # @param feature_name [String] The name of the feature.
2078
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2079
+ # will be added to the HTTP request.
2080
+ #
2081
+ # @return [Result] operation results.
2082
+ #
2083
+ def get_tenant_whitelisting(service_name, feature_name, custom_headers:nil)
2084
+ response = get_tenant_whitelisting_async(service_name, feature_name, custom_headers:custom_headers).value!
2085
+ response.body unless response.nil?
2086
+ end
2087
+
2088
+ #
2089
+ # Checks if the tenant, to which a service is registered, is whitelisted to use
2090
+ # a feature.
2091
+ #
2092
+ # @param service_name [String] The name of the service.
2093
+ # @param feature_name [String] The name of the feature.
2094
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2095
+ # will be added to the HTTP request.
2096
+ #
2097
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2098
+ #
2099
+ def get_tenant_whitelisting_with_http_info(service_name, feature_name, custom_headers:nil)
2100
+ get_tenant_whitelisting_async(service_name, feature_name, custom_headers:custom_headers).value!
2101
+ end
2102
+
2103
+ #
2104
+ # Checks if the tenant, to which a service is registered, is whitelisted to use
2105
+ # a feature.
2106
+ #
2107
+ # @param service_name [String] The name of the service.
2108
+ # @param feature_name [String] The name of the feature.
2109
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2110
+ # to the HTTP request.
2111
+ #
2112
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2113
+ #
2114
+ def get_tenant_whitelisting_async(service_name, feature_name, custom_headers:nil)
2115
+ fail ArgumentError, 'service_name is nil' if service_name.nil?
2116
+ fail ArgumentError, 'feature_name is nil' if feature_name.nil?
2117
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
2118
+
2119
+
2120
+ request_headers = {}
2121
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2122
+
2123
+ # Set Headers
2124
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2125
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2126
+ path_template = 'providers/Microsoft.ADHybridHealthService/services/{serviceName}/TenantWhitelisting/{featureName}'
2127
+
2128
+ request_url = @base_url || @client.base_url
2129
+
2130
+ options = {
2131
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2132
+ path_params: {'serviceName' => service_name,'featureName' => feature_name},
2133
+ query_params: {'api-version' => @client.api_version},
2134
+ headers: request_headers.merge(custom_headers || {}),
2135
+ base_url: request_url
2136
+ }
2137
+ promise = @client.make_request_async(:get, path_template, options)
2138
+
2139
+ promise = promise.then do |result|
2140
+ http_response = result.response
2141
+ status_code = http_response.status
2142
+ response_content = http_response.body
2143
+ unless status_code == 200
2144
+ error_model = JSON.load(response_content)
2145
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2146
+ end
2147
+
2148
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2149
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2150
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2151
+ # Deserialize Response
2152
+ if status_code == 200
2153
+ begin
2154
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2155
+ result_mapper = Azure::ADHybridHealthService::Mgmt::V2014_01_01::Models::Result.mapper()
2156
+ result.body = @client.deserialize(result_mapper, parsed_response)
2157
+ rescue Exception => e
2158
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2159
+ end
2160
+ end
2161
+
2162
+ result
2163
+ end
2164
+
2165
+ promise.execute
2166
+ end
2167
+
2168
+ #
2169
+ # Gets all Risky IP report URIs for the last 7 days.
2170
+ #
2171
+ # @param service_name [String] The name of the service.
2172
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2173
+ # will be added to the HTTP request.
2174
+ #
2175
+ # @return [RiskyIPBlobUris] operation results.
2176
+ #
2177
+ def list_all_risky_ip_download_report(service_name, custom_headers:nil)
2178
+ response = list_all_risky_ip_download_report_async(service_name, custom_headers:custom_headers).value!
2179
+ response.body unless response.nil?
2180
+ end
2181
+
2182
+ #
2183
+ # Gets all Risky IP report URIs for the last 7 days.
2184
+ #
2185
+ # @param service_name [String] The name of the service.
2186
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2187
+ # will be added to the HTTP request.
2188
+ #
2189
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2190
+ #
2191
+ def list_all_risky_ip_download_report_with_http_info(service_name, custom_headers:nil)
2192
+ list_all_risky_ip_download_report_async(service_name, custom_headers:custom_headers).value!
2193
+ end
2194
+
2195
+ #
2196
+ # Gets all Risky IP report URIs for the last 7 days.
2197
+ #
2198
+ # @param service_name [String] The name of the service.
2199
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2200
+ # to the HTTP request.
2201
+ #
2202
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2203
+ #
2204
+ def list_all_risky_ip_download_report_async(service_name, custom_headers:nil)
2205
+ fail ArgumentError, 'service_name is nil' if service_name.nil?
2206
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
2207
+
2208
+
2209
+ request_headers = {}
2210
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2211
+
2212
+ # Set Headers
2213
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2214
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2215
+ path_template = 'providers/Microsoft.ADHybridHealthService/services/{serviceName}/reports/riskyIp/blobUris'
2216
+
2217
+ request_url = @base_url || @client.base_url
2218
+
2219
+ options = {
2220
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2221
+ path_params: {'serviceName' => service_name},
2222
+ query_params: {'api-version' => @client.api_version},
2223
+ headers: request_headers.merge(custom_headers || {}),
2224
+ base_url: request_url
2225
+ }
2226
+ promise = @client.make_request_async(:get, path_template, options)
2227
+
2228
+ promise = promise.then do |result|
2229
+ http_response = result.response
2230
+ status_code = http_response.status
2231
+ response_content = http_response.body
2232
+ unless status_code == 200
2233
+ error_model = JSON.load(response_content)
2234
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2235
+ end
2236
+
2237
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2238
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2239
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2240
+ # Deserialize Response
2241
+ if status_code == 200
2242
+ begin
2243
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2244
+ result_mapper = Azure::ADHybridHealthService::Mgmt::V2014_01_01::Models::RiskyIPBlobUris.mapper()
2245
+ result.body = @client.deserialize(result_mapper, parsed_response)
2246
+ rescue Exception => e
2247
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2248
+ end
2249
+ end
2250
+
2251
+ result
2252
+ end
2253
+
2254
+ promise.execute
2255
+ end
2256
+
2257
+ #
2258
+ # Initiate the generation of a new Risky IP report. Returns the URI for the new
2259
+ # one.
2260
+ #
2261
+ # @param service_name [String] The name of the service.
2262
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2263
+ # will be added to the HTTP request.
2264
+ #
2265
+ # @return [RiskyIPBlobUris] operation results.
2266
+ #
2267
+ def list_current_risky_ip_download_report(service_name, custom_headers:nil)
2268
+ response = list_current_risky_ip_download_report_async(service_name, custom_headers:custom_headers).value!
2269
+ response.body unless response.nil?
2270
+ end
2271
+
2272
+ #
2273
+ # Initiate the generation of a new Risky IP report. Returns the URI for the new
2274
+ # one.
2275
+ #
2276
+ # @param service_name [String] The name of the service.
2277
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2278
+ # will be added to the HTTP request.
2279
+ #
2280
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2281
+ #
2282
+ def list_current_risky_ip_download_report_with_http_info(service_name, custom_headers:nil)
2283
+ list_current_risky_ip_download_report_async(service_name, custom_headers:custom_headers).value!
2284
+ end
2285
+
2286
+ #
2287
+ # Initiate the generation of a new Risky IP report. Returns the URI for the new
2288
+ # one.
2289
+ #
2290
+ # @param service_name [String] The name of the service.
2291
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2292
+ # to the HTTP request.
2293
+ #
2294
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2295
+ #
2296
+ def list_current_risky_ip_download_report_async(service_name, custom_headers:nil)
2297
+ fail ArgumentError, 'service_name is nil' if service_name.nil?
2298
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
2299
+
2300
+
2301
+ request_headers = {}
2302
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2303
+
2304
+ # Set Headers
2305
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2306
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2307
+ path_template = 'providers/Microsoft.ADHybridHealthService/services/{serviceName}/reports/riskyIp/generateBlobUri'
2308
+
2309
+ request_url = @base_url || @client.base_url
2310
+
2311
+ options = {
2312
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2313
+ path_params: {'serviceName' => service_name},
2314
+ query_params: {'api-version' => @client.api_version},
2315
+ headers: request_headers.merge(custom_headers || {}),
2316
+ base_url: request_url
2317
+ }
2318
+ promise = @client.make_request_async(:post, path_template, options)
2319
+
2320
+ promise = promise.then do |result|
2321
+ http_response = result.response
2322
+ status_code = http_response.status
2323
+ response_content = http_response.body
2324
+ unless status_code == 200
2325
+ error_model = JSON.load(response_content)
2326
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2327
+ end
2328
+
2329
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2330
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2331
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2332
+ # Deserialize Response
2333
+ if status_code == 200
2334
+ begin
2335
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2336
+ result_mapper = Azure::ADHybridHealthService::Mgmt::V2014_01_01::Models::RiskyIPBlobUris.mapper()
2337
+ result.body = @client.deserialize(result_mapper, parsed_response)
2338
+ rescue Exception => e
2339
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2340
+ end
2341
+ end
2342
+
2343
+ result
2344
+ end
2345
+
2346
+ promise.execute
2347
+ end
2348
+
2349
+ #
2350
+ # Gets the details of services, for a tenant, that are onboarded to Azure
2351
+ # Active Directory Connect Health.
2352
+ #
2353
+ # @param next_page_link [String] The NextLink from the previous successful call
2354
+ # to List operation.
2355
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2356
+ # will be added to the HTTP request.
2357
+ #
2358
+ # @return [Services] operation results.
2359
+ #
2360
+ def list_next(next_page_link, custom_headers:nil)
2361
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
2362
+ response.body unless response.nil?
2363
+ end
2364
+
2365
+ #
2366
+ # Gets the details of services, for a tenant, that are onboarded to Azure
2367
+ # Active Directory Connect Health.
2368
+ #
2369
+ # @param next_page_link [String] The NextLink from the previous successful call
2370
+ # to List operation.
2371
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2372
+ # will be added to the HTTP request.
2373
+ #
2374
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2375
+ #
2376
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
2377
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
2378
+ end
2379
+
2380
+ #
2381
+ # Gets the details of services, for a tenant, that are onboarded to Azure
2382
+ # Active Directory Connect Health.
2383
+ #
2384
+ # @param next_page_link [String] The NextLink from the previous successful call
2385
+ # to List operation.
2386
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2387
+ # to the HTTP request.
2388
+ #
2389
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2390
+ #
2391
+ def list_next_async(next_page_link, custom_headers:nil)
2392
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
2393
+
2394
+
2395
+ request_headers = {}
2396
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2397
+
2398
+ # Set Headers
2399
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2400
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2401
+ path_template = '{nextLink}'
2402
+
2403
+ request_url = @base_url || @client.base_url
2404
+
2405
+ options = {
2406
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2407
+ skip_encoding_path_params: {'nextLink' => next_page_link},
2408
+ headers: request_headers.merge(custom_headers || {}),
2409
+ base_url: request_url
2410
+ }
2411
+ promise = @client.make_request_async(:get, path_template, options)
2412
+
2413
+ promise = promise.then do |result|
2414
+ http_response = result.response
2415
+ status_code = http_response.status
2416
+ response_content = http_response.body
2417
+ unless status_code == 200
2418
+ error_model = JSON.load(response_content)
2419
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2420
+ end
2421
+
2422
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2423
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2424
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2425
+ # Deserialize Response
2426
+ if status_code == 200
2427
+ begin
2428
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2429
+ result_mapper = Azure::ADHybridHealthService::Mgmt::V2014_01_01::Models::Services.mapper()
2430
+ result.body = @client.deserialize(result_mapper, parsed_response)
2431
+ rescue Exception => e
2432
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2433
+ end
2434
+ end
2435
+
2436
+ result
2437
+ end
2438
+
2439
+ promise.execute
2440
+ end
2441
+
2442
+ #
2443
+ # Gets the details of services for a tenant having Azure AD Premium license and
2444
+ # is onboarded to Azure Active Directory Connect Health.
2445
+ #
2446
+ # @param next_page_link [String] The NextLink from the previous successful call
2447
+ # to List operation.
2448
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2449
+ # will be added to the HTTP request.
2450
+ #
2451
+ # @return [Services] operation results.
2452
+ #
2453
+ def list_premium_next(next_page_link, custom_headers:nil)
2454
+ response = list_premium_next_async(next_page_link, custom_headers:custom_headers).value!
2455
+ response.body unless response.nil?
2456
+ end
2457
+
2458
+ #
2459
+ # Gets the details of services for a tenant having Azure AD Premium license and
2460
+ # is onboarded to Azure Active Directory Connect Health.
2461
+ #
2462
+ # @param next_page_link [String] The NextLink from the previous successful call
2463
+ # to List operation.
2464
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2465
+ # will be added to the HTTP request.
2466
+ #
2467
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2468
+ #
2469
+ def list_premium_next_with_http_info(next_page_link, custom_headers:nil)
2470
+ list_premium_next_async(next_page_link, custom_headers:custom_headers).value!
2471
+ end
2472
+
2473
+ #
2474
+ # Gets the details of services for a tenant having Azure AD Premium license and
2475
+ # is onboarded to Azure Active Directory Connect Health.
2476
+ #
2477
+ # @param next_page_link [String] The NextLink from the previous successful call
2478
+ # to List operation.
2479
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2480
+ # to the HTTP request.
2481
+ #
2482
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2483
+ #
2484
+ def list_premium_next_async(next_page_link, custom_headers:nil)
2485
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
2486
+
2487
+
2488
+ request_headers = {}
2489
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2490
+
2491
+ # Set Headers
2492
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2493
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2494
+ path_template = '{nextLink}'
2495
+
2496
+ request_url = @base_url || @client.base_url
2497
+
2498
+ options = {
2499
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2500
+ skip_encoding_path_params: {'nextLink' => next_page_link},
2501
+ headers: request_headers.merge(custom_headers || {}),
2502
+ base_url: request_url
2503
+ }
2504
+ promise = @client.make_request_async(:get, path_template, options)
2505
+
2506
+ promise = promise.then do |result|
2507
+ http_response = result.response
2508
+ status_code = http_response.status
2509
+ response_content = http_response.body
2510
+ unless status_code == 200
2511
+ error_model = JSON.load(response_content)
2512
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2513
+ end
2514
+
2515
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2516
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2517
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2518
+ # Deserialize Response
2519
+ if status_code == 200
2520
+ begin
2521
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2522
+ result_mapper = Azure::ADHybridHealthService::Mgmt::V2014_01_01::Models::Services.mapper()
2523
+ result.body = @client.deserialize(result_mapper, parsed_response)
2524
+ rescue Exception => e
2525
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2526
+ end
2527
+ end
2528
+
2529
+ result
2530
+ end
2531
+
2532
+ promise.execute
2533
+ end
2534
+
2535
+ #
2536
+ # Gets the alerts for a given service.
2537
+ #
2538
+ # @param next_page_link [String] The NextLink from the previous successful call
2539
+ # to List operation.
2540
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2541
+ # will be added to the HTTP request.
2542
+ #
2543
+ # @return [Alerts] operation results.
2544
+ #
2545
+ def list_alerts_next(next_page_link, custom_headers:nil)
2546
+ response = list_alerts_next_async(next_page_link, custom_headers:custom_headers).value!
2547
+ response.body unless response.nil?
2548
+ end
2549
+
2550
+ #
2551
+ # Gets the alerts for a given service.
2552
+ #
2553
+ # @param next_page_link [String] The NextLink from the previous successful call
2554
+ # to List operation.
2555
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2556
+ # will be added to the HTTP request.
2557
+ #
2558
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2559
+ #
2560
+ def list_alerts_next_with_http_info(next_page_link, custom_headers:nil)
2561
+ list_alerts_next_async(next_page_link, custom_headers:custom_headers).value!
2562
+ end
2563
+
2564
+ #
2565
+ # Gets the alerts for a given service.
2566
+ #
2567
+ # @param next_page_link [String] The NextLink from the previous successful call
2568
+ # to List operation.
2569
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2570
+ # to the HTTP request.
2571
+ #
2572
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2573
+ #
2574
+ def list_alerts_next_async(next_page_link, custom_headers:nil)
2575
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
2576
+
2577
+
2578
+ request_headers = {}
2579
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2580
+
2581
+ # Set Headers
2582
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2583
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2584
+ path_template = '{nextLink}'
2585
+
2586
+ request_url = @base_url || @client.base_url
2587
+
2588
+ options = {
2589
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2590
+ skip_encoding_path_params: {'nextLink' => next_page_link},
2591
+ headers: request_headers.merge(custom_headers || {}),
2592
+ base_url: request_url
2593
+ }
2594
+ promise = @client.make_request_async(:get, path_template, options)
2595
+
2596
+ promise = promise.then do |result|
2597
+ http_response = result.response
2598
+ status_code = http_response.status
2599
+ response_content = http_response.body
2600
+ unless status_code == 200
2601
+ error_model = JSON.load(response_content)
2602
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2603
+ end
2604
+
2605
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2606
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2607
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2608
+ # Deserialize Response
2609
+ if status_code == 200
2610
+ begin
2611
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2612
+ result_mapper = Azure::ADHybridHealthService::Mgmt::V2014_01_01::Models::Alerts.mapper()
2613
+ result.body = @client.deserialize(result_mapper, parsed_response)
2614
+ rescue Exception => e
2615
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2616
+ end
2617
+ end
2618
+
2619
+ result
2620
+ end
2621
+
2622
+ promise.execute
2623
+ end
2624
+
2625
+ #
2626
+ # Gets the export status.
2627
+ #
2628
+ # @param next_page_link [String] The NextLink from the previous successful call
2629
+ # to List operation.
2630
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2631
+ # will be added to the HTTP request.
2632
+ #
2633
+ # @return [ExportStatuses] operation results.
2634
+ #
2635
+ def list_export_status_next(next_page_link, custom_headers:nil)
2636
+ response = list_export_status_next_async(next_page_link, custom_headers:custom_headers).value!
2637
+ response.body unless response.nil?
2638
+ end
2639
+
2640
+ #
2641
+ # Gets the export status.
2642
+ #
2643
+ # @param next_page_link [String] The NextLink from the previous successful call
2644
+ # to List operation.
2645
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2646
+ # will be added to the HTTP request.
2647
+ #
2648
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2649
+ #
2650
+ def list_export_status_next_with_http_info(next_page_link, custom_headers:nil)
2651
+ list_export_status_next_async(next_page_link, custom_headers:custom_headers).value!
2652
+ end
2653
+
2654
+ #
2655
+ # Gets the export status.
2656
+ #
2657
+ # @param next_page_link [String] The NextLink from the previous successful call
2658
+ # to List operation.
2659
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2660
+ # to the HTTP request.
2661
+ #
2662
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2663
+ #
2664
+ def list_export_status_next_async(next_page_link, custom_headers:nil)
2665
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
2666
+
2667
+
2668
+ request_headers = {}
2669
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2670
+
2671
+ # Set Headers
2672
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2673
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2674
+ path_template = '{nextLink}'
2675
+
2676
+ request_url = @base_url || @client.base_url
2677
+
2678
+ options = {
2679
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2680
+ skip_encoding_path_params: {'nextLink' => next_page_link},
2681
+ headers: request_headers.merge(custom_headers || {}),
2682
+ base_url: request_url
2683
+ }
2684
+ promise = @client.make_request_async(:get, path_template, options)
2685
+
2686
+ promise = promise.then do |result|
2687
+ http_response = result.response
2688
+ status_code = http_response.status
2689
+ response_content = http_response.body
2690
+ unless status_code == 200
2691
+ error_model = JSON.load(response_content)
2692
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2693
+ end
2694
+
2695
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2696
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2697
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2698
+ # Deserialize Response
2699
+ if status_code == 200
2700
+ begin
2701
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2702
+ result_mapper = Azure::ADHybridHealthService::Mgmt::V2014_01_01::Models::ExportStatuses.mapper()
2703
+ result.body = @client.deserialize(result_mapper, parsed_response)
2704
+ rescue Exception => e
2705
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2706
+ end
2707
+ end
2708
+
2709
+ result
2710
+ end
2711
+
2712
+ promise.execute
2713
+ end
2714
+
2715
+ #
2716
+ # Gets the average of the metric values for a given metric and group
2717
+ # combination.
2718
+ #
2719
+ # @param next_page_link [String] The NextLink from the previous successful call
2720
+ # to List operation.
2721
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2722
+ # will be added to the HTTP request.
2723
+ #
2724
+ # @return [Metrics] operation results.
2725
+ #
2726
+ def list_metrics_average_next(next_page_link, custom_headers:nil)
2727
+ response = list_metrics_average_next_async(next_page_link, custom_headers:custom_headers).value!
2728
+ response.body unless response.nil?
2729
+ end
2730
+
2731
+ #
2732
+ # Gets the average of the metric values for a given metric and group
2733
+ # combination.
2734
+ #
2735
+ # @param next_page_link [String] The NextLink from the previous successful call
2736
+ # to List operation.
2737
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2738
+ # will be added to the HTTP request.
2739
+ #
2740
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2741
+ #
2742
+ def list_metrics_average_next_with_http_info(next_page_link, custom_headers:nil)
2743
+ list_metrics_average_next_async(next_page_link, custom_headers:custom_headers).value!
2744
+ end
2745
+
2746
+ #
2747
+ # Gets the average of the metric values for a given metric and group
2748
+ # combination.
2749
+ #
2750
+ # @param next_page_link [String] The NextLink from the previous successful call
2751
+ # to List operation.
2752
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2753
+ # to the HTTP request.
2754
+ #
2755
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2756
+ #
2757
+ def list_metrics_average_next_async(next_page_link, custom_headers:nil)
2758
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
2759
+
2760
+
2761
+ request_headers = {}
2762
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2763
+
2764
+ # Set Headers
2765
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2766
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2767
+ path_template = '{nextLink}'
2768
+
2769
+ request_url = @base_url || @client.base_url
2770
+
2771
+ options = {
2772
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2773
+ skip_encoding_path_params: {'nextLink' => next_page_link},
2774
+ headers: request_headers.merge(custom_headers || {}),
2775
+ base_url: request_url
2776
+ }
2777
+ promise = @client.make_request_async(:get, path_template, options)
2778
+
2779
+ promise = promise.then do |result|
2780
+ http_response = result.response
2781
+ status_code = http_response.status
2782
+ response_content = http_response.body
2783
+ unless status_code == 200
2784
+ error_model = JSON.load(response_content)
2785
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2786
+ end
2787
+
2788
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2789
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2790
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2791
+ # Deserialize Response
2792
+ if status_code == 200
2793
+ begin
2794
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2795
+ result_mapper = Azure::ADHybridHealthService::Mgmt::V2014_01_01::Models::Metrics.mapper()
2796
+ result.body = @client.deserialize(result_mapper, parsed_response)
2797
+ rescue Exception => e
2798
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2799
+ end
2800
+ end
2801
+
2802
+ result
2803
+ end
2804
+
2805
+ promise.execute
2806
+ end
2807
+
2808
+ #
2809
+ # Gets the sum of the metric values for a given metric and group combination.
2810
+ #
2811
+ # @param next_page_link [String] The NextLink from the previous successful call
2812
+ # to List operation.
2813
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2814
+ # will be added to the HTTP request.
2815
+ #
2816
+ # @return [Metrics] operation results.
2817
+ #
2818
+ def list_metrics_sum_next(next_page_link, custom_headers:nil)
2819
+ response = list_metrics_sum_next_async(next_page_link, custom_headers:custom_headers).value!
2820
+ response.body unless response.nil?
2821
+ end
2822
+
2823
+ #
2824
+ # Gets the sum of the metric values for a given metric and group combination.
2825
+ #
2826
+ # @param next_page_link [String] The NextLink from the previous successful call
2827
+ # to List operation.
2828
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2829
+ # will be added to the HTTP request.
2830
+ #
2831
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2832
+ #
2833
+ def list_metrics_sum_next_with_http_info(next_page_link, custom_headers:nil)
2834
+ list_metrics_sum_next_async(next_page_link, custom_headers:custom_headers).value!
2835
+ end
2836
+
2837
+ #
2838
+ # Gets the sum of the metric values for a given metric and group combination.
2839
+ #
2840
+ # @param next_page_link [String] The NextLink from the previous successful call
2841
+ # to List operation.
2842
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2843
+ # to the HTTP request.
2844
+ #
2845
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2846
+ #
2847
+ def list_metrics_sum_next_async(next_page_link, custom_headers:nil)
2848
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
2849
+
2850
+
2851
+ request_headers = {}
2852
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2853
+
2854
+ # Set Headers
2855
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2856
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2857
+ path_template = '{nextLink}'
2858
+
2859
+ request_url = @base_url || @client.base_url
2860
+
2861
+ options = {
2862
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2863
+ skip_encoding_path_params: {'nextLink' => next_page_link},
2864
+ headers: request_headers.merge(custom_headers || {}),
2865
+ base_url: request_url
2866
+ }
2867
+ promise = @client.make_request_async(:get, path_template, options)
2868
+
2869
+ promise = promise.then do |result|
2870
+ http_response = result.response
2871
+ status_code = http_response.status
2872
+ response_content = http_response.body
2873
+ unless status_code == 200
2874
+ error_model = JSON.load(response_content)
2875
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2876
+ end
2877
+
2878
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2879
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2880
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2881
+ # Deserialize Response
2882
+ if status_code == 200
2883
+ begin
2884
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2885
+ result_mapper = Azure::ADHybridHealthService::Mgmt::V2014_01_01::Models::Metrics.mapper()
2886
+ result.body = @client.deserialize(result_mapper, parsed_response)
2887
+ rescue Exception => e
2888
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2889
+ end
2890
+ end
2891
+
2892
+ result
2893
+ end
2894
+
2895
+ promise.execute
2896
+ end
2897
+
2898
+ #
2899
+ # Gets the service related metrics information.
2900
+ #
2901
+ # @param next_page_link [String] The NextLink from the previous successful call
2902
+ # to List operation.
2903
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2904
+ # will be added to the HTTP request.
2905
+ #
2906
+ # @return [MetricMetadataList] operation results.
2907
+ #
2908
+ def list_metric_metadata_next(next_page_link, custom_headers:nil)
2909
+ response = list_metric_metadata_next_async(next_page_link, custom_headers:custom_headers).value!
2910
+ response.body unless response.nil?
2911
+ end
2912
+
2913
+ #
2914
+ # Gets the service related metrics information.
2915
+ #
2916
+ # @param next_page_link [String] The NextLink from the previous successful call
2917
+ # to List operation.
2918
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2919
+ # will be added to the HTTP request.
2920
+ #
2921
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2922
+ #
2923
+ def list_metric_metadata_next_with_http_info(next_page_link, custom_headers:nil)
2924
+ list_metric_metadata_next_async(next_page_link, custom_headers:custom_headers).value!
2925
+ end
2926
+
2927
+ #
2928
+ # Gets the service related metrics information.
2929
+ #
2930
+ # @param next_page_link [String] The NextLink from the previous successful call
2931
+ # to List operation.
2932
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2933
+ # to the HTTP request.
2934
+ #
2935
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2936
+ #
2937
+ def list_metric_metadata_next_async(next_page_link, custom_headers:nil)
2938
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
2939
+
2940
+
2941
+ request_headers = {}
2942
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2943
+
2944
+ # Set Headers
2945
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2946
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2947
+ path_template = '{nextLink}'
2948
+
2949
+ request_url = @base_url || @client.base_url
2950
+
2951
+ options = {
2952
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2953
+ skip_encoding_path_params: {'nextLink' => next_page_link},
2954
+ headers: request_headers.merge(custom_headers || {}),
2955
+ base_url: request_url
2956
+ }
2957
+ promise = @client.make_request_async(:get, path_template, options)
2958
+
2959
+ promise = promise.then do |result|
2960
+ http_response = result.response
2961
+ status_code = http_response.status
2962
+ response_content = http_response.body
2963
+ unless status_code == 200
2964
+ error_model = JSON.load(response_content)
2965
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2966
+ end
2967
+
2968
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2969
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2970
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2971
+ # Deserialize Response
2972
+ if status_code == 200
2973
+ begin
2974
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2975
+ result_mapper = Azure::ADHybridHealthService::Mgmt::V2014_01_01::Models::MetricMetadataList.mapper()
2976
+ result.body = @client.deserialize(result_mapper, parsed_response)
2977
+ rescue Exception => e
2978
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2979
+ end
2980
+ end
2981
+
2982
+ result
2983
+ end
2984
+
2985
+ promise.execute
2986
+ end
2987
+
2988
+ #
2989
+ # Gets the details of services, for a tenant, that are onboarded to Azure
2990
+ # Active Directory Connect Health.
2991
+ #
2992
+ # @param filter [String] The service property filter to apply.
2993
+ # @param service_type [String] The service type for the services onboarded to
2994
+ # Azure Active Directory Connect Health. Depending on whether the service is
2995
+ # monitoring, ADFS, Sync or ADDS roles, the service type can either be
2996
+ # AdFederationService or AadSyncService or AdDomainService.
2997
+ # @param skip_count [Integer] The skip count, which specifies the number of
2998
+ # elements that can be bypassed from a sequence and then return the remaining
2999
+ # elements.
3000
+ # @param take_count [Integer] The take count , which specifies the number of
3001
+ # elements that can be returned from a sequence.
3002
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3003
+ # will be added to the HTTP request.
3004
+ #
3005
+ # @return [Services] which provide lazy access to pages of the response.
3006
+ #
3007
+ def list_as_lazy(filter:nil, service_type:nil, skip_count:nil, take_count:nil, custom_headers:nil)
3008
+ response = list_async(filter:filter, service_type:service_type, skip_count:skip_count, take_count:take_count, custom_headers:custom_headers).value!
3009
+ unless response.nil?
3010
+ page = response.body
3011
+ page.next_method = Proc.new do |next_page_link|
3012
+ list_next_async(next_page_link, custom_headers:custom_headers)
3013
+ end
3014
+ page
3015
+ end
3016
+ end
3017
+
3018
+ #
3019
+ # Gets the details of services for a tenant having Azure AD Premium license and
3020
+ # is onboarded to Azure Active Directory Connect Health.
3021
+ #
3022
+ # @param filter [String] The service property filter to apply.
3023
+ # @param service_type [String] The service type for the services onboarded to
3024
+ # Azure Active Directory Connect Health. Depending on whether the service is
3025
+ # monitoring, ADFS, Sync or ADDS roles, the service type can either be
3026
+ # AdFederationService or AadSyncService or AdDomainService.
3027
+ # @param skip_count [Integer] The skip count, which specifies the number of
3028
+ # elements that can be bypassed from a sequence and then return the remaining
3029
+ # elements.
3030
+ # @param take_count [Integer] The take count , which specifies the number of
3031
+ # elements that can be returned from a sequence.
3032
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3033
+ # will be added to the HTTP request.
3034
+ #
3035
+ # @return [Services] which provide lazy access to pages of the response.
3036
+ #
3037
+ def list_premium_as_lazy(filter:nil, service_type:nil, skip_count:nil, take_count:nil, custom_headers:nil)
3038
+ response = list_premium_async(filter:filter, service_type:service_type, skip_count:skip_count, take_count:take_count, custom_headers:custom_headers).value!
3039
+ unless response.nil?
3040
+ page = response.body
3041
+ page.next_method = Proc.new do |next_page_link|
3042
+ list_premium_next_async(next_page_link, custom_headers:custom_headers)
3043
+ end
3044
+ page
3045
+ end
3046
+ end
3047
+
3048
+ #
3049
+ # Gets the alerts for a given service.
3050
+ #
3051
+ # @param service_name [String] The name of the service.
3052
+ # @param filter [String] The alert property filter to apply.
3053
+ # @param state [String] The alert state to query for.
3054
+ # @param from [DateTime] The start date to query for.
3055
+ # @param to [DateTime] The end date till when to query for.
3056
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3057
+ # will be added to the HTTP request.
3058
+ #
3059
+ # @return [Alerts] which provide lazy access to pages of the response.
3060
+ #
3061
+ def list_alerts_as_lazy(service_name, filter:nil, state:nil, from:nil, to:nil, custom_headers:nil)
3062
+ response = list_alerts_async(service_name, filter:filter, state:state, from:from, to:to, custom_headers:custom_headers).value!
3063
+ unless response.nil?
3064
+ page = response.body
3065
+ page.next_method = Proc.new do |next_page_link|
3066
+ list_alerts_next_async(next_page_link, custom_headers:custom_headers)
3067
+ end
3068
+ page
3069
+ end
3070
+ end
3071
+
3072
+ #
3073
+ # Gets the export status.
3074
+ #
3075
+ # @param service_name [String] The name of the service.
3076
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3077
+ # will be added to the HTTP request.
3078
+ #
3079
+ # @return [ExportStatuses] which provide lazy access to pages of the response.
3080
+ #
3081
+ def list_export_status_as_lazy(service_name, custom_headers:nil)
3082
+ response = list_export_status_async(service_name, custom_headers:custom_headers).value!
3083
+ unless response.nil?
3084
+ page = response.body
3085
+ page.next_method = Proc.new do |next_page_link|
3086
+ list_export_status_next_async(next_page_link, custom_headers:custom_headers)
3087
+ end
3088
+ page
3089
+ end
3090
+ end
3091
+
3092
+ #
3093
+ # Gets the average of the metric values for a given metric and group
3094
+ # combination.
3095
+ #
3096
+ # @param service_name [String] The name of the service.
3097
+ # @param metric_name [String] The metric name
3098
+ # @param group_name [String] The group name
3099
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3100
+ # will be added to the HTTP request.
3101
+ #
3102
+ # @return [Metrics] which provide lazy access to pages of the response.
3103
+ #
3104
+ def list_metrics_average_as_lazy(service_name, metric_name, group_name, custom_headers:nil)
3105
+ response = list_metrics_average_async(service_name, metric_name, group_name, custom_headers:custom_headers).value!
3106
+ unless response.nil?
3107
+ page = response.body
3108
+ page.next_method = Proc.new do |next_page_link|
3109
+ list_metrics_average_next_async(next_page_link, custom_headers:custom_headers)
3110
+ end
3111
+ page
3112
+ end
3113
+ end
3114
+
3115
+ #
3116
+ # Gets the sum of the metric values for a given metric and group combination.
3117
+ #
3118
+ # @param service_name [String] The name of the service.
3119
+ # @param metric_name [String] The metric name
3120
+ # @param group_name [String] The group name
3121
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3122
+ # will be added to the HTTP request.
3123
+ #
3124
+ # @return [Metrics] which provide lazy access to pages of the response.
3125
+ #
3126
+ def list_metrics_sum_as_lazy(service_name, metric_name, group_name, custom_headers:nil)
3127
+ response = list_metrics_sum_async(service_name, metric_name, group_name, custom_headers:custom_headers).value!
3128
+ unless response.nil?
3129
+ page = response.body
3130
+ page.next_method = Proc.new do |next_page_link|
3131
+ list_metrics_sum_next_async(next_page_link, custom_headers:custom_headers)
3132
+ end
3133
+ page
3134
+ end
3135
+ end
3136
+
3137
+ #
3138
+ # Gets the service related metrics information.
3139
+ #
3140
+ # @param service_name [String] The name of the service.
3141
+ # @param filter [String] The metric metadata property filter to apply.
3142
+ # @param perf_counter [Boolean] Indicates if only performance counter metrics
3143
+ # are requested.
3144
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3145
+ # will be added to the HTTP request.
3146
+ #
3147
+ # @return [MetricMetadataList] which provide lazy access to pages of the
3148
+ # response.
3149
+ #
3150
+ def list_metric_metadata_as_lazy(service_name, filter:nil, perf_counter:nil, custom_headers:nil)
3151
+ response = list_metric_metadata_async(service_name, filter:filter, perf_counter:perf_counter, custom_headers:custom_headers).value!
3152
+ unless response.nil?
3153
+ page = response.body
3154
+ page.next_method = Proc.new do |next_page_link|
3155
+ list_metric_metadata_next_async(next_page_link, custom_headers:custom_headers)
3156
+ end
3157
+ page
3158
+ end
3159
+ end
3160
+
3161
+ end
3162
+ end