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,2287 @@
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 AddsServices
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the AddsServices 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 Active Directory Domain Service, for a tenant, that are
26
+ # onboarded to Azure 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 Active Directory Domain Service, for a tenant, that are
50
+ # onboarded to Azure 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 Active Directory Domain Service, for a tenant, that are
73
+ # onboarded to Azure 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/addsservices'
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/addsservices'
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 an Active Directory Domain Service for a tenant having
241
+ # Azure AD Premium license and is onboarded to Azure Active Directory Connect
242
+ # Health.
243
+ #
244
+ # @param service_name [String] The name of the service.
245
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
246
+ # will be added to the HTTP request.
247
+ #
248
+ # @return [ServiceProperties] operation results.
249
+ #
250
+ def get(service_name, custom_headers:nil)
251
+ response = get_async(service_name, custom_headers:custom_headers).value!
252
+ response.body unless response.nil?
253
+ end
254
+
255
+ #
256
+ # Gets the details of an Active Directory Domain Service for a tenant having
257
+ # Azure AD Premium license and is onboarded to Azure Active Directory Connect
258
+ # Health.
259
+ #
260
+ # @param service_name [String] The name of the service.
261
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
262
+ # will be added to the HTTP request.
263
+ #
264
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
265
+ #
266
+ def get_with_http_info(service_name, custom_headers:nil)
267
+ get_async(service_name, custom_headers:custom_headers).value!
268
+ end
269
+
270
+ #
271
+ # Gets the details of an Active Directory Domain Service for a tenant having
272
+ # Azure AD Premium license and is onboarded to Azure Active Directory Connect
273
+ # Health.
274
+ #
275
+ # @param service_name [String] The name of the service.
276
+ # @param [Hash{String => String}] A hash of custom headers that will be added
277
+ # to the HTTP request.
278
+ #
279
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
280
+ #
281
+ def get_async(service_name, custom_headers:nil)
282
+ fail ArgumentError, 'service_name is nil' if service_name.nil?
283
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
284
+
285
+
286
+ request_headers = {}
287
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
288
+
289
+ # Set Headers
290
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
291
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
292
+ path_template = 'providers/Microsoft.ADHybridHealthService/addsservices/{serviceName}'
293
+
294
+ request_url = @base_url || @client.base_url
295
+
296
+ options = {
297
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
298
+ path_params: {'serviceName' => service_name},
299
+ query_params: {'api-version' => @client.api_version},
300
+ headers: request_headers.merge(custom_headers || {}),
301
+ base_url: request_url
302
+ }
303
+ promise = @client.make_request_async(:get, path_template, options)
304
+
305
+ promise = promise.then do |result|
306
+ http_response = result.response
307
+ status_code = http_response.status
308
+ response_content = http_response.body
309
+ unless status_code == 200
310
+ error_model = JSON.load(response_content)
311
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
312
+ end
313
+
314
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
315
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
316
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
317
+ # Deserialize Response
318
+ if status_code == 200
319
+ begin
320
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
321
+ result_mapper = Azure::ADHybridHealthService::Mgmt::V2014_01_01::Models::ServiceProperties.mapper()
322
+ result.body = @client.deserialize(result_mapper, parsed_response)
323
+ rescue Exception => e
324
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
325
+ end
326
+ end
327
+
328
+ result
329
+ end
330
+
331
+ promise.execute
332
+ end
333
+
334
+ #
335
+ # Deletes an Active Directory Domain Service which is onboarded to Azure Active
336
+ # Directory Connect Health.
337
+ #
338
+ # @param service_name [String] The name of the service which needs to be
339
+ # deleted.
340
+ # @param confirm [Boolean] Indicates if the service will be permanently deleted
341
+ # or disabled. True indicates that the service will be permanently deleted and
342
+ # False indicates that the service will be marked disabled and then deleted
343
+ # after 30 days, if it is not re-registered.
344
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
345
+ # will be added to the HTTP request.
346
+ #
347
+ #
348
+ def delete(service_name, confirm:nil, custom_headers:nil)
349
+ response = delete_async(service_name, confirm:confirm, custom_headers:custom_headers).value!
350
+ nil
351
+ end
352
+
353
+ #
354
+ # Deletes an Active Directory Domain Service which is onboarded to Azure Active
355
+ # Directory Connect Health.
356
+ #
357
+ # @param service_name [String] The name of the service which needs to be
358
+ # deleted.
359
+ # @param confirm [Boolean] Indicates if the service will be permanently deleted
360
+ # or disabled. True indicates that the service will be permanently deleted and
361
+ # False indicates that the service will be marked disabled and then deleted
362
+ # after 30 days, if it is not re-registered.
363
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
364
+ # will be added to the HTTP request.
365
+ #
366
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
367
+ #
368
+ def delete_with_http_info(service_name, confirm:nil, custom_headers:nil)
369
+ delete_async(service_name, confirm:confirm, custom_headers:custom_headers).value!
370
+ end
371
+
372
+ #
373
+ # Deletes an Active Directory Domain Service which is onboarded to Azure Active
374
+ # Directory Connect Health.
375
+ #
376
+ # @param service_name [String] The name of the service which needs to be
377
+ # deleted.
378
+ # @param confirm [Boolean] Indicates if the service will be permanently deleted
379
+ # or disabled. True indicates that the service will be permanently deleted and
380
+ # False indicates that the service will be marked disabled and then deleted
381
+ # after 30 days, if it is not re-registered.
382
+ # @param [Hash{String => String}] A hash of custom headers that will be added
383
+ # to the HTTP request.
384
+ #
385
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
386
+ #
387
+ def delete_async(service_name, confirm:nil, custom_headers:nil)
388
+ fail ArgumentError, 'service_name is nil' if service_name.nil?
389
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
390
+
391
+
392
+ request_headers = {}
393
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
394
+
395
+ # Set Headers
396
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
397
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
398
+ path_template = 'providers/Microsoft.ADHybridHealthService/addsservices/{serviceName}'
399
+
400
+ request_url = @base_url || @client.base_url
401
+
402
+ options = {
403
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
404
+ path_params: {'serviceName' => service_name},
405
+ query_params: {'confirm' => confirm,'api-version' => @client.api_version},
406
+ headers: request_headers.merge(custom_headers || {}),
407
+ base_url: request_url
408
+ }
409
+ promise = @client.make_request_async(:delete, path_template, options)
410
+
411
+ promise = promise.then do |result|
412
+ http_response = result.response
413
+ status_code = http_response.status
414
+ response_content = http_response.body
415
+ unless status_code == 204
416
+ error_model = JSON.load(response_content)
417
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
418
+ end
419
+
420
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
421
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
422
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
423
+
424
+ result
425
+ end
426
+
427
+ promise.execute
428
+ end
429
+
430
+ #
431
+ # Updates an Active Directory Domain Service properties of an onboarded
432
+ # service.
433
+ #
434
+ # @param service_name [String] The name of the service which needs to be
435
+ # deleted.
436
+ # @param service [ServiceProperties] The service object.
437
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
438
+ # will be added to the HTTP request.
439
+ #
440
+ # @return [ServiceProperties] operation results.
441
+ #
442
+ def update(service_name, service, custom_headers:nil)
443
+ response = update_async(service_name, service, custom_headers:custom_headers).value!
444
+ response.body unless response.nil?
445
+ end
446
+
447
+ #
448
+ # Updates an Active Directory Domain Service properties of an onboarded
449
+ # service.
450
+ #
451
+ # @param service_name [String] The name of the service which needs to be
452
+ # deleted.
453
+ # @param service [ServiceProperties] The service object.
454
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
455
+ # will be added to the HTTP request.
456
+ #
457
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
458
+ #
459
+ def update_with_http_info(service_name, service, custom_headers:nil)
460
+ update_async(service_name, service, custom_headers:custom_headers).value!
461
+ end
462
+
463
+ #
464
+ # Updates an Active Directory Domain Service properties of an onboarded
465
+ # service.
466
+ #
467
+ # @param service_name [String] The name of the service which needs to be
468
+ # deleted.
469
+ # @param service [ServiceProperties] The service object.
470
+ # @param [Hash{String => String}] A hash of custom headers that will be added
471
+ # to the HTTP request.
472
+ #
473
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
474
+ #
475
+ def update_async(service_name, service, custom_headers:nil)
476
+ fail ArgumentError, 'service_name is nil' if service_name.nil?
477
+ fail ArgumentError, 'service is nil' if service.nil?
478
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
479
+
480
+
481
+ request_headers = {}
482
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
483
+
484
+ # Set Headers
485
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
486
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
487
+
488
+ # Serialize Request
489
+ request_mapper = Azure::ADHybridHealthService::Mgmt::V2014_01_01::Models::ServiceProperties.mapper()
490
+ request_content = @client.serialize(request_mapper, service)
491
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
492
+
493
+ path_template = 'providers/Microsoft.ADHybridHealthService/addsservices/{serviceName}'
494
+
495
+ request_url = @base_url || @client.base_url
496
+
497
+ options = {
498
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
499
+ path_params: {'serviceName' => service_name},
500
+ query_params: {'api-version' => @client.api_version},
501
+ body: request_content,
502
+ headers: request_headers.merge(custom_headers || {}),
503
+ base_url: request_url
504
+ }
505
+ promise = @client.make_request_async(:patch, path_template, options)
506
+
507
+ promise = promise.then do |result|
508
+ http_response = result.response
509
+ status_code = http_response.status
510
+ response_content = http_response.body
511
+ unless status_code == 200
512
+ error_model = JSON.load(response_content)
513
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
514
+ end
515
+
516
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
517
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
518
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
519
+ # Deserialize Response
520
+ if status_code == 200
521
+ begin
522
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
523
+ result_mapper = Azure::ADHybridHealthService::Mgmt::V2014_01_01::Models::ServiceProperties.mapper()
524
+ result.body = @client.deserialize(result_mapper, parsed_response)
525
+ rescue Exception => e
526
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
527
+ end
528
+ end
529
+
530
+ result
531
+ end
532
+
533
+ promise.execute
534
+ end
535
+
536
+ #
537
+ # Gets the forest summary for a given Active Directory Domain Service, that is
538
+ # onboarded to Azure Active Directory Connect Health.
539
+ #
540
+ # @param service_name [String] The name of the service.
541
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
542
+ # will be added to the HTTP request.
543
+ #
544
+ # @return [ForestSummary] operation results.
545
+ #
546
+ def get_forest_summary(service_name, custom_headers:nil)
547
+ response = get_forest_summary_async(service_name, custom_headers:custom_headers).value!
548
+ response.body unless response.nil?
549
+ end
550
+
551
+ #
552
+ # Gets the forest summary for a given Active Directory Domain Service, that is
553
+ # onboarded to Azure Active Directory Connect Health.
554
+ #
555
+ # @param service_name [String] The name of the service.
556
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
557
+ # will be added to the HTTP request.
558
+ #
559
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
560
+ #
561
+ def get_forest_summary_with_http_info(service_name, custom_headers:nil)
562
+ get_forest_summary_async(service_name, custom_headers:custom_headers).value!
563
+ end
564
+
565
+ #
566
+ # Gets the forest summary for a given Active Directory Domain Service, that is
567
+ # onboarded to Azure Active Directory Connect Health.
568
+ #
569
+ # @param service_name [String] The name of the service.
570
+ # @param [Hash{String => String}] A hash of custom headers that will be added
571
+ # to the HTTP request.
572
+ #
573
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
574
+ #
575
+ def get_forest_summary_async(service_name, custom_headers:nil)
576
+ fail ArgumentError, 'service_name is nil' if service_name.nil?
577
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
578
+
579
+
580
+ request_headers = {}
581
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
582
+
583
+ # Set Headers
584
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
585
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
586
+ path_template = 'providers/Microsoft.ADHybridHealthService/addsservices/{serviceName}/forestsummary'
587
+
588
+ request_url = @base_url || @client.base_url
589
+
590
+ options = {
591
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
592
+ path_params: {'serviceName' => service_name},
593
+ query_params: {'api-version' => @client.api_version},
594
+ headers: request_headers.merge(custom_headers || {}),
595
+ base_url: request_url
596
+ }
597
+ promise = @client.make_request_async(:get, path_template, options)
598
+
599
+ promise = promise.then do |result|
600
+ http_response = result.response
601
+ status_code = http_response.status
602
+ response_content = http_response.body
603
+ unless status_code == 200
604
+ error_model = JSON.load(response_content)
605
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
606
+ end
607
+
608
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
609
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
610
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
611
+ # Deserialize Response
612
+ if status_code == 200
613
+ begin
614
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
615
+ result_mapper = Azure::ADHybridHealthService::Mgmt::V2014_01_01::Models::ForestSummary.mapper()
616
+ result.body = @client.deserialize(result_mapper, parsed_response)
617
+ rescue Exception => e
618
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
619
+ end
620
+ end
621
+
622
+ result
623
+ end
624
+
625
+ promise.execute
626
+ end
627
+
628
+ #
629
+ # Gets the average of the metric values for a given metric and group
630
+ # combination.
631
+ #
632
+ # @param service_name [String] The name of the service.
633
+ # @param metric_name [String] The metric name
634
+ # @param group_name [String] The group name
635
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
636
+ # will be added to the HTTP request.
637
+ #
638
+ # @return [Array<Item>] operation results.
639
+ #
640
+ def list_metrics_average(service_name, metric_name, group_name, custom_headers:nil)
641
+ first_page = list_metrics_average_as_lazy(service_name, metric_name, group_name, custom_headers:custom_headers)
642
+ first_page.get_all_items
643
+ end
644
+
645
+ #
646
+ # Gets the average of the metric values for a given metric and group
647
+ # combination.
648
+ #
649
+ # @param service_name [String] The name of the service.
650
+ # @param metric_name [String] The metric name
651
+ # @param group_name [String] The group name
652
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
653
+ # will be added to the HTTP request.
654
+ #
655
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
656
+ #
657
+ def list_metrics_average_with_http_info(service_name, metric_name, group_name, custom_headers:nil)
658
+ list_metrics_average_async(service_name, metric_name, group_name, custom_headers:custom_headers).value!
659
+ end
660
+
661
+ #
662
+ # Gets the average of the metric values for a given metric and group
663
+ # combination.
664
+ #
665
+ # @param service_name [String] The name of the service.
666
+ # @param metric_name [String] The metric name
667
+ # @param group_name [String] The group name
668
+ # @param [Hash{String => String}] A hash of custom headers that will be added
669
+ # to the HTTP request.
670
+ #
671
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
672
+ #
673
+ def list_metrics_average_async(service_name, metric_name, group_name, custom_headers:nil)
674
+ fail ArgumentError, 'service_name is nil' if service_name.nil?
675
+ fail ArgumentError, 'metric_name is nil' if metric_name.nil?
676
+ fail ArgumentError, 'group_name is nil' if group_name.nil?
677
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
678
+
679
+
680
+ request_headers = {}
681
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
682
+
683
+ # Set Headers
684
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
685
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
686
+ path_template = 'providers/Microsoft.ADHybridHealthService/addsservices/{serviceName}/metrics/{metricName}/groups/{groupName}/average'
687
+
688
+ request_url = @base_url || @client.base_url
689
+
690
+ options = {
691
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
692
+ path_params: {'serviceName' => service_name,'metricName' => metric_name,'groupName' => group_name},
693
+ query_params: {'api-version' => @client.api_version},
694
+ headers: request_headers.merge(custom_headers || {}),
695
+ base_url: request_url
696
+ }
697
+ promise = @client.make_request_async(:get, path_template, options)
698
+
699
+ promise = promise.then do |result|
700
+ http_response = result.response
701
+ status_code = http_response.status
702
+ response_content = http_response.body
703
+ unless status_code == 200
704
+ error_model = JSON.load(response_content)
705
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
706
+ end
707
+
708
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
709
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
710
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
711
+ # Deserialize Response
712
+ if status_code == 200
713
+ begin
714
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
715
+ result_mapper = Azure::ADHybridHealthService::Mgmt::V2014_01_01::Models::Metrics.mapper()
716
+ result.body = @client.deserialize(result_mapper, parsed_response)
717
+ rescue Exception => e
718
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
719
+ end
720
+ end
721
+
722
+ result
723
+ end
724
+
725
+ promise.execute
726
+ end
727
+
728
+ #
729
+ # Gets the sum of the metric values for a given metric and group combination.
730
+ #
731
+ # @param service_name [String] The name of the service.
732
+ # @param metric_name [String] The metric name
733
+ # @param group_name [String] The group name
734
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
735
+ # will be added to the HTTP request.
736
+ #
737
+ # @return [Array<Item>] operation results.
738
+ #
739
+ def list_metrics_sum(service_name, metric_name, group_name, custom_headers:nil)
740
+ first_page = list_metrics_sum_as_lazy(service_name, metric_name, group_name, custom_headers:custom_headers)
741
+ first_page.get_all_items
742
+ end
743
+
744
+ #
745
+ # Gets the sum of the metric values for a given metric and group combination.
746
+ #
747
+ # @param service_name [String] The name of the service.
748
+ # @param metric_name [String] The metric name
749
+ # @param group_name [String] The group name
750
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
751
+ # will be added to the HTTP request.
752
+ #
753
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
754
+ #
755
+ def list_metrics_sum_with_http_info(service_name, metric_name, group_name, custom_headers:nil)
756
+ list_metrics_sum_async(service_name, metric_name, group_name, custom_headers:custom_headers).value!
757
+ end
758
+
759
+ #
760
+ # Gets the sum of the metric values for a given metric and group combination.
761
+ #
762
+ # @param service_name [String] The name of the service.
763
+ # @param metric_name [String] The metric name
764
+ # @param group_name [String] The group name
765
+ # @param [Hash{String => String}] A hash of custom headers that will be added
766
+ # to the HTTP request.
767
+ #
768
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
769
+ #
770
+ def list_metrics_sum_async(service_name, metric_name, group_name, custom_headers:nil)
771
+ fail ArgumentError, 'service_name is nil' if service_name.nil?
772
+ fail ArgumentError, 'metric_name is nil' if metric_name.nil?
773
+ fail ArgumentError, 'group_name is nil' if group_name.nil?
774
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
775
+
776
+
777
+ request_headers = {}
778
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
779
+
780
+ # Set Headers
781
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
782
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
783
+ path_template = 'providers/Microsoft.ADHybridHealthService/addsservices/{serviceName}/metrics/{metricName}/groups/{groupName}/sum'
784
+
785
+ request_url = @base_url || @client.base_url
786
+
787
+ options = {
788
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
789
+ path_params: {'serviceName' => service_name,'metricName' => metric_name,'groupName' => group_name},
790
+ query_params: {'api-version' => @client.api_version},
791
+ headers: request_headers.merge(custom_headers || {}),
792
+ base_url: request_url
793
+ }
794
+ promise = @client.make_request_async(:get, path_template, options)
795
+
796
+ promise = promise.then do |result|
797
+ http_response = result.response
798
+ status_code = http_response.status
799
+ response_content = http_response.body
800
+ unless status_code == 200
801
+ error_model = JSON.load(response_content)
802
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
803
+ end
804
+
805
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
806
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
807
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
808
+ # Deserialize Response
809
+ if status_code == 200
810
+ begin
811
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
812
+ result_mapper = Azure::ADHybridHealthService::Mgmt::V2014_01_01::Models::Metrics.mapper()
813
+ result.body = @client.deserialize(result_mapper, parsed_response)
814
+ rescue Exception => e
815
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
816
+ end
817
+ end
818
+
819
+ result
820
+ end
821
+
822
+ promise.execute
823
+ end
824
+
825
+ #
826
+ # Gets the service related metrics information.
827
+ #
828
+ # @param service_name [String] The name of the service.
829
+ # @param filter [String] The metric metadata property filter to apply.
830
+ # @param perf_counter [Boolean] Indicates if only performance counter metrics
831
+ # are requested.
832
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
833
+ # will be added to the HTTP request.
834
+ #
835
+ # @return [Array<MetricMetadata>] operation results.
836
+ #
837
+ def list_metric_metadata(service_name, filter:nil, perf_counter:nil, custom_headers:nil)
838
+ first_page = list_metric_metadata_as_lazy(service_name, filter:filter, perf_counter:perf_counter, custom_headers:custom_headers)
839
+ first_page.get_all_items
840
+ end
841
+
842
+ #
843
+ # Gets the service related metrics information.
844
+ #
845
+ # @param service_name [String] The name of the service.
846
+ # @param filter [String] The metric metadata property filter to apply.
847
+ # @param perf_counter [Boolean] Indicates if only performance counter metrics
848
+ # are requested.
849
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
850
+ # will be added to the HTTP request.
851
+ #
852
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
853
+ #
854
+ def list_metric_metadata_with_http_info(service_name, filter:nil, perf_counter:nil, custom_headers:nil)
855
+ list_metric_metadata_async(service_name, filter:filter, perf_counter:perf_counter, custom_headers:custom_headers).value!
856
+ end
857
+
858
+ #
859
+ # Gets the service related metrics information.
860
+ #
861
+ # @param service_name [String] The name of the service.
862
+ # @param filter [String] The metric metadata property filter to apply.
863
+ # @param perf_counter [Boolean] Indicates if only performance counter metrics
864
+ # are requested.
865
+ # @param [Hash{String => String}] A hash of custom headers that will be added
866
+ # to the HTTP request.
867
+ #
868
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
869
+ #
870
+ def list_metric_metadata_async(service_name, filter:nil, perf_counter:nil, custom_headers:nil)
871
+ fail ArgumentError, 'service_name is nil' if service_name.nil?
872
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
873
+
874
+
875
+ request_headers = {}
876
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
877
+
878
+ # Set Headers
879
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
880
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
881
+ path_template = 'providers/Microsoft.ADHybridHealthService/addsservices/{serviceName}/metricmetadata'
882
+
883
+ request_url = @base_url || @client.base_url
884
+
885
+ options = {
886
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
887
+ path_params: {'serviceName' => service_name},
888
+ query_params: {'$filter' => filter,'perfCounter' => perf_counter,'api-version' => @client.api_version},
889
+ headers: request_headers.merge(custom_headers || {}),
890
+ base_url: request_url
891
+ }
892
+ promise = @client.make_request_async(:get, path_template, options)
893
+
894
+ promise = promise.then do |result|
895
+ http_response = result.response
896
+ status_code = http_response.status
897
+ response_content = http_response.body
898
+ unless status_code == 200
899
+ error_model = JSON.load(response_content)
900
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
901
+ end
902
+
903
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
904
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
905
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
906
+ # Deserialize Response
907
+ if status_code == 200
908
+ begin
909
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
910
+ result_mapper = Azure::ADHybridHealthService::Mgmt::V2014_01_01::Models::MetricMetadataList.mapper()
911
+ result.body = @client.deserialize(result_mapper, parsed_response)
912
+ rescue Exception => e
913
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
914
+ end
915
+ end
916
+
917
+ result
918
+ end
919
+
920
+ promise.execute
921
+ end
922
+
923
+ #
924
+ # Gets the service related metric information.
925
+ #
926
+ # @param service_name [String] The name of the service.
927
+ # @param metric_name [String] The metric name
928
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
929
+ # will be added to the HTTP request.
930
+ #
931
+ # @return [MetricMetadata] operation results.
932
+ #
933
+ def get_metric_metadata(service_name, metric_name, custom_headers:nil)
934
+ response = get_metric_metadata_async(service_name, metric_name, custom_headers:custom_headers).value!
935
+ response.body unless response.nil?
936
+ end
937
+
938
+ #
939
+ # Gets the service related metric information.
940
+ #
941
+ # @param service_name [String] The name of the service.
942
+ # @param metric_name [String] The metric name
943
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
944
+ # will be added to the HTTP request.
945
+ #
946
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
947
+ #
948
+ def get_metric_metadata_with_http_info(service_name, metric_name, custom_headers:nil)
949
+ get_metric_metadata_async(service_name, metric_name, custom_headers:custom_headers).value!
950
+ end
951
+
952
+ #
953
+ # Gets the service related metric information.
954
+ #
955
+ # @param service_name [String] The name of the service.
956
+ # @param metric_name [String] The metric name
957
+ # @param [Hash{String => String}] A hash of custom headers that will be added
958
+ # to the HTTP request.
959
+ #
960
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
961
+ #
962
+ def get_metric_metadata_async(service_name, metric_name, custom_headers:nil)
963
+ fail ArgumentError, 'service_name is nil' if service_name.nil?
964
+ fail ArgumentError, 'metric_name is nil' if metric_name.nil?
965
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
966
+
967
+
968
+ request_headers = {}
969
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
970
+
971
+ # Set Headers
972
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
973
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
974
+ path_template = 'providers/Microsoft.ADHybridHealthService/addsservices/{serviceName}/metricmetadata/{metricName}'
975
+
976
+ request_url = @base_url || @client.base_url
977
+
978
+ options = {
979
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
980
+ path_params: {'serviceName' => service_name,'metricName' => metric_name},
981
+ query_params: {'api-version' => @client.api_version},
982
+ headers: request_headers.merge(custom_headers || {}),
983
+ base_url: request_url
984
+ }
985
+ promise = @client.make_request_async(:get, path_template, options)
986
+
987
+ promise = promise.then do |result|
988
+ http_response = result.response
989
+ status_code = http_response.status
990
+ response_content = http_response.body
991
+ unless status_code == 200
992
+ error_model = JSON.load(response_content)
993
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
994
+ end
995
+
996
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
997
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
998
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
999
+ # Deserialize Response
1000
+ if status_code == 200
1001
+ begin
1002
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1003
+ result_mapper = Azure::ADHybridHealthService::Mgmt::V2014_01_01::Models::MetricMetadata.mapper()
1004
+ result.body = @client.deserialize(result_mapper, parsed_response)
1005
+ rescue Exception => e
1006
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1007
+ end
1008
+ end
1009
+
1010
+ result
1011
+ end
1012
+
1013
+ promise.execute
1014
+ end
1015
+
1016
+ #
1017
+ # Gets the service related metrics for a given metric and group combination.
1018
+ #
1019
+ # @param service_name [String] The name of the service.
1020
+ # @param metric_name [String] The metric name
1021
+ # @param group_name [String] The group name
1022
+ # @param group_key [String] The group key
1023
+ # @param from_date [DateTime] The start date.
1024
+ # @param to_date [DateTime] The end date.
1025
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1026
+ # will be added to the HTTP request.
1027
+ #
1028
+ # @return [MetricSets] operation results.
1029
+ #
1030
+ def get_metric_metadata_for_group(service_name, metric_name, group_name, group_key:nil, from_date:nil, to_date:nil, custom_headers:nil)
1031
+ 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!
1032
+ response.body unless response.nil?
1033
+ end
1034
+
1035
+ #
1036
+ # Gets the service related metrics for a given metric and group combination.
1037
+ #
1038
+ # @param service_name [String] The name of the service.
1039
+ # @param metric_name [String] The metric name
1040
+ # @param group_name [String] The group name
1041
+ # @param group_key [String] The group key
1042
+ # @param from_date [DateTime] The start date.
1043
+ # @param to_date [DateTime] The end date.
1044
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1045
+ # will be added to the HTTP request.
1046
+ #
1047
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1048
+ #
1049
+ 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)
1050
+ 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!
1051
+ end
1052
+
1053
+ #
1054
+ # Gets the service related metrics for a given metric and group combination.
1055
+ #
1056
+ # @param service_name [String] The name of the service.
1057
+ # @param metric_name [String] The metric name
1058
+ # @param group_name [String] The group name
1059
+ # @param group_key [String] The group key
1060
+ # @param from_date [DateTime] The start date.
1061
+ # @param to_date [DateTime] The end date.
1062
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1063
+ # to the HTTP request.
1064
+ #
1065
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1066
+ #
1067
+ 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)
1068
+ fail ArgumentError, 'service_name is nil' if service_name.nil?
1069
+ fail ArgumentError, 'metric_name is nil' if metric_name.nil?
1070
+ fail ArgumentError, 'group_name is nil' if group_name.nil?
1071
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1072
+
1073
+
1074
+ request_headers = {}
1075
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1076
+
1077
+ # Set Headers
1078
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1079
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1080
+ path_template = 'providers/Microsoft.ADHybridHealthService/addsservices/{serviceName}/metricmetadata/{metricName}/groups/{groupName}'
1081
+
1082
+ request_url = @base_url || @client.base_url
1083
+
1084
+ options = {
1085
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1086
+ path_params: {'serviceName' => service_name,'metricName' => metric_name,'groupName' => group_name},
1087
+ query_params: {'groupKey' => group_key,'fromDate' => from_date,'toDate' => to_date,'api-version' => @client.api_version},
1088
+ headers: request_headers.merge(custom_headers || {}),
1089
+ base_url: request_url
1090
+ }
1091
+ promise = @client.make_request_async(:get, path_template, options)
1092
+
1093
+ promise = promise.then do |result|
1094
+ http_response = result.response
1095
+ status_code = http_response.status
1096
+ response_content = http_response.body
1097
+ unless status_code == 200
1098
+ error_model = JSON.load(response_content)
1099
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1100
+ end
1101
+
1102
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1103
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1104
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1105
+ # Deserialize Response
1106
+ if status_code == 200
1107
+ begin
1108
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1109
+ result_mapper = Azure::ADHybridHealthService::Mgmt::V2014_01_01::Models::MetricSets.mapper()
1110
+ result.body = @client.deserialize(result_mapper, parsed_response)
1111
+ rescue Exception => e
1112
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1113
+ end
1114
+ end
1115
+
1116
+ result
1117
+ end
1118
+
1119
+ promise.execute
1120
+ end
1121
+
1122
+ #
1123
+ # Gets complete domain controller list along with replication details for a
1124
+ # given Active Directory Domain Service, that is onboarded to Azure Active
1125
+ # Directory Connect Health.
1126
+ #
1127
+ # @param service_name [String] The name of the service.
1128
+ # @param filter [String] The server property filter to apply.
1129
+ # @param with_details [Boolean] Indicates if InboundReplicationNeighbor details
1130
+ # are required or not.
1131
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1132
+ # will be added to the HTTP request.
1133
+ #
1134
+ # @return [ReplicationDetailsList] operation results.
1135
+ #
1136
+ def list_replication_details(service_name, filter:nil, with_details:nil, custom_headers:nil)
1137
+ response = list_replication_details_async(service_name, filter:filter, with_details:with_details, custom_headers:custom_headers).value!
1138
+ response.body unless response.nil?
1139
+ end
1140
+
1141
+ #
1142
+ # Gets complete domain controller list along with replication details for a
1143
+ # given Active Directory Domain Service, that is onboarded to Azure Active
1144
+ # Directory Connect Health.
1145
+ #
1146
+ # @param service_name [String] The name of the service.
1147
+ # @param filter [String] The server property filter to apply.
1148
+ # @param with_details [Boolean] Indicates if InboundReplicationNeighbor details
1149
+ # are required or not.
1150
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1151
+ # will be added to the HTTP request.
1152
+ #
1153
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1154
+ #
1155
+ def list_replication_details_with_http_info(service_name, filter:nil, with_details:nil, custom_headers:nil)
1156
+ list_replication_details_async(service_name, filter:filter, with_details:with_details, custom_headers:custom_headers).value!
1157
+ end
1158
+
1159
+ #
1160
+ # Gets complete domain controller list along with replication details for a
1161
+ # given Active Directory Domain Service, that is onboarded to Azure Active
1162
+ # Directory Connect Health.
1163
+ #
1164
+ # @param service_name [String] The name of the service.
1165
+ # @param filter [String] The server property filter to apply.
1166
+ # @param with_details [Boolean] Indicates if InboundReplicationNeighbor details
1167
+ # are required or not.
1168
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1169
+ # to the HTTP request.
1170
+ #
1171
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1172
+ #
1173
+ def list_replication_details_async(service_name, filter:nil, with_details:nil, custom_headers:nil)
1174
+ fail ArgumentError, 'service_name is nil' if service_name.nil?
1175
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1176
+
1177
+
1178
+ request_headers = {}
1179
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1180
+
1181
+ # Set Headers
1182
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1183
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1184
+ path_template = 'providers/Microsoft.ADHybridHealthService/addsservices/{serviceName}/replicationdetails'
1185
+
1186
+ request_url = @base_url || @client.base_url
1187
+
1188
+ options = {
1189
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1190
+ path_params: {'serviceName' => service_name},
1191
+ query_params: {'$filter' => filter,'withDetails' => with_details,'api-version' => @client.api_version},
1192
+ headers: request_headers.merge(custom_headers || {}),
1193
+ base_url: request_url
1194
+ }
1195
+ promise = @client.make_request_async(:get, path_template, options)
1196
+
1197
+ promise = promise.then do |result|
1198
+ http_response = result.response
1199
+ status_code = http_response.status
1200
+ response_content = http_response.body
1201
+ unless status_code == 200
1202
+ error_model = JSON.load(response_content)
1203
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1204
+ end
1205
+
1206
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1207
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1208
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1209
+ # Deserialize Response
1210
+ if status_code == 200
1211
+ begin
1212
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1213
+ result_mapper = Azure::ADHybridHealthService::Mgmt::V2014_01_01::Models::ReplicationDetailsList.mapper()
1214
+ result.body = @client.deserialize(result_mapper, parsed_response)
1215
+ rescue Exception => e
1216
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1217
+ end
1218
+ end
1219
+
1220
+ result
1221
+ end
1222
+
1223
+ promise.execute
1224
+ end
1225
+
1226
+ #
1227
+ # Gets complete domain controller list along with replication details for a
1228
+ # given Active Directory Domain Service, that is onboarded to Azure Active
1229
+ # Directory Connect Health.
1230
+ #
1231
+ # @param service_name [String] The name of the service.
1232
+ # @param is_groupby_site [Boolean] Indicates if the result should be grouped by
1233
+ # site or not.
1234
+ # @param query [String] The custom query.
1235
+ # @param filter [String] The server property filter to apply.
1236
+ # @param take_count [Integer] The take count , which specifies the number of
1237
+ # elements that can be returned from a sequence.
1238
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1239
+ # will be added to the HTTP request.
1240
+ #
1241
+ # @return [ReplicationSummaryList] operation results.
1242
+ #
1243
+ def list_replication_summary(service_name, is_groupby_site, query, filter:nil, take_count:nil, custom_headers:nil)
1244
+ response = list_replication_summary_async(service_name, is_groupby_site, query, filter:filter, take_count:take_count, custom_headers:custom_headers).value!
1245
+ response.body unless response.nil?
1246
+ end
1247
+
1248
+ #
1249
+ # Gets complete domain controller list along with replication details for a
1250
+ # given Active Directory Domain Service, that is onboarded to Azure Active
1251
+ # Directory Connect Health.
1252
+ #
1253
+ # @param service_name [String] The name of the service.
1254
+ # @param is_groupby_site [Boolean] Indicates if the result should be grouped by
1255
+ # site or not.
1256
+ # @param query [String] The custom query.
1257
+ # @param filter [String] The server property filter to apply.
1258
+ # @param take_count [Integer] The take count , which specifies the number of
1259
+ # elements that can be returned from a sequence.
1260
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1261
+ # will be added to the HTTP request.
1262
+ #
1263
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1264
+ #
1265
+ def list_replication_summary_with_http_info(service_name, is_groupby_site, query, filter:nil, take_count:nil, custom_headers:nil)
1266
+ list_replication_summary_async(service_name, is_groupby_site, query, filter:filter, take_count:take_count, custom_headers:custom_headers).value!
1267
+ end
1268
+
1269
+ #
1270
+ # Gets complete domain controller list along with replication details for a
1271
+ # given Active Directory Domain Service, that is onboarded to Azure Active
1272
+ # Directory Connect Health.
1273
+ #
1274
+ # @param service_name [String] The name of the service.
1275
+ # @param is_groupby_site [Boolean] Indicates if the result should be grouped by
1276
+ # site or not.
1277
+ # @param query [String] The custom query.
1278
+ # @param filter [String] The server property filter to apply.
1279
+ # @param take_count [Integer] The take count , which specifies the number of
1280
+ # elements that can be returned from a sequence.
1281
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1282
+ # to the HTTP request.
1283
+ #
1284
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1285
+ #
1286
+ def list_replication_summary_async(service_name, is_groupby_site, query, filter:nil, take_count:nil, custom_headers:nil)
1287
+ fail ArgumentError, 'service_name is nil' if service_name.nil?
1288
+ fail ArgumentError, 'is_groupby_site is nil' if is_groupby_site.nil?
1289
+ fail ArgumentError, 'query is nil' if query.nil?
1290
+ next_partition_key = ''
1291
+ next_row_key = ''
1292
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1293
+
1294
+
1295
+ request_headers = {}
1296
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1297
+
1298
+ # Set Headers
1299
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1300
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1301
+ path_template = 'providers/Microsoft.ADHybridHealthService/addsservices/{serviceName}/replicationsummary'
1302
+
1303
+ request_url = @base_url || @client.base_url
1304
+
1305
+ options = {
1306
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1307
+ path_params: {'serviceName' => service_name},
1308
+ query_params: {'$filter' => filter,'isGroupbySite' => is_groupby_site,'query' => query,'nextPartitionKey' => next_partition_key,'nextRowKey' => next_row_key,'takeCount' => take_count,'api-version' => @client.api_version},
1309
+ headers: request_headers.merge(custom_headers || {}),
1310
+ base_url: request_url
1311
+ }
1312
+ promise = @client.make_request_async(:get, path_template, options)
1313
+
1314
+ promise = promise.then do |result|
1315
+ http_response = result.response
1316
+ status_code = http_response.status
1317
+ response_content = http_response.body
1318
+ unless status_code == 200
1319
+ error_model = JSON.load(response_content)
1320
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1321
+ end
1322
+
1323
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1324
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1325
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1326
+ # Deserialize Response
1327
+ if status_code == 200
1328
+ begin
1329
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1330
+ result_mapper = Azure::ADHybridHealthService::Mgmt::V2014_01_01::Models::ReplicationSummaryList.mapper()
1331
+ result.body = @client.deserialize(result_mapper, parsed_response)
1332
+ rescue Exception => e
1333
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1334
+ end
1335
+ end
1336
+
1337
+ result
1338
+ end
1339
+
1340
+ promise.execute
1341
+ end
1342
+
1343
+ #
1344
+ # Gets the details of an alert for a given Active Directory Domain Controller
1345
+ # service and server combination.
1346
+ #
1347
+ # @param service_member_id The server Id for which the alert details needs to
1348
+ # be queried.
1349
+ # @param service_name [String] The name of the service.
1350
+ # @param filter [String] The alert property filter to apply.
1351
+ # @param state [String] The alert state to query for.
1352
+ # @param from [DateTime] The start date to query for.
1353
+ # @param to [DateTime] The end date till when to query for.
1354
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1355
+ # will be added to the HTTP request.
1356
+ #
1357
+ # @return [Array<Alert>] operation results.
1358
+ #
1359
+ def list_server_alerts(service_member_id, service_name, filter:nil, state:nil, from:nil, to:nil, custom_headers:nil)
1360
+ first_page = list_server_alerts_as_lazy(service_member_id, service_name, filter:filter, state:state, from:from, to:to, custom_headers:custom_headers)
1361
+ first_page.get_all_items
1362
+ end
1363
+
1364
+ #
1365
+ # Gets the details of an alert for a given Active Directory Domain Controller
1366
+ # service and server combination.
1367
+ #
1368
+ # @param service_member_id The server Id for which the alert details needs to
1369
+ # be queried.
1370
+ # @param service_name [String] The name of the service.
1371
+ # @param filter [String] The alert property filter to apply.
1372
+ # @param state [String] The alert state to query for.
1373
+ # @param from [DateTime] The start date to query for.
1374
+ # @param to [DateTime] The end date till when to query for.
1375
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1376
+ # will be added to the HTTP request.
1377
+ #
1378
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1379
+ #
1380
+ def list_server_alerts_with_http_info(service_member_id, service_name, filter:nil, state:nil, from:nil, to:nil, custom_headers:nil)
1381
+ list_server_alerts_async(service_member_id, service_name, filter:filter, state:state, from:from, to:to, custom_headers:custom_headers).value!
1382
+ end
1383
+
1384
+ #
1385
+ # Gets the details of an alert for a given Active Directory Domain Controller
1386
+ # service and server combination.
1387
+ #
1388
+ # @param service_member_id The server Id for which the alert details needs to
1389
+ # be queried.
1390
+ # @param service_name [String] The name of the service.
1391
+ # @param filter [String] The alert property filter to apply.
1392
+ # @param state [String] The alert state to query for.
1393
+ # @param from [DateTime] The start date to query for.
1394
+ # @param to [DateTime] The end date till when to query for.
1395
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1396
+ # to the HTTP request.
1397
+ #
1398
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1399
+ #
1400
+ def list_server_alerts_async(service_member_id, service_name, filter:nil, state:nil, from:nil, to:nil, custom_headers:nil)
1401
+ fail ArgumentError, 'service_member_id is nil' if service_member_id.nil?
1402
+ fail ArgumentError, 'service_name is nil' if service_name.nil?
1403
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1404
+
1405
+
1406
+ request_headers = {}
1407
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1408
+
1409
+ # Set Headers
1410
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1411
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1412
+ path_template = 'providers/Microsoft.ADHybridHealthService/addsservices/{serviceName}/servicemembers/{serviceMemberId}/alerts'
1413
+
1414
+ request_url = @base_url || @client.base_url
1415
+
1416
+ options = {
1417
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1418
+ path_params: {'serviceMemberId' => service_member_id,'serviceName' => service_name},
1419
+ query_params: {'$filter' => filter,'state' => state,'from' => from,'to' => to,'api-version' => @client.api_version},
1420
+ headers: request_headers.merge(custom_headers || {}),
1421
+ base_url: request_url
1422
+ }
1423
+ promise = @client.make_request_async(:get, path_template, options)
1424
+
1425
+ promise = promise.then do |result|
1426
+ http_response = result.response
1427
+ status_code = http_response.status
1428
+ response_content = http_response.body
1429
+ unless status_code == 200
1430
+ error_model = JSON.load(response_content)
1431
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1432
+ end
1433
+
1434
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1435
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1436
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1437
+ # Deserialize Response
1438
+ if status_code == 200
1439
+ begin
1440
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1441
+ result_mapper = Azure::ADHybridHealthService::Mgmt::V2014_01_01::Models::Alerts.mapper()
1442
+ result.body = @client.deserialize(result_mapper, parsed_response)
1443
+ rescue Exception => e
1444
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1445
+ end
1446
+ end
1447
+
1448
+ result
1449
+ end
1450
+
1451
+ promise.execute
1452
+ end
1453
+
1454
+ #
1455
+ # Gets the details of Active Directory Domain Services for a tenant having
1456
+ # Azure AD Premium license and is onboarded to Azure Active Directory Connect
1457
+ # Health.
1458
+ #
1459
+ # @param filter [String] The service property filter to apply.
1460
+ # @param service_type [String] The service type for the services onboarded to
1461
+ # Azure Active Directory Connect Health. Depending on whether the service is
1462
+ # monitoring, ADFS, Sync or ADDS roles, the service type can either be
1463
+ # AdFederationService or AadSyncService or AdDomainService.
1464
+ # @param skip_count [Integer] The skip count, which specifies the number of
1465
+ # elements that can be bypassed from a sequence and then return the remaining
1466
+ # elements.
1467
+ # @param take_count [Integer] The take count , which specifies the number of
1468
+ # elements that can be returned from a sequence.
1469
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1470
+ # will be added to the HTTP request.
1471
+ #
1472
+ # @return [Array<ServiceProperties>] operation results.
1473
+ #
1474
+ def list_premium_services(filter:nil, service_type:nil, skip_count:nil, take_count:nil, custom_headers:nil)
1475
+ first_page = list_premium_services_as_lazy(filter:filter, service_type:service_type, skip_count:skip_count, take_count:take_count, custom_headers:custom_headers)
1476
+ first_page.get_all_items
1477
+ end
1478
+
1479
+ #
1480
+ # Gets the details of Active Directory Domain Services for a tenant having
1481
+ # Azure AD Premium license and is onboarded to Azure Active Directory Connect
1482
+ # Health.
1483
+ #
1484
+ # @param filter [String] The service property filter to apply.
1485
+ # @param service_type [String] The service type for the services onboarded to
1486
+ # Azure Active Directory Connect Health. Depending on whether the service is
1487
+ # monitoring, ADFS, Sync or ADDS roles, the service type can either be
1488
+ # AdFederationService or AadSyncService or AdDomainService.
1489
+ # @param skip_count [Integer] The skip count, which specifies the number of
1490
+ # elements that can be bypassed from a sequence and then return the remaining
1491
+ # elements.
1492
+ # @param take_count [Integer] The take count , which specifies the number of
1493
+ # elements that can be returned from a sequence.
1494
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1495
+ # will be added to the HTTP request.
1496
+ #
1497
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1498
+ #
1499
+ def list_premium_services_with_http_info(filter:nil, service_type:nil, skip_count:nil, take_count:nil, custom_headers:nil)
1500
+ list_premium_services_async(filter:filter, service_type:service_type, skip_count:skip_count, take_count:take_count, custom_headers:custom_headers).value!
1501
+ end
1502
+
1503
+ #
1504
+ # Gets the details of Active Directory Domain Services for a tenant having
1505
+ # Azure AD Premium license and is onboarded to Azure Active Directory Connect
1506
+ # Health.
1507
+ #
1508
+ # @param filter [String] The service property filter to apply.
1509
+ # @param service_type [String] The service type for the services onboarded to
1510
+ # Azure Active Directory Connect Health. Depending on whether the service is
1511
+ # monitoring, ADFS, Sync or ADDS roles, the service type can either be
1512
+ # AdFederationService or AadSyncService or AdDomainService.
1513
+ # @param skip_count [Integer] The skip count, which specifies the number of
1514
+ # elements that can be bypassed from a sequence and then return the remaining
1515
+ # elements.
1516
+ # @param take_count [Integer] The take count , which specifies the number of
1517
+ # elements that can be returned from a sequence.
1518
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1519
+ # to the HTTP request.
1520
+ #
1521
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1522
+ #
1523
+ def list_premium_services_async(filter:nil, service_type:nil, skip_count:nil, take_count:nil, custom_headers:nil)
1524
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1525
+
1526
+
1527
+ request_headers = {}
1528
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1529
+
1530
+ # Set Headers
1531
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1532
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1533
+ path_template = 'providers/Microsoft.ADHybridHealthService/addsservices/premiumCheck'
1534
+
1535
+ request_url = @base_url || @client.base_url
1536
+
1537
+ options = {
1538
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1539
+ query_params: {'$filter' => filter,'serviceType' => service_type,'skipCount' => skip_count,'takeCount' => take_count,'api-version' => @client.api_version},
1540
+ headers: request_headers.merge(custom_headers || {}),
1541
+ base_url: request_url
1542
+ }
1543
+ promise = @client.make_request_async(:get, path_template, options)
1544
+
1545
+ promise = promise.then do |result|
1546
+ http_response = result.response
1547
+ status_code = http_response.status
1548
+ response_content = http_response.body
1549
+ unless status_code == 200
1550
+ error_model = JSON.load(response_content)
1551
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1552
+ end
1553
+
1554
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1555
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1556
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1557
+ # Deserialize Response
1558
+ if status_code == 200
1559
+ begin
1560
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1561
+ result_mapper = Azure::ADHybridHealthService::Mgmt::V2014_01_01::Models::Services.mapper()
1562
+ result.body = @client.deserialize(result_mapper, parsed_response)
1563
+ rescue Exception => e
1564
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1565
+ end
1566
+ end
1567
+
1568
+ result
1569
+ end
1570
+
1571
+ promise.execute
1572
+ end
1573
+
1574
+ #
1575
+ # Gets the details of Active Directory Domain Service, for a tenant, that are
1576
+ # onboarded to Azure Active Directory Connect Health.
1577
+ #
1578
+ # @param next_page_link [String] The NextLink from the previous successful call
1579
+ # to List operation.
1580
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1581
+ # will be added to the HTTP request.
1582
+ #
1583
+ # @return [Services] operation results.
1584
+ #
1585
+ def list_next(next_page_link, custom_headers:nil)
1586
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
1587
+ response.body unless response.nil?
1588
+ end
1589
+
1590
+ #
1591
+ # Gets the details of Active Directory Domain Service, for a tenant, that are
1592
+ # onboarded to Azure Active Directory Connect Health.
1593
+ #
1594
+ # @param next_page_link [String] The NextLink from the previous successful call
1595
+ # to List operation.
1596
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1597
+ # will be added to the HTTP request.
1598
+ #
1599
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1600
+ #
1601
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
1602
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
1603
+ end
1604
+
1605
+ #
1606
+ # Gets the details of Active Directory Domain Service, for a tenant, that are
1607
+ # onboarded to Azure Active Directory Connect Health.
1608
+ #
1609
+ # @param next_page_link [String] The NextLink from the previous successful call
1610
+ # to List operation.
1611
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1612
+ # to the HTTP request.
1613
+ #
1614
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1615
+ #
1616
+ def list_next_async(next_page_link, custom_headers:nil)
1617
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1618
+
1619
+
1620
+ request_headers = {}
1621
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1622
+
1623
+ # Set Headers
1624
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1625
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1626
+ path_template = '{nextLink}'
1627
+
1628
+ request_url = @base_url || @client.base_url
1629
+
1630
+ options = {
1631
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1632
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1633
+ headers: request_headers.merge(custom_headers || {}),
1634
+ base_url: request_url
1635
+ }
1636
+ promise = @client.make_request_async(:get, path_template, options)
1637
+
1638
+ promise = promise.then do |result|
1639
+ http_response = result.response
1640
+ status_code = http_response.status
1641
+ response_content = http_response.body
1642
+ unless status_code == 200
1643
+ error_model = JSON.load(response_content)
1644
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1645
+ end
1646
+
1647
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1648
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1649
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1650
+ # Deserialize Response
1651
+ if status_code == 200
1652
+ begin
1653
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1654
+ result_mapper = Azure::ADHybridHealthService::Mgmt::V2014_01_01::Models::Services.mapper()
1655
+ result.body = @client.deserialize(result_mapper, parsed_response)
1656
+ rescue Exception => e
1657
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1658
+ end
1659
+ end
1660
+
1661
+ result
1662
+ end
1663
+
1664
+ promise.execute
1665
+ end
1666
+
1667
+ #
1668
+ # Gets the average of the metric values for a given metric and group
1669
+ # combination.
1670
+ #
1671
+ # @param next_page_link [String] The NextLink from the previous successful call
1672
+ # to List operation.
1673
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1674
+ # will be added to the HTTP request.
1675
+ #
1676
+ # @return [Metrics] operation results.
1677
+ #
1678
+ def list_metrics_average_next(next_page_link, custom_headers:nil)
1679
+ response = list_metrics_average_next_async(next_page_link, custom_headers:custom_headers).value!
1680
+ response.body unless response.nil?
1681
+ end
1682
+
1683
+ #
1684
+ # Gets the average of the metric values for a given metric and group
1685
+ # combination.
1686
+ #
1687
+ # @param next_page_link [String] The NextLink from the previous successful call
1688
+ # to List operation.
1689
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1690
+ # will be added to the HTTP request.
1691
+ #
1692
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1693
+ #
1694
+ def list_metrics_average_next_with_http_info(next_page_link, custom_headers:nil)
1695
+ list_metrics_average_next_async(next_page_link, custom_headers:custom_headers).value!
1696
+ end
1697
+
1698
+ #
1699
+ # Gets the average of the metric values for a given metric and group
1700
+ # combination.
1701
+ #
1702
+ # @param next_page_link [String] The NextLink from the previous successful call
1703
+ # to List operation.
1704
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1705
+ # to the HTTP request.
1706
+ #
1707
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1708
+ #
1709
+ def list_metrics_average_next_async(next_page_link, custom_headers:nil)
1710
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1711
+
1712
+
1713
+ request_headers = {}
1714
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1715
+
1716
+ # Set Headers
1717
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1718
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1719
+ path_template = '{nextLink}'
1720
+
1721
+ request_url = @base_url || @client.base_url
1722
+
1723
+ options = {
1724
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1725
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1726
+ headers: request_headers.merge(custom_headers || {}),
1727
+ base_url: request_url
1728
+ }
1729
+ promise = @client.make_request_async(:get, path_template, options)
1730
+
1731
+ promise = promise.then do |result|
1732
+ http_response = result.response
1733
+ status_code = http_response.status
1734
+ response_content = http_response.body
1735
+ unless status_code == 200
1736
+ error_model = JSON.load(response_content)
1737
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1738
+ end
1739
+
1740
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1741
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1742
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1743
+ # Deserialize Response
1744
+ if status_code == 200
1745
+ begin
1746
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1747
+ result_mapper = Azure::ADHybridHealthService::Mgmt::V2014_01_01::Models::Metrics.mapper()
1748
+ result.body = @client.deserialize(result_mapper, parsed_response)
1749
+ rescue Exception => e
1750
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1751
+ end
1752
+ end
1753
+
1754
+ result
1755
+ end
1756
+
1757
+ promise.execute
1758
+ end
1759
+
1760
+ #
1761
+ # Gets the sum of the metric values for a given metric and group combination.
1762
+ #
1763
+ # @param next_page_link [String] The NextLink from the previous successful call
1764
+ # to List operation.
1765
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1766
+ # will be added to the HTTP request.
1767
+ #
1768
+ # @return [Metrics] operation results.
1769
+ #
1770
+ def list_metrics_sum_next(next_page_link, custom_headers:nil)
1771
+ response = list_metrics_sum_next_async(next_page_link, custom_headers:custom_headers).value!
1772
+ response.body unless response.nil?
1773
+ end
1774
+
1775
+ #
1776
+ # Gets the sum of the metric values for a given metric and group combination.
1777
+ #
1778
+ # @param next_page_link [String] The NextLink from the previous successful call
1779
+ # to List operation.
1780
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1781
+ # will be added to the HTTP request.
1782
+ #
1783
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1784
+ #
1785
+ def list_metrics_sum_next_with_http_info(next_page_link, custom_headers:nil)
1786
+ list_metrics_sum_next_async(next_page_link, custom_headers:custom_headers).value!
1787
+ end
1788
+
1789
+ #
1790
+ # Gets the sum of the metric values for a given metric and group combination.
1791
+ #
1792
+ # @param next_page_link [String] The NextLink from the previous successful call
1793
+ # to List operation.
1794
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1795
+ # to the HTTP request.
1796
+ #
1797
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1798
+ #
1799
+ def list_metrics_sum_next_async(next_page_link, custom_headers:nil)
1800
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1801
+
1802
+
1803
+ request_headers = {}
1804
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1805
+
1806
+ # Set Headers
1807
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1808
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1809
+ path_template = '{nextLink}'
1810
+
1811
+ request_url = @base_url || @client.base_url
1812
+
1813
+ options = {
1814
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1815
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1816
+ headers: request_headers.merge(custom_headers || {}),
1817
+ base_url: request_url
1818
+ }
1819
+ promise = @client.make_request_async(:get, path_template, options)
1820
+
1821
+ promise = promise.then do |result|
1822
+ http_response = result.response
1823
+ status_code = http_response.status
1824
+ response_content = http_response.body
1825
+ unless status_code == 200
1826
+ error_model = JSON.load(response_content)
1827
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1828
+ end
1829
+
1830
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1831
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1832
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1833
+ # Deserialize Response
1834
+ if status_code == 200
1835
+ begin
1836
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1837
+ result_mapper = Azure::ADHybridHealthService::Mgmt::V2014_01_01::Models::Metrics.mapper()
1838
+ result.body = @client.deserialize(result_mapper, parsed_response)
1839
+ rescue Exception => e
1840
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1841
+ end
1842
+ end
1843
+
1844
+ result
1845
+ end
1846
+
1847
+ promise.execute
1848
+ end
1849
+
1850
+ #
1851
+ # Gets the service related metrics information.
1852
+ #
1853
+ # @param next_page_link [String] The NextLink from the previous successful call
1854
+ # to List operation.
1855
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1856
+ # will be added to the HTTP request.
1857
+ #
1858
+ # @return [MetricMetadataList] operation results.
1859
+ #
1860
+ def list_metric_metadata_next(next_page_link, custom_headers:nil)
1861
+ response = list_metric_metadata_next_async(next_page_link, custom_headers:custom_headers).value!
1862
+ response.body unless response.nil?
1863
+ end
1864
+
1865
+ #
1866
+ # Gets the service related metrics information.
1867
+ #
1868
+ # @param next_page_link [String] The NextLink from the previous successful call
1869
+ # to List operation.
1870
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1871
+ # will be added to the HTTP request.
1872
+ #
1873
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1874
+ #
1875
+ def list_metric_metadata_next_with_http_info(next_page_link, custom_headers:nil)
1876
+ list_metric_metadata_next_async(next_page_link, custom_headers:custom_headers).value!
1877
+ end
1878
+
1879
+ #
1880
+ # Gets the service related metrics information.
1881
+ #
1882
+ # @param next_page_link [String] The NextLink from the previous successful call
1883
+ # to List operation.
1884
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1885
+ # to the HTTP request.
1886
+ #
1887
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1888
+ #
1889
+ def list_metric_metadata_next_async(next_page_link, custom_headers:nil)
1890
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1891
+
1892
+
1893
+ request_headers = {}
1894
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1895
+
1896
+ # Set Headers
1897
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1898
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1899
+ path_template = '{nextLink}'
1900
+
1901
+ request_url = @base_url || @client.base_url
1902
+
1903
+ options = {
1904
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1905
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1906
+ headers: request_headers.merge(custom_headers || {}),
1907
+ base_url: request_url
1908
+ }
1909
+ promise = @client.make_request_async(:get, path_template, options)
1910
+
1911
+ promise = promise.then do |result|
1912
+ http_response = result.response
1913
+ status_code = http_response.status
1914
+ response_content = http_response.body
1915
+ unless status_code == 200
1916
+ error_model = JSON.load(response_content)
1917
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1918
+ end
1919
+
1920
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1921
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1922
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1923
+ # Deserialize Response
1924
+ if status_code == 200
1925
+ begin
1926
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1927
+ result_mapper = Azure::ADHybridHealthService::Mgmt::V2014_01_01::Models::MetricMetadataList.mapper()
1928
+ result.body = @client.deserialize(result_mapper, parsed_response)
1929
+ rescue Exception => e
1930
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1931
+ end
1932
+ end
1933
+
1934
+ result
1935
+ end
1936
+
1937
+ promise.execute
1938
+ end
1939
+
1940
+ #
1941
+ # Gets the details of an alert for a given Active Directory Domain Controller
1942
+ # service and server combination.
1943
+ #
1944
+ # @param next_page_link [String] The NextLink from the previous successful call
1945
+ # to List operation.
1946
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1947
+ # will be added to the HTTP request.
1948
+ #
1949
+ # @return [Alerts] operation results.
1950
+ #
1951
+ def list_server_alerts_next(next_page_link, custom_headers:nil)
1952
+ response = list_server_alerts_next_async(next_page_link, custom_headers:custom_headers).value!
1953
+ response.body unless response.nil?
1954
+ end
1955
+
1956
+ #
1957
+ # Gets the details of an alert for a given Active Directory Domain Controller
1958
+ # service and server combination.
1959
+ #
1960
+ # @param next_page_link [String] The NextLink from the previous successful call
1961
+ # to List operation.
1962
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1963
+ # will be added to the HTTP request.
1964
+ #
1965
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1966
+ #
1967
+ def list_server_alerts_next_with_http_info(next_page_link, custom_headers:nil)
1968
+ list_server_alerts_next_async(next_page_link, custom_headers:custom_headers).value!
1969
+ end
1970
+
1971
+ #
1972
+ # Gets the details of an alert for a given Active Directory Domain Controller
1973
+ # service and server combination.
1974
+ #
1975
+ # @param next_page_link [String] The NextLink from the previous successful call
1976
+ # to List operation.
1977
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1978
+ # to the HTTP request.
1979
+ #
1980
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1981
+ #
1982
+ def list_server_alerts_next_async(next_page_link, custom_headers:nil)
1983
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1984
+
1985
+
1986
+ request_headers = {}
1987
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1988
+
1989
+ # Set Headers
1990
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1991
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1992
+ path_template = '{nextLink}'
1993
+
1994
+ request_url = @base_url || @client.base_url
1995
+
1996
+ options = {
1997
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1998
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1999
+ headers: request_headers.merge(custom_headers || {}),
2000
+ base_url: request_url
2001
+ }
2002
+ promise = @client.make_request_async(:get, path_template, options)
2003
+
2004
+ promise = promise.then do |result|
2005
+ http_response = result.response
2006
+ status_code = http_response.status
2007
+ response_content = http_response.body
2008
+ unless status_code == 200
2009
+ error_model = JSON.load(response_content)
2010
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2011
+ end
2012
+
2013
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2014
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2015
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2016
+ # Deserialize Response
2017
+ if status_code == 200
2018
+ begin
2019
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2020
+ result_mapper = Azure::ADHybridHealthService::Mgmt::V2014_01_01::Models::Alerts.mapper()
2021
+ result.body = @client.deserialize(result_mapper, parsed_response)
2022
+ rescue Exception => e
2023
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2024
+ end
2025
+ end
2026
+
2027
+ result
2028
+ end
2029
+
2030
+ promise.execute
2031
+ end
2032
+
2033
+ #
2034
+ # Gets the details of Active Directory Domain Services for a tenant having
2035
+ # Azure AD Premium license and is onboarded to Azure Active Directory Connect
2036
+ # Health.
2037
+ #
2038
+ # @param next_page_link [String] The NextLink from the previous successful call
2039
+ # to List operation.
2040
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2041
+ # will be added to the HTTP request.
2042
+ #
2043
+ # @return [Services] operation results.
2044
+ #
2045
+ def list_premium_services_next(next_page_link, custom_headers:nil)
2046
+ response = list_premium_services_next_async(next_page_link, custom_headers:custom_headers).value!
2047
+ response.body unless response.nil?
2048
+ end
2049
+
2050
+ #
2051
+ # Gets the details of Active Directory Domain Services for a tenant having
2052
+ # Azure AD Premium license and is onboarded to Azure Active Directory Connect
2053
+ # Health.
2054
+ #
2055
+ # @param next_page_link [String] The NextLink from the previous successful call
2056
+ # to List operation.
2057
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2058
+ # will be added to the HTTP request.
2059
+ #
2060
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2061
+ #
2062
+ def list_premium_services_next_with_http_info(next_page_link, custom_headers:nil)
2063
+ list_premium_services_next_async(next_page_link, custom_headers:custom_headers).value!
2064
+ end
2065
+
2066
+ #
2067
+ # Gets the details of Active Directory Domain Services for a tenant having
2068
+ # Azure AD Premium license and is onboarded to Azure Active Directory Connect
2069
+ # Health.
2070
+ #
2071
+ # @param next_page_link [String] The NextLink from the previous successful call
2072
+ # to List operation.
2073
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2074
+ # to the HTTP request.
2075
+ #
2076
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2077
+ #
2078
+ def list_premium_services_next_async(next_page_link, custom_headers:nil)
2079
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
2080
+
2081
+
2082
+ request_headers = {}
2083
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2084
+
2085
+ # Set Headers
2086
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2087
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2088
+ path_template = '{nextLink}'
2089
+
2090
+ request_url = @base_url || @client.base_url
2091
+
2092
+ options = {
2093
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2094
+ skip_encoding_path_params: {'nextLink' => next_page_link},
2095
+ headers: request_headers.merge(custom_headers || {}),
2096
+ base_url: request_url
2097
+ }
2098
+ promise = @client.make_request_async(:get, path_template, options)
2099
+
2100
+ promise = promise.then do |result|
2101
+ http_response = result.response
2102
+ status_code = http_response.status
2103
+ response_content = http_response.body
2104
+ unless status_code == 200
2105
+ error_model = JSON.load(response_content)
2106
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2107
+ end
2108
+
2109
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2110
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2111
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2112
+ # Deserialize Response
2113
+ if status_code == 200
2114
+ begin
2115
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2116
+ result_mapper = Azure::ADHybridHealthService::Mgmt::V2014_01_01::Models::Services.mapper()
2117
+ result.body = @client.deserialize(result_mapper, parsed_response)
2118
+ rescue Exception => e
2119
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2120
+ end
2121
+ end
2122
+
2123
+ result
2124
+ end
2125
+
2126
+ promise.execute
2127
+ end
2128
+
2129
+ #
2130
+ # Gets the details of Active Directory Domain Service, for a tenant, that are
2131
+ # onboarded to Azure Active Directory Connect Health.
2132
+ #
2133
+ # @param filter [String] The service property filter to apply.
2134
+ # @param service_type [String] The service type for the services onboarded to
2135
+ # Azure Active Directory Connect Health. Depending on whether the service is
2136
+ # monitoring, ADFS, Sync or ADDS roles, the service type can either be
2137
+ # AdFederationService or AadSyncService or AdDomainService.
2138
+ # @param skip_count [Integer] The skip count, which specifies the number of
2139
+ # elements that can be bypassed from a sequence and then return the remaining
2140
+ # elements.
2141
+ # @param take_count [Integer] The take count , which specifies the number of
2142
+ # elements that can be returned from a sequence.
2143
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2144
+ # will be added to the HTTP request.
2145
+ #
2146
+ # @return [Services] which provide lazy access to pages of the response.
2147
+ #
2148
+ def list_as_lazy(filter:nil, service_type:nil, skip_count:nil, take_count:nil, custom_headers:nil)
2149
+ response = list_async(filter:filter, service_type:service_type, skip_count:skip_count, take_count:take_count, custom_headers:custom_headers).value!
2150
+ unless response.nil?
2151
+ page = response.body
2152
+ page.next_method = Proc.new do |next_page_link|
2153
+ list_next_async(next_page_link, custom_headers:custom_headers)
2154
+ end
2155
+ page
2156
+ end
2157
+ end
2158
+
2159
+ #
2160
+ # Gets the average of the metric values for a given metric and group
2161
+ # combination.
2162
+ #
2163
+ # @param service_name [String] The name of the service.
2164
+ # @param metric_name [String] The metric name
2165
+ # @param group_name [String] The group name
2166
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2167
+ # will be added to the HTTP request.
2168
+ #
2169
+ # @return [Metrics] which provide lazy access to pages of the response.
2170
+ #
2171
+ def list_metrics_average_as_lazy(service_name, metric_name, group_name, custom_headers:nil)
2172
+ response = list_metrics_average_async(service_name, metric_name, group_name, custom_headers:custom_headers).value!
2173
+ unless response.nil?
2174
+ page = response.body
2175
+ page.next_method = Proc.new do |next_page_link|
2176
+ list_metrics_average_next_async(next_page_link, custom_headers:custom_headers)
2177
+ end
2178
+ page
2179
+ end
2180
+ end
2181
+
2182
+ #
2183
+ # Gets the sum of the metric values for a given metric and group combination.
2184
+ #
2185
+ # @param service_name [String] The name of the service.
2186
+ # @param metric_name [String] The metric name
2187
+ # @param group_name [String] The group name
2188
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2189
+ # will be added to the HTTP request.
2190
+ #
2191
+ # @return [Metrics] which provide lazy access to pages of the response.
2192
+ #
2193
+ def list_metrics_sum_as_lazy(service_name, metric_name, group_name, custom_headers:nil)
2194
+ response = list_metrics_sum_async(service_name, metric_name, group_name, custom_headers:custom_headers).value!
2195
+ unless response.nil?
2196
+ page = response.body
2197
+ page.next_method = Proc.new do |next_page_link|
2198
+ list_metrics_sum_next_async(next_page_link, custom_headers:custom_headers)
2199
+ end
2200
+ page
2201
+ end
2202
+ end
2203
+
2204
+ #
2205
+ # Gets the service related metrics information.
2206
+ #
2207
+ # @param service_name [String] The name of the service.
2208
+ # @param filter [String] The metric metadata property filter to apply.
2209
+ # @param perf_counter [Boolean] Indicates if only performance counter metrics
2210
+ # are requested.
2211
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2212
+ # will be added to the HTTP request.
2213
+ #
2214
+ # @return [MetricMetadataList] which provide lazy access to pages of the
2215
+ # response.
2216
+ #
2217
+ def list_metric_metadata_as_lazy(service_name, filter:nil, perf_counter:nil, custom_headers:nil)
2218
+ response = list_metric_metadata_async(service_name, filter:filter, perf_counter:perf_counter, custom_headers:custom_headers).value!
2219
+ unless response.nil?
2220
+ page = response.body
2221
+ page.next_method = Proc.new do |next_page_link|
2222
+ list_metric_metadata_next_async(next_page_link, custom_headers:custom_headers)
2223
+ end
2224
+ page
2225
+ end
2226
+ end
2227
+
2228
+ #
2229
+ # Gets the details of an alert for a given Active Directory Domain Controller
2230
+ # service and server combination.
2231
+ #
2232
+ # @param service_member_id The server Id for which the alert details needs to
2233
+ # be queried.
2234
+ # @param service_name [String] The name of the service.
2235
+ # @param filter [String] The alert property filter to apply.
2236
+ # @param state [String] The alert state to query for.
2237
+ # @param from [DateTime] The start date to query for.
2238
+ # @param to [DateTime] The end date till when to query for.
2239
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2240
+ # will be added to the HTTP request.
2241
+ #
2242
+ # @return [Alerts] which provide lazy access to pages of the response.
2243
+ #
2244
+ def list_server_alerts_as_lazy(service_member_id, service_name, filter:nil, state:nil, from:nil, to:nil, custom_headers:nil)
2245
+ response = list_server_alerts_async(service_member_id, service_name, filter:filter, state:state, from:from, to:to, custom_headers:custom_headers).value!
2246
+ unless response.nil?
2247
+ page = response.body
2248
+ page.next_method = Proc.new do |next_page_link|
2249
+ list_server_alerts_next_async(next_page_link, custom_headers:custom_headers)
2250
+ end
2251
+ page
2252
+ end
2253
+ end
2254
+
2255
+ #
2256
+ # Gets the details of Active Directory Domain Services for a tenant having
2257
+ # Azure AD Premium license and is onboarded to Azure Active Directory Connect
2258
+ # Health.
2259
+ #
2260
+ # @param filter [String] The service property filter to apply.
2261
+ # @param service_type [String] The service type for the services onboarded to
2262
+ # Azure Active Directory Connect Health. Depending on whether the service is
2263
+ # monitoring, ADFS, Sync or ADDS roles, the service type can either be
2264
+ # AdFederationService or AadSyncService or AdDomainService.
2265
+ # @param skip_count [Integer] The skip count, which specifies the number of
2266
+ # elements that can be bypassed from a sequence and then return the remaining
2267
+ # elements.
2268
+ # @param take_count [Integer] The take count , which specifies the number of
2269
+ # elements that can be returned from a sequence.
2270
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2271
+ # will be added to the HTTP request.
2272
+ #
2273
+ # @return [Services] which provide lazy access to pages of the response.
2274
+ #
2275
+ def list_premium_services_as_lazy(filter:nil, service_type:nil, skip_count:nil, take_count:nil, custom_headers:nil)
2276
+ response = list_premium_services_async(filter:filter, service_type:service_type, skip_count:skip_count, take_count:take_count, custom_headers:custom_headers).value!
2277
+ unless response.nil?
2278
+ page = response.body
2279
+ page.next_method = Proc.new do |next_page_link|
2280
+ list_premium_services_next_async(next_page_link, custom_headers:custom_headers)
2281
+ end
2282
+ page
2283
+ end
2284
+ end
2285
+
2286
+ end
2287
+ end