1package adhybridhealthservice 2 3// Copyright (c) Microsoft Corporation. All rights reserved. 4// Licensed under the MIT License. See License.txt in the project root for license information. 5// 6// Code generated by Microsoft (R) AutoRest Code Generator. 7// Changes may cause incorrect behavior and will be lost if the code is regenerated. 8 9import ( 10 "context" 11 "github.com/Azure/go-autorest/autorest" 12 "github.com/Azure/go-autorest/autorest/azure" 13 "github.com/Azure/go-autorest/autorest/date" 14 "github.com/Azure/go-autorest/tracing" 15 "net/http" 16) 17 18// ServicesClient is the REST APIs for Azure Active Directory Connect Health 19type ServicesClient struct { 20 BaseClient 21} 22 23// NewServicesClient creates an instance of the ServicesClient client. 24func NewServicesClient() ServicesClient { 25 return NewServicesClientWithBaseURI(DefaultBaseURI) 26} 27 28// NewServicesClientWithBaseURI creates an instance of the ServicesClient client using a custom endpoint. Use this 29// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). 30func NewServicesClientWithBaseURI(baseURI string) ServicesClient { 31 return ServicesClient{NewWithBaseURI(baseURI)} 32} 33 34// Add onboards a service for a given tenant in Azure Active Directory Connect Health. 35// Parameters: 36// service - the service object. 37func (client ServicesClient) Add(ctx context.Context, service ServiceProperties) (result ServiceProperties, err error) { 38 if tracing.IsEnabled() { 39 ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.Add") 40 defer func() { 41 sc := -1 42 if result.Response.Response != nil { 43 sc = result.Response.Response.StatusCode 44 } 45 tracing.EndSpan(ctx, sc, err) 46 }() 47 } 48 req, err := client.AddPreparer(ctx, service) 49 if err != nil { 50 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "Add", nil, "Failure preparing request") 51 return 52 } 53 54 resp, err := client.AddSender(req) 55 if err != nil { 56 result.Response = autorest.Response{Response: resp} 57 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "Add", resp, "Failure sending request") 58 return 59 } 60 61 result, err = client.AddResponder(resp) 62 if err != nil { 63 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "Add", resp, "Failure responding to request") 64 return 65 } 66 67 return 68} 69 70// AddPreparer prepares the Add request. 71func (client ServicesClient) AddPreparer(ctx context.Context, service ServiceProperties) (*http.Request, error) { 72 const APIVersion = "2014-01-01" 73 queryParameters := map[string]interface{}{ 74 "api-version": APIVersion, 75 } 76 77 preparer := autorest.CreatePreparer( 78 autorest.AsContentType("application/json; charset=utf-8"), 79 autorest.AsPost(), 80 autorest.WithBaseURL(client.BaseURI), 81 autorest.WithPath("/providers/Microsoft.ADHybridHealthService/services"), 82 autorest.WithJSON(service), 83 autorest.WithQueryParameters(queryParameters)) 84 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 85} 86 87// AddSender sends the Add request. The method will close the 88// http.Response Body if it receives an error. 89func (client ServicesClient) AddSender(req *http.Request) (*http.Response, error) { 90 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 91} 92 93// AddResponder handles the response to the Add request. The method always 94// closes the http.Response Body. 95func (client ServicesClient) AddResponder(resp *http.Response) (result ServiceProperties, err error) { 96 err = autorest.Respond( 97 resp, 98 azure.WithErrorUnlessStatusCode(http.StatusOK), 99 autorest.ByUnmarshallingJSON(&result), 100 autorest.ByClosing()) 101 result.Response = autorest.Response{Response: resp} 102 return 103} 104 105// AddAlertFeedback adds an alert feedback submitted by customer. 106// Parameters: 107// serviceName - the name of the service. 108// alertFeedback - the alert feedback. 109func (client ServicesClient) AddAlertFeedback(ctx context.Context, serviceName string, alertFeedback AlertFeedback) (result AlertFeedback, err error) { 110 if tracing.IsEnabled() { 111 ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.AddAlertFeedback") 112 defer func() { 113 sc := -1 114 if result.Response.Response != nil { 115 sc = result.Response.Response.StatusCode 116 } 117 tracing.EndSpan(ctx, sc, err) 118 }() 119 } 120 req, err := client.AddAlertFeedbackPreparer(ctx, serviceName, alertFeedback) 121 if err != nil { 122 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "AddAlertFeedback", nil, "Failure preparing request") 123 return 124 } 125 126 resp, err := client.AddAlertFeedbackSender(req) 127 if err != nil { 128 result.Response = autorest.Response{Response: resp} 129 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "AddAlertFeedback", resp, "Failure sending request") 130 return 131 } 132 133 result, err = client.AddAlertFeedbackResponder(resp) 134 if err != nil { 135 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "AddAlertFeedback", resp, "Failure responding to request") 136 return 137 } 138 139 return 140} 141 142// AddAlertFeedbackPreparer prepares the AddAlertFeedback request. 143func (client ServicesClient) AddAlertFeedbackPreparer(ctx context.Context, serviceName string, alertFeedback AlertFeedback) (*http.Request, error) { 144 pathParameters := map[string]interface{}{ 145 "serviceName": autorest.Encode("path", serviceName), 146 } 147 148 const APIVersion = "2014-01-01" 149 queryParameters := map[string]interface{}{ 150 "api-version": APIVersion, 151 } 152 153 preparer := autorest.CreatePreparer( 154 autorest.AsContentType("application/json; charset=utf-8"), 155 autorest.AsPost(), 156 autorest.WithBaseURL(client.BaseURI), 157 autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/services/{serviceName}/feedbacktype/alerts/feedback", pathParameters), 158 autorest.WithJSON(alertFeedback), 159 autorest.WithQueryParameters(queryParameters)) 160 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 161} 162 163// AddAlertFeedbackSender sends the AddAlertFeedback request. The method will close the 164// http.Response Body if it receives an error. 165func (client ServicesClient) AddAlertFeedbackSender(req *http.Request) (*http.Response, error) { 166 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 167} 168 169// AddAlertFeedbackResponder handles the response to the AddAlertFeedback request. The method always 170// closes the http.Response Body. 171func (client ServicesClient) AddAlertFeedbackResponder(resp *http.Response) (result AlertFeedback, err error) { 172 err = autorest.Respond( 173 resp, 174 azure.WithErrorUnlessStatusCode(http.StatusOK), 175 autorest.ByUnmarshallingJSON(&result), 176 autorest.ByClosing()) 177 result.Response = autorest.Response{Response: resp} 178 return 179} 180 181// Delete deletes a service which is onboarded to Azure Active Directory Connect Health. 182// Parameters: 183// serviceName - the name of the service which needs to be deleted. 184// confirm - indicates if the service will be permanently deleted or disabled. True indicates that the service 185// will be permanently deleted and False indicates that the service will be marked disabled and then deleted 186// after 30 days, if it is not re-registered. 187func (client ServicesClient) Delete(ctx context.Context, serviceName string, confirm *bool) (result autorest.Response, err error) { 188 if tracing.IsEnabled() { 189 ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.Delete") 190 defer func() { 191 sc := -1 192 if result.Response != nil { 193 sc = result.Response.StatusCode 194 } 195 tracing.EndSpan(ctx, sc, err) 196 }() 197 } 198 req, err := client.DeletePreparer(ctx, serviceName, confirm) 199 if err != nil { 200 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "Delete", nil, "Failure preparing request") 201 return 202 } 203 204 resp, err := client.DeleteSender(req) 205 if err != nil { 206 result.Response = resp 207 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "Delete", resp, "Failure sending request") 208 return 209 } 210 211 result, err = client.DeleteResponder(resp) 212 if err != nil { 213 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "Delete", resp, "Failure responding to request") 214 return 215 } 216 217 return 218} 219 220// DeletePreparer prepares the Delete request. 221func (client ServicesClient) DeletePreparer(ctx context.Context, serviceName string, confirm *bool) (*http.Request, error) { 222 pathParameters := map[string]interface{}{ 223 "serviceName": autorest.Encode("path", serviceName), 224 } 225 226 const APIVersion = "2014-01-01" 227 queryParameters := map[string]interface{}{ 228 "api-version": APIVersion, 229 } 230 if confirm != nil { 231 queryParameters["confirm"] = autorest.Encode("query", *confirm) 232 } 233 234 preparer := autorest.CreatePreparer( 235 autorest.AsDelete(), 236 autorest.WithBaseURL(client.BaseURI), 237 autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/services/{serviceName}", pathParameters), 238 autorest.WithQueryParameters(queryParameters)) 239 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 240} 241 242// DeleteSender sends the Delete request. The method will close the 243// http.Response Body if it receives an error. 244func (client ServicesClient) DeleteSender(req *http.Request) (*http.Response, error) { 245 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 246} 247 248// DeleteResponder handles the response to the Delete request. The method always 249// closes the http.Response Body. 250func (client ServicesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { 251 err = autorest.Respond( 252 resp, 253 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), 254 autorest.ByClosing()) 255 result.Response = resp 256 return 257} 258 259// Get gets the details of a service for a tenant having Azure AD Premium license and is onboarded to Azure Active 260// Directory Connect Health. 261// Parameters: 262// serviceName - the name of the service. 263func (client ServicesClient) Get(ctx context.Context, serviceName string) (result ServiceProperties, err error) { 264 if tracing.IsEnabled() { 265 ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.Get") 266 defer func() { 267 sc := -1 268 if result.Response.Response != nil { 269 sc = result.Response.Response.StatusCode 270 } 271 tracing.EndSpan(ctx, sc, err) 272 }() 273 } 274 req, err := client.GetPreparer(ctx, serviceName) 275 if err != nil { 276 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "Get", nil, "Failure preparing request") 277 return 278 } 279 280 resp, err := client.GetSender(req) 281 if err != nil { 282 result.Response = autorest.Response{Response: resp} 283 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "Get", resp, "Failure sending request") 284 return 285 } 286 287 result, err = client.GetResponder(resp) 288 if err != nil { 289 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "Get", resp, "Failure responding to request") 290 return 291 } 292 293 return 294} 295 296// GetPreparer prepares the Get request. 297func (client ServicesClient) GetPreparer(ctx context.Context, serviceName string) (*http.Request, error) { 298 pathParameters := map[string]interface{}{ 299 "serviceName": autorest.Encode("path", serviceName), 300 } 301 302 const APIVersion = "2014-01-01" 303 queryParameters := map[string]interface{}{ 304 "api-version": APIVersion, 305 } 306 307 preparer := autorest.CreatePreparer( 308 autorest.AsGet(), 309 autorest.WithBaseURL(client.BaseURI), 310 autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/services/{serviceName}", pathParameters), 311 autorest.WithQueryParameters(queryParameters)) 312 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 313} 314 315// GetSender sends the Get request. The method will close the 316// http.Response Body if it receives an error. 317func (client ServicesClient) GetSender(req *http.Request) (*http.Response, error) { 318 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 319} 320 321// GetResponder handles the response to the Get request. The method always 322// closes the http.Response Body. 323func (client ServicesClient) GetResponder(resp *http.Response) (result ServiceProperties, err error) { 324 err = autorest.Respond( 325 resp, 326 azure.WithErrorUnlessStatusCode(http.StatusOK), 327 autorest.ByUnmarshallingJSON(&result), 328 autorest.ByClosing()) 329 result.Response = autorest.Response{Response: resp} 330 return 331} 332 333// GetFeatureAvailibility checks if the service has all the pre-requisites met to use a feature. 334// Parameters: 335// serviceName - the name of the service. 336// featureName - the name of the feature. 337func (client ServicesClient) GetFeatureAvailibility(ctx context.Context, serviceName string, featureName string) (result Result, err error) { 338 if tracing.IsEnabled() { 339 ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.GetFeatureAvailibility") 340 defer func() { 341 sc := -1 342 if result.Response.Response != nil { 343 sc = result.Response.Response.StatusCode 344 } 345 tracing.EndSpan(ctx, sc, err) 346 }() 347 } 348 req, err := client.GetFeatureAvailibilityPreparer(ctx, serviceName, featureName) 349 if err != nil { 350 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetFeatureAvailibility", nil, "Failure preparing request") 351 return 352 } 353 354 resp, err := client.GetFeatureAvailibilitySender(req) 355 if err != nil { 356 result.Response = autorest.Response{Response: resp} 357 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetFeatureAvailibility", resp, "Failure sending request") 358 return 359 } 360 361 result, err = client.GetFeatureAvailibilityResponder(resp) 362 if err != nil { 363 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetFeatureAvailibility", resp, "Failure responding to request") 364 return 365 } 366 367 return 368} 369 370// GetFeatureAvailibilityPreparer prepares the GetFeatureAvailibility request. 371func (client ServicesClient) GetFeatureAvailibilityPreparer(ctx context.Context, serviceName string, featureName string) (*http.Request, error) { 372 pathParameters := map[string]interface{}{ 373 "featureName": autorest.Encode("path", featureName), 374 "serviceName": autorest.Encode("path", serviceName), 375 } 376 377 const APIVersion = "2014-01-01" 378 queryParameters := map[string]interface{}{ 379 "api-version": APIVersion, 380 } 381 382 preparer := autorest.CreatePreparer( 383 autorest.AsGet(), 384 autorest.WithBaseURL(client.BaseURI), 385 autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/services/{serviceName}/checkServiceFeatureAvailibility/{featureName}", pathParameters), 386 autorest.WithQueryParameters(queryParameters)) 387 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 388} 389 390// GetFeatureAvailibilitySender sends the GetFeatureAvailibility request. The method will close the 391// http.Response Body if it receives an error. 392func (client ServicesClient) GetFeatureAvailibilitySender(req *http.Request) (*http.Response, error) { 393 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 394} 395 396// GetFeatureAvailibilityResponder handles the response to the GetFeatureAvailibility request. The method always 397// closes the http.Response Body. 398func (client ServicesClient) GetFeatureAvailibilityResponder(resp *http.Response) (result Result, err error) { 399 err = autorest.Respond( 400 resp, 401 azure.WithErrorUnlessStatusCode(http.StatusOK), 402 autorest.ByUnmarshallingJSON(&result), 403 autorest.ByClosing()) 404 result.Response = autorest.Response{Response: resp} 405 return 406} 407 408// GetMetricMetadata gets the service related metrics information. 409// Parameters: 410// serviceName - the name of the service. 411// metricName - the metric name 412func (client ServicesClient) GetMetricMetadata(ctx context.Context, serviceName string, metricName string) (result MetricMetadata, err error) { 413 if tracing.IsEnabled() { 414 ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.GetMetricMetadata") 415 defer func() { 416 sc := -1 417 if result.Response.Response != nil { 418 sc = result.Response.Response.StatusCode 419 } 420 tracing.EndSpan(ctx, sc, err) 421 }() 422 } 423 req, err := client.GetMetricMetadataPreparer(ctx, serviceName, metricName) 424 if err != nil { 425 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetMetricMetadata", nil, "Failure preparing request") 426 return 427 } 428 429 resp, err := client.GetMetricMetadataSender(req) 430 if err != nil { 431 result.Response = autorest.Response{Response: resp} 432 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetMetricMetadata", resp, "Failure sending request") 433 return 434 } 435 436 result, err = client.GetMetricMetadataResponder(resp) 437 if err != nil { 438 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetMetricMetadata", resp, "Failure responding to request") 439 return 440 } 441 442 return 443} 444 445// GetMetricMetadataPreparer prepares the GetMetricMetadata request. 446func (client ServicesClient) GetMetricMetadataPreparer(ctx context.Context, serviceName string, metricName string) (*http.Request, error) { 447 pathParameters := map[string]interface{}{ 448 "metricName": autorest.Encode("path", metricName), 449 "serviceName": autorest.Encode("path", serviceName), 450 } 451 452 const APIVersion = "2014-01-01" 453 queryParameters := map[string]interface{}{ 454 "api-version": APIVersion, 455 } 456 457 preparer := autorest.CreatePreparer( 458 autorest.AsGet(), 459 autorest.WithBaseURL(client.BaseURI), 460 autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/services/{serviceName}/metricmetadata/{metricName}", pathParameters), 461 autorest.WithQueryParameters(queryParameters)) 462 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 463} 464 465// GetMetricMetadataSender sends the GetMetricMetadata request. The method will close the 466// http.Response Body if it receives an error. 467func (client ServicesClient) GetMetricMetadataSender(req *http.Request) (*http.Response, error) { 468 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 469} 470 471// GetMetricMetadataResponder handles the response to the GetMetricMetadata request. The method always 472// closes the http.Response Body. 473func (client ServicesClient) GetMetricMetadataResponder(resp *http.Response) (result MetricMetadata, err error) { 474 err = autorest.Respond( 475 resp, 476 azure.WithErrorUnlessStatusCode(http.StatusOK), 477 autorest.ByUnmarshallingJSON(&result), 478 autorest.ByClosing()) 479 result.Response = autorest.Response{Response: resp} 480 return 481} 482 483// GetMetricMetadataForGroup gets the service related metrics for a given metric and group combination. 484// Parameters: 485// serviceName - the name of the service. 486// metricName - the metric name 487// groupName - the group name 488// groupKey - the group key 489// fromDate - the start date. 490// toDate - the end date. 491func (client ServicesClient) GetMetricMetadataForGroup(ctx context.Context, serviceName string, metricName string, groupName string, groupKey string, fromDate *date.Time, toDate *date.Time) (result MetricSets, err error) { 492 if tracing.IsEnabled() { 493 ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.GetMetricMetadataForGroup") 494 defer func() { 495 sc := -1 496 if result.Response.Response != nil { 497 sc = result.Response.Response.StatusCode 498 } 499 tracing.EndSpan(ctx, sc, err) 500 }() 501 } 502 req, err := client.GetMetricMetadataForGroupPreparer(ctx, serviceName, metricName, groupName, groupKey, fromDate, toDate) 503 if err != nil { 504 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetMetricMetadataForGroup", nil, "Failure preparing request") 505 return 506 } 507 508 resp, err := client.GetMetricMetadataForGroupSender(req) 509 if err != nil { 510 result.Response = autorest.Response{Response: resp} 511 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetMetricMetadataForGroup", resp, "Failure sending request") 512 return 513 } 514 515 result, err = client.GetMetricMetadataForGroupResponder(resp) 516 if err != nil { 517 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetMetricMetadataForGroup", resp, "Failure responding to request") 518 return 519 } 520 521 return 522} 523 524// GetMetricMetadataForGroupPreparer prepares the GetMetricMetadataForGroup request. 525func (client ServicesClient) GetMetricMetadataForGroupPreparer(ctx context.Context, serviceName string, metricName string, groupName string, groupKey string, fromDate *date.Time, toDate *date.Time) (*http.Request, error) { 526 pathParameters := map[string]interface{}{ 527 "groupName": autorest.Encode("path", groupName), 528 "metricName": autorest.Encode("path", metricName), 529 "serviceName": autorest.Encode("path", serviceName), 530 } 531 532 const APIVersion = "2014-01-01" 533 queryParameters := map[string]interface{}{ 534 "api-version": APIVersion, 535 } 536 if len(groupKey) > 0 { 537 queryParameters["groupKey"] = autorest.Encode("query", groupKey) 538 } 539 if fromDate != nil { 540 queryParameters["fromDate"] = autorest.Encode("query", *fromDate) 541 } 542 if toDate != nil { 543 queryParameters["toDate"] = autorest.Encode("query", *toDate) 544 } 545 546 preparer := autorest.CreatePreparer( 547 autorest.AsGet(), 548 autorest.WithBaseURL(client.BaseURI), 549 autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/services/{serviceName}/metricmetadata/{metricName}/groups/{groupName}", pathParameters), 550 autorest.WithQueryParameters(queryParameters)) 551 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 552} 553 554// GetMetricMetadataForGroupSender sends the GetMetricMetadataForGroup request. The method will close the 555// http.Response Body if it receives an error. 556func (client ServicesClient) GetMetricMetadataForGroupSender(req *http.Request) (*http.Response, error) { 557 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 558} 559 560// GetMetricMetadataForGroupResponder handles the response to the GetMetricMetadataForGroup request. The method always 561// closes the http.Response Body. 562func (client ServicesClient) GetMetricMetadataForGroupResponder(resp *http.Response) (result MetricSets, err error) { 563 err = autorest.Respond( 564 resp, 565 azure.WithErrorUnlessStatusCode(http.StatusOK), 566 autorest.ByUnmarshallingJSON(&result), 567 autorest.ByClosing()) 568 result.Response = autorest.Response{Response: resp} 569 return 570} 571 572// GetTenantWhitelisting checks if the tenant, to which a service is registered, is whitelisted to use a feature. 573// Parameters: 574// serviceName - the name of the service. 575// featureName - the name of the feature. 576func (client ServicesClient) GetTenantWhitelisting(ctx context.Context, serviceName string, featureName string) (result Result, err error) { 577 if tracing.IsEnabled() { 578 ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.GetTenantWhitelisting") 579 defer func() { 580 sc := -1 581 if result.Response.Response != nil { 582 sc = result.Response.Response.StatusCode 583 } 584 tracing.EndSpan(ctx, sc, err) 585 }() 586 } 587 req, err := client.GetTenantWhitelistingPreparer(ctx, serviceName, featureName) 588 if err != nil { 589 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetTenantWhitelisting", nil, "Failure preparing request") 590 return 591 } 592 593 resp, err := client.GetTenantWhitelistingSender(req) 594 if err != nil { 595 result.Response = autorest.Response{Response: resp} 596 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetTenantWhitelisting", resp, "Failure sending request") 597 return 598 } 599 600 result, err = client.GetTenantWhitelistingResponder(resp) 601 if err != nil { 602 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "GetTenantWhitelisting", resp, "Failure responding to request") 603 return 604 } 605 606 return 607} 608 609// GetTenantWhitelistingPreparer prepares the GetTenantWhitelisting request. 610func (client ServicesClient) GetTenantWhitelistingPreparer(ctx context.Context, serviceName string, featureName string) (*http.Request, error) { 611 pathParameters := map[string]interface{}{ 612 "featureName": autorest.Encode("path", featureName), 613 "serviceName": autorest.Encode("path", serviceName), 614 } 615 616 const APIVersion = "2014-01-01" 617 queryParameters := map[string]interface{}{ 618 "api-version": APIVersion, 619 } 620 621 preparer := autorest.CreatePreparer( 622 autorest.AsGet(), 623 autorest.WithBaseURL(client.BaseURI), 624 autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/services/{serviceName}/TenantWhitelisting/{featureName}", pathParameters), 625 autorest.WithQueryParameters(queryParameters)) 626 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 627} 628 629// GetTenantWhitelistingSender sends the GetTenantWhitelisting request. The method will close the 630// http.Response Body if it receives an error. 631func (client ServicesClient) GetTenantWhitelistingSender(req *http.Request) (*http.Response, error) { 632 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 633} 634 635// GetTenantWhitelistingResponder handles the response to the GetTenantWhitelisting request. The method always 636// closes the http.Response Body. 637func (client ServicesClient) GetTenantWhitelistingResponder(resp *http.Response) (result Result, err error) { 638 err = autorest.Respond( 639 resp, 640 azure.WithErrorUnlessStatusCode(http.StatusOK), 641 autorest.ByUnmarshallingJSON(&result), 642 autorest.ByClosing()) 643 result.Response = autorest.Response{Response: resp} 644 return 645} 646 647// List gets the details of services, for a tenant, that are onboarded to Azure Active Directory Connect Health. 648// Parameters: 649// filter - the service property filter to apply. 650// serviceType - the service type for the services onboarded to Azure Active Directory Connect Health. 651// Depending on whether the service is monitoring, ADFS, Sync or ADDS roles, the service type can either be 652// AdFederationService or AadSyncService or AdDomainService. 653// skipCount - the skip count, which specifies the number of elements that can be bypassed from a sequence and 654// then return the remaining elements. 655// takeCount - the take count , which specifies the number of elements that can be returned from a sequence. 656func (client ServicesClient) List(ctx context.Context, filter string, serviceType string, skipCount *int32, takeCount *int32) (result ServicesPage, err error) { 657 if tracing.IsEnabled() { 658 ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.List") 659 defer func() { 660 sc := -1 661 if result.s.Response.Response != nil { 662 sc = result.s.Response.Response.StatusCode 663 } 664 tracing.EndSpan(ctx, sc, err) 665 }() 666 } 667 result.fn = client.listNextResults 668 req, err := client.ListPreparer(ctx, filter, serviceType, skipCount, takeCount) 669 if err != nil { 670 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "List", nil, "Failure preparing request") 671 return 672 } 673 674 resp, err := client.ListSender(req) 675 if err != nil { 676 result.s.Response = autorest.Response{Response: resp} 677 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "List", resp, "Failure sending request") 678 return 679 } 680 681 result.s, err = client.ListResponder(resp) 682 if err != nil { 683 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "List", resp, "Failure responding to request") 684 return 685 } 686 if result.s.hasNextLink() && result.s.IsEmpty() { 687 err = result.NextWithContext(ctx) 688 return 689 } 690 691 return 692} 693 694// ListPreparer prepares the List request. 695func (client ServicesClient) ListPreparer(ctx context.Context, filter string, serviceType string, skipCount *int32, takeCount *int32) (*http.Request, error) { 696 const APIVersion = "2014-01-01" 697 queryParameters := map[string]interface{}{ 698 "api-version": APIVersion, 699 } 700 if len(filter) > 0 { 701 queryParameters["$filter"] = autorest.Encode("query", filter) 702 } 703 if len(serviceType) > 0 { 704 queryParameters["serviceType"] = autorest.Encode("query", serviceType) 705 } 706 if skipCount != nil { 707 queryParameters["skipCount"] = autorest.Encode("query", *skipCount) 708 } 709 if takeCount != nil { 710 queryParameters["takeCount"] = autorest.Encode("query", *takeCount) 711 } 712 713 preparer := autorest.CreatePreparer( 714 autorest.AsGet(), 715 autorest.WithBaseURL(client.BaseURI), 716 autorest.WithPath("/providers/Microsoft.ADHybridHealthService/services"), 717 autorest.WithQueryParameters(queryParameters)) 718 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 719} 720 721// ListSender sends the List request. The method will close the 722// http.Response Body if it receives an error. 723func (client ServicesClient) ListSender(req *http.Request) (*http.Response, error) { 724 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 725} 726 727// ListResponder handles the response to the List request. The method always 728// closes the http.Response Body. 729func (client ServicesClient) ListResponder(resp *http.Response) (result Services, err error) { 730 err = autorest.Respond( 731 resp, 732 azure.WithErrorUnlessStatusCode(http.StatusOK), 733 autorest.ByUnmarshallingJSON(&result), 734 autorest.ByClosing()) 735 result.Response = autorest.Response{Response: resp} 736 return 737} 738 739// listNextResults retrieves the next set of results, if any. 740func (client ServicesClient) listNextResults(ctx context.Context, lastResults Services) (result Services, err error) { 741 req, err := lastResults.servicesPreparer(ctx) 742 if err != nil { 743 return result, autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "listNextResults", nil, "Failure preparing next results request") 744 } 745 if req == nil { 746 return 747 } 748 resp, err := client.ListSender(req) 749 if err != nil { 750 result.Response = autorest.Response{Response: resp} 751 return result, autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "listNextResults", resp, "Failure sending next results request") 752 } 753 result, err = client.ListResponder(resp) 754 if err != nil { 755 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "listNextResults", resp, "Failure responding to next results request") 756 } 757 return 758} 759 760// ListComplete enumerates all values, automatically crossing page boundaries as required. 761func (client ServicesClient) ListComplete(ctx context.Context, filter string, serviceType string, skipCount *int32, takeCount *int32) (result ServicesIterator, err error) { 762 if tracing.IsEnabled() { 763 ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.List") 764 defer func() { 765 sc := -1 766 if result.Response().Response.Response != nil { 767 sc = result.page.Response().Response.Response.StatusCode 768 } 769 tracing.EndSpan(ctx, sc, err) 770 }() 771 } 772 result.page, err = client.List(ctx, filter, serviceType, skipCount, takeCount) 773 return 774} 775 776// ListAlertFeedback gets a list of all alert feedback for a given tenant and alert type. 777// Parameters: 778// serviceName - the name of the service. 779// shortName - the name of the alert. 780func (client ServicesClient) ListAlertFeedback(ctx context.Context, serviceName string, shortName string) (result AlertFeedbacks, err error) { 781 if tracing.IsEnabled() { 782 ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.ListAlertFeedback") 783 defer func() { 784 sc := -1 785 if result.Response.Response != nil { 786 sc = result.Response.Response.StatusCode 787 } 788 tracing.EndSpan(ctx, sc, err) 789 }() 790 } 791 req, err := client.ListAlertFeedbackPreparer(ctx, serviceName, shortName) 792 if err != nil { 793 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "ListAlertFeedback", nil, "Failure preparing request") 794 return 795 } 796 797 resp, err := client.ListAlertFeedbackSender(req) 798 if err != nil { 799 result.Response = autorest.Response{Response: resp} 800 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "ListAlertFeedback", resp, "Failure sending request") 801 return 802 } 803 804 result, err = client.ListAlertFeedbackResponder(resp) 805 if err != nil { 806 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "ListAlertFeedback", resp, "Failure responding to request") 807 return 808 } 809 810 return 811} 812 813// ListAlertFeedbackPreparer prepares the ListAlertFeedback request. 814func (client ServicesClient) ListAlertFeedbackPreparer(ctx context.Context, serviceName string, shortName string) (*http.Request, error) { 815 pathParameters := map[string]interface{}{ 816 "serviceName": autorest.Encode("path", serviceName), 817 "shortName": autorest.Encode("path", shortName), 818 } 819 820 const APIVersion = "2014-01-01" 821 queryParameters := map[string]interface{}{ 822 "api-version": APIVersion, 823 } 824 825 preparer := autorest.CreatePreparer( 826 autorest.AsGet(), 827 autorest.WithBaseURL(client.BaseURI), 828 autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/services/{serviceName}/feedbacktype/alerts/{shortName}/alertfeedback", pathParameters), 829 autorest.WithQueryParameters(queryParameters)) 830 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 831} 832 833// ListAlertFeedbackSender sends the ListAlertFeedback request. The method will close the 834// http.Response Body if it receives an error. 835func (client ServicesClient) ListAlertFeedbackSender(req *http.Request) (*http.Response, error) { 836 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 837} 838 839// ListAlertFeedbackResponder handles the response to the ListAlertFeedback request. The method always 840// closes the http.Response Body. 841func (client ServicesClient) ListAlertFeedbackResponder(resp *http.Response) (result AlertFeedbacks, err error) { 842 err = autorest.Respond( 843 resp, 844 azure.WithErrorUnlessStatusCode(http.StatusOK), 845 autorest.ByUnmarshallingJSON(&result), 846 autorest.ByClosing()) 847 result.Response = autorest.Response{Response: resp} 848 return 849} 850 851// ListAlerts gets the alerts for a given service. 852// Parameters: 853// serviceName - the name of the service. 854// filter - the alert property filter to apply. 855// state - the alert state to query for. 856// from - the start date to query for. 857// toParameter - the end date till when to query for. 858func (client ServicesClient) ListAlerts(ctx context.Context, serviceName string, filter string, state string, from *date.Time, toParameter *date.Time) (result AlertsPage, err error) { 859 if tracing.IsEnabled() { 860 ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.ListAlerts") 861 defer func() { 862 sc := -1 863 if result.a.Response.Response != nil { 864 sc = result.a.Response.Response.StatusCode 865 } 866 tracing.EndSpan(ctx, sc, err) 867 }() 868 } 869 result.fn = client.listAlertsNextResults 870 req, err := client.ListAlertsPreparer(ctx, serviceName, filter, state, from, toParameter) 871 if err != nil { 872 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "ListAlerts", nil, "Failure preparing request") 873 return 874 } 875 876 resp, err := client.ListAlertsSender(req) 877 if err != nil { 878 result.a.Response = autorest.Response{Response: resp} 879 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "ListAlerts", resp, "Failure sending request") 880 return 881 } 882 883 result.a, err = client.ListAlertsResponder(resp) 884 if err != nil { 885 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "ListAlerts", resp, "Failure responding to request") 886 return 887 } 888 if result.a.hasNextLink() && result.a.IsEmpty() { 889 err = result.NextWithContext(ctx) 890 return 891 } 892 893 return 894} 895 896// ListAlertsPreparer prepares the ListAlerts request. 897func (client ServicesClient) ListAlertsPreparer(ctx context.Context, serviceName string, filter string, state string, from *date.Time, toParameter *date.Time) (*http.Request, error) { 898 pathParameters := map[string]interface{}{ 899 "serviceName": autorest.Encode("path", serviceName), 900 } 901 902 const APIVersion = "2014-01-01" 903 queryParameters := map[string]interface{}{ 904 "api-version": APIVersion, 905 } 906 if len(filter) > 0 { 907 queryParameters["$filter"] = autorest.Encode("query", filter) 908 } 909 if len(state) > 0 { 910 queryParameters["state"] = autorest.Encode("query", state) 911 } 912 if from != nil { 913 queryParameters["from"] = autorest.Encode("query", *from) 914 } 915 if toParameter != nil { 916 queryParameters["to"] = autorest.Encode("query", *toParameter) 917 } 918 919 preparer := autorest.CreatePreparer( 920 autorest.AsGet(), 921 autorest.WithBaseURL(client.BaseURI), 922 autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/services/{serviceName}/alerts", pathParameters), 923 autorest.WithQueryParameters(queryParameters)) 924 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 925} 926 927// ListAlertsSender sends the ListAlerts request. The method will close the 928// http.Response Body if it receives an error. 929func (client ServicesClient) ListAlertsSender(req *http.Request) (*http.Response, error) { 930 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 931} 932 933// ListAlertsResponder handles the response to the ListAlerts request. The method always 934// closes the http.Response Body. 935func (client ServicesClient) ListAlertsResponder(resp *http.Response) (result Alerts, err error) { 936 err = autorest.Respond( 937 resp, 938 azure.WithErrorUnlessStatusCode(http.StatusOK), 939 autorest.ByUnmarshallingJSON(&result), 940 autorest.ByClosing()) 941 result.Response = autorest.Response{Response: resp} 942 return 943} 944 945// listAlertsNextResults retrieves the next set of results, if any. 946func (client ServicesClient) listAlertsNextResults(ctx context.Context, lastResults Alerts) (result Alerts, err error) { 947 req, err := lastResults.alertsPreparer(ctx) 948 if err != nil { 949 return result, autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "listAlertsNextResults", nil, "Failure preparing next results request") 950 } 951 if req == nil { 952 return 953 } 954 resp, err := client.ListAlertsSender(req) 955 if err != nil { 956 result.Response = autorest.Response{Response: resp} 957 return result, autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "listAlertsNextResults", resp, "Failure sending next results request") 958 } 959 result, err = client.ListAlertsResponder(resp) 960 if err != nil { 961 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "listAlertsNextResults", resp, "Failure responding to next results request") 962 } 963 return 964} 965 966// ListAlertsComplete enumerates all values, automatically crossing page boundaries as required. 967func (client ServicesClient) ListAlertsComplete(ctx context.Context, serviceName string, filter string, state string, from *date.Time, toParameter *date.Time) (result AlertsIterator, err error) { 968 if tracing.IsEnabled() { 969 ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.ListAlerts") 970 defer func() { 971 sc := -1 972 if result.Response().Response.Response != nil { 973 sc = result.page.Response().Response.Response.StatusCode 974 } 975 tracing.EndSpan(ctx, sc, err) 976 }() 977 } 978 result.page, err = client.ListAlerts(ctx, serviceName, filter, state, from, toParameter) 979 return 980} 981 982// ListAllRiskyIPDownloadReport gets all Risky IP report URIs for the last 7 days. 983// Parameters: 984// serviceName - the name of the service. 985func (client ServicesClient) ListAllRiskyIPDownloadReport(ctx context.Context, serviceName string) (result RiskyIPBlobUris, err error) { 986 if tracing.IsEnabled() { 987 ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.ListAllRiskyIPDownloadReport") 988 defer func() { 989 sc := -1 990 if result.Response.Response != nil { 991 sc = result.Response.Response.StatusCode 992 } 993 tracing.EndSpan(ctx, sc, err) 994 }() 995 } 996 req, err := client.ListAllRiskyIPDownloadReportPreparer(ctx, serviceName) 997 if err != nil { 998 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "ListAllRiskyIPDownloadReport", nil, "Failure preparing request") 999 return 1000 } 1001 1002 resp, err := client.ListAllRiskyIPDownloadReportSender(req) 1003 if err != nil { 1004 result.Response = autorest.Response{Response: resp} 1005 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "ListAllRiskyIPDownloadReport", resp, "Failure sending request") 1006 return 1007 } 1008 1009 result, err = client.ListAllRiskyIPDownloadReportResponder(resp) 1010 if err != nil { 1011 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "ListAllRiskyIPDownloadReport", resp, "Failure responding to request") 1012 return 1013 } 1014 1015 return 1016} 1017 1018// ListAllRiskyIPDownloadReportPreparer prepares the ListAllRiskyIPDownloadReport request. 1019func (client ServicesClient) ListAllRiskyIPDownloadReportPreparer(ctx context.Context, serviceName string) (*http.Request, error) { 1020 pathParameters := map[string]interface{}{ 1021 "serviceName": autorest.Encode("path", serviceName), 1022 } 1023 1024 const APIVersion = "2014-01-01" 1025 queryParameters := map[string]interface{}{ 1026 "api-version": APIVersion, 1027 } 1028 1029 preparer := autorest.CreatePreparer( 1030 autorest.AsGet(), 1031 autorest.WithBaseURL(client.BaseURI), 1032 autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/services/{serviceName}/reports/riskyIp/blobUris", pathParameters), 1033 autorest.WithQueryParameters(queryParameters)) 1034 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 1035} 1036 1037// ListAllRiskyIPDownloadReportSender sends the ListAllRiskyIPDownloadReport request. The method will close the 1038// http.Response Body if it receives an error. 1039func (client ServicesClient) ListAllRiskyIPDownloadReportSender(req *http.Request) (*http.Response, error) { 1040 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1041} 1042 1043// ListAllRiskyIPDownloadReportResponder handles the response to the ListAllRiskyIPDownloadReport request. The method always 1044// closes the http.Response Body. 1045func (client ServicesClient) ListAllRiskyIPDownloadReportResponder(resp *http.Response) (result RiskyIPBlobUris, err error) { 1046 err = autorest.Respond( 1047 resp, 1048 azure.WithErrorUnlessStatusCode(http.StatusOK), 1049 autorest.ByUnmarshallingJSON(&result), 1050 autorest.ByClosing()) 1051 result.Response = autorest.Response{Response: resp} 1052 return 1053} 1054 1055// ListCurrentRiskyIPDownloadReport initiate the generation of a new Risky IP report. Returns the URI for the new one. 1056// Parameters: 1057// serviceName - the name of the service. 1058func (client ServicesClient) ListCurrentRiskyIPDownloadReport(ctx context.Context, serviceName string) (result RiskyIPBlobUris, err error) { 1059 if tracing.IsEnabled() { 1060 ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.ListCurrentRiskyIPDownloadReport") 1061 defer func() { 1062 sc := -1 1063 if result.Response.Response != nil { 1064 sc = result.Response.Response.StatusCode 1065 } 1066 tracing.EndSpan(ctx, sc, err) 1067 }() 1068 } 1069 req, err := client.ListCurrentRiskyIPDownloadReportPreparer(ctx, serviceName) 1070 if err != nil { 1071 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "ListCurrentRiskyIPDownloadReport", nil, "Failure preparing request") 1072 return 1073 } 1074 1075 resp, err := client.ListCurrentRiskyIPDownloadReportSender(req) 1076 if err != nil { 1077 result.Response = autorest.Response{Response: resp} 1078 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "ListCurrentRiskyIPDownloadReport", resp, "Failure sending request") 1079 return 1080 } 1081 1082 result, err = client.ListCurrentRiskyIPDownloadReportResponder(resp) 1083 if err != nil { 1084 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "ListCurrentRiskyIPDownloadReport", resp, "Failure responding to request") 1085 return 1086 } 1087 1088 return 1089} 1090 1091// ListCurrentRiskyIPDownloadReportPreparer prepares the ListCurrentRiskyIPDownloadReport request. 1092func (client ServicesClient) ListCurrentRiskyIPDownloadReportPreparer(ctx context.Context, serviceName string) (*http.Request, error) { 1093 pathParameters := map[string]interface{}{ 1094 "serviceName": autorest.Encode("path", serviceName), 1095 } 1096 1097 const APIVersion = "2014-01-01" 1098 queryParameters := map[string]interface{}{ 1099 "api-version": APIVersion, 1100 } 1101 1102 preparer := autorest.CreatePreparer( 1103 autorest.AsPost(), 1104 autorest.WithBaseURL(client.BaseURI), 1105 autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/services/{serviceName}/reports/riskyIp/generateBlobUri", pathParameters), 1106 autorest.WithQueryParameters(queryParameters)) 1107 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 1108} 1109 1110// ListCurrentRiskyIPDownloadReportSender sends the ListCurrentRiskyIPDownloadReport request. The method will close the 1111// http.Response Body if it receives an error. 1112func (client ServicesClient) ListCurrentRiskyIPDownloadReportSender(req *http.Request) (*http.Response, error) { 1113 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1114} 1115 1116// ListCurrentRiskyIPDownloadReportResponder handles the response to the ListCurrentRiskyIPDownloadReport request. The method always 1117// closes the http.Response Body. 1118func (client ServicesClient) ListCurrentRiskyIPDownloadReportResponder(resp *http.Response) (result RiskyIPBlobUris, err error) { 1119 err = autorest.Respond( 1120 resp, 1121 azure.WithErrorUnlessStatusCode(http.StatusOK), 1122 autorest.ByUnmarshallingJSON(&result), 1123 autorest.ByClosing()) 1124 result.Response = autorest.Response{Response: resp} 1125 return 1126} 1127 1128// ListExportErrors gets the count of latest AAD export errors. 1129// Parameters: 1130// serviceName - the name of the service. 1131func (client ServicesClient) ListExportErrors(ctx context.Context, serviceName string) (result ErrorCounts, err error) { 1132 if tracing.IsEnabled() { 1133 ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.ListExportErrors") 1134 defer func() { 1135 sc := -1 1136 if result.Response.Response != nil { 1137 sc = result.Response.Response.StatusCode 1138 } 1139 tracing.EndSpan(ctx, sc, err) 1140 }() 1141 } 1142 req, err := client.ListExportErrorsPreparer(ctx, serviceName) 1143 if err != nil { 1144 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "ListExportErrors", nil, "Failure preparing request") 1145 return 1146 } 1147 1148 resp, err := client.ListExportErrorsSender(req) 1149 if err != nil { 1150 result.Response = autorest.Response{Response: resp} 1151 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "ListExportErrors", resp, "Failure sending request") 1152 return 1153 } 1154 1155 result, err = client.ListExportErrorsResponder(resp) 1156 if err != nil { 1157 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "ListExportErrors", resp, "Failure responding to request") 1158 return 1159 } 1160 1161 return 1162} 1163 1164// ListExportErrorsPreparer prepares the ListExportErrors request. 1165func (client ServicesClient) ListExportErrorsPreparer(ctx context.Context, serviceName string) (*http.Request, error) { 1166 pathParameters := map[string]interface{}{ 1167 "serviceName": autorest.Encode("path", serviceName), 1168 } 1169 1170 const APIVersion = "2014-01-01" 1171 queryParameters := map[string]interface{}{ 1172 "api-version": APIVersion, 1173 } 1174 1175 preparer := autorest.CreatePreparer( 1176 autorest.AsGet(), 1177 autorest.WithBaseURL(client.BaseURI), 1178 autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/services/{serviceName}/exporterrors/counts", pathParameters), 1179 autorest.WithQueryParameters(queryParameters)) 1180 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 1181} 1182 1183// ListExportErrorsSender sends the ListExportErrors request. The method will close the 1184// http.Response Body if it receives an error. 1185func (client ServicesClient) ListExportErrorsSender(req *http.Request) (*http.Response, error) { 1186 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1187} 1188 1189// ListExportErrorsResponder handles the response to the ListExportErrors request. The method always 1190// closes the http.Response Body. 1191func (client ServicesClient) ListExportErrorsResponder(resp *http.Response) (result ErrorCounts, err error) { 1192 err = autorest.Respond( 1193 resp, 1194 azure.WithErrorUnlessStatusCode(http.StatusOK), 1195 autorest.ByUnmarshallingJSON(&result), 1196 autorest.ByClosing()) 1197 result.Response = autorest.Response{Response: resp} 1198 return 1199} 1200 1201// ListExportErrorsV2 gets the categorized export errors. 1202// Parameters: 1203// serviceName - the name of the service. 1204// errorBucket - the error category to query for. 1205func (client ServicesClient) ListExportErrorsV2(ctx context.Context, serviceName string, errorBucket string) (result MergedExportErrors, err error) { 1206 if tracing.IsEnabled() { 1207 ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.ListExportErrorsV2") 1208 defer func() { 1209 sc := -1 1210 if result.Response.Response != nil { 1211 sc = result.Response.Response.StatusCode 1212 } 1213 tracing.EndSpan(ctx, sc, err) 1214 }() 1215 } 1216 req, err := client.ListExportErrorsV2Preparer(ctx, serviceName, errorBucket) 1217 if err != nil { 1218 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "ListExportErrorsV2", nil, "Failure preparing request") 1219 return 1220 } 1221 1222 resp, err := client.ListExportErrorsV2Sender(req) 1223 if err != nil { 1224 result.Response = autorest.Response{Response: resp} 1225 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "ListExportErrorsV2", resp, "Failure sending request") 1226 return 1227 } 1228 1229 result, err = client.ListExportErrorsV2Responder(resp) 1230 if err != nil { 1231 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "ListExportErrorsV2", resp, "Failure responding to request") 1232 return 1233 } 1234 1235 return 1236} 1237 1238// ListExportErrorsV2Preparer prepares the ListExportErrorsV2 request. 1239func (client ServicesClient) ListExportErrorsV2Preparer(ctx context.Context, serviceName string, errorBucket string) (*http.Request, error) { 1240 pathParameters := map[string]interface{}{ 1241 "serviceName": autorest.Encode("path", serviceName), 1242 } 1243 1244 const APIVersion = "2014-01-01" 1245 queryParameters := map[string]interface{}{ 1246 "api-version": APIVersion, 1247 "errorBucket": autorest.Encode("query", errorBucket), 1248 } 1249 1250 preparer := autorest.CreatePreparer( 1251 autorest.AsGet(), 1252 autorest.WithBaseURL(client.BaseURI), 1253 autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/services/{serviceName}/exporterrors/listV2", pathParameters), 1254 autorest.WithQueryParameters(queryParameters)) 1255 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 1256} 1257 1258// ListExportErrorsV2Sender sends the ListExportErrorsV2 request. The method will close the 1259// http.Response Body if it receives an error. 1260func (client ServicesClient) ListExportErrorsV2Sender(req *http.Request) (*http.Response, error) { 1261 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1262} 1263 1264// ListExportErrorsV2Responder handles the response to the ListExportErrorsV2 request. The method always 1265// closes the http.Response Body. 1266func (client ServicesClient) ListExportErrorsV2Responder(resp *http.Response) (result MergedExportErrors, err error) { 1267 err = autorest.Respond( 1268 resp, 1269 azure.WithErrorUnlessStatusCode(http.StatusOK), 1270 autorest.ByUnmarshallingJSON(&result), 1271 autorest.ByClosing()) 1272 result.Response = autorest.Response{Response: resp} 1273 return 1274} 1275 1276// ListExportStatus gets the export status. 1277// Parameters: 1278// serviceName - the name of the service. 1279func (client ServicesClient) ListExportStatus(ctx context.Context, serviceName string) (result ExportStatusesPage, err error) { 1280 if tracing.IsEnabled() { 1281 ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.ListExportStatus") 1282 defer func() { 1283 sc := -1 1284 if result.es.Response.Response != nil { 1285 sc = result.es.Response.Response.StatusCode 1286 } 1287 tracing.EndSpan(ctx, sc, err) 1288 }() 1289 } 1290 result.fn = client.listExportStatusNextResults 1291 req, err := client.ListExportStatusPreparer(ctx, serviceName) 1292 if err != nil { 1293 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "ListExportStatus", nil, "Failure preparing request") 1294 return 1295 } 1296 1297 resp, err := client.ListExportStatusSender(req) 1298 if err != nil { 1299 result.es.Response = autorest.Response{Response: resp} 1300 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "ListExportStatus", resp, "Failure sending request") 1301 return 1302 } 1303 1304 result.es, err = client.ListExportStatusResponder(resp) 1305 if err != nil { 1306 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "ListExportStatus", resp, "Failure responding to request") 1307 return 1308 } 1309 if result.es.hasNextLink() && result.es.IsEmpty() { 1310 err = result.NextWithContext(ctx) 1311 return 1312 } 1313 1314 return 1315} 1316 1317// ListExportStatusPreparer prepares the ListExportStatus request. 1318func (client ServicesClient) ListExportStatusPreparer(ctx context.Context, serviceName string) (*http.Request, error) { 1319 pathParameters := map[string]interface{}{ 1320 "serviceName": autorest.Encode("path", serviceName), 1321 } 1322 1323 const APIVersion = "2014-01-01" 1324 queryParameters := map[string]interface{}{ 1325 "api-version": APIVersion, 1326 } 1327 1328 preparer := autorest.CreatePreparer( 1329 autorest.AsGet(), 1330 autorest.WithBaseURL(client.BaseURI), 1331 autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/services/{serviceName}/exportstatus", pathParameters), 1332 autorest.WithQueryParameters(queryParameters)) 1333 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 1334} 1335 1336// ListExportStatusSender sends the ListExportStatus request. The method will close the 1337// http.Response Body if it receives an error. 1338func (client ServicesClient) ListExportStatusSender(req *http.Request) (*http.Response, error) { 1339 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1340} 1341 1342// ListExportStatusResponder handles the response to the ListExportStatus request. The method always 1343// closes the http.Response Body. 1344func (client ServicesClient) ListExportStatusResponder(resp *http.Response) (result ExportStatuses, err error) { 1345 err = autorest.Respond( 1346 resp, 1347 azure.WithErrorUnlessStatusCode(http.StatusOK), 1348 autorest.ByUnmarshallingJSON(&result), 1349 autorest.ByClosing()) 1350 result.Response = autorest.Response{Response: resp} 1351 return 1352} 1353 1354// listExportStatusNextResults retrieves the next set of results, if any. 1355func (client ServicesClient) listExportStatusNextResults(ctx context.Context, lastResults ExportStatuses) (result ExportStatuses, err error) { 1356 req, err := lastResults.exportStatusesPreparer(ctx) 1357 if err != nil { 1358 return result, autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "listExportStatusNextResults", nil, "Failure preparing next results request") 1359 } 1360 if req == nil { 1361 return 1362 } 1363 resp, err := client.ListExportStatusSender(req) 1364 if err != nil { 1365 result.Response = autorest.Response{Response: resp} 1366 return result, autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "listExportStatusNextResults", resp, "Failure sending next results request") 1367 } 1368 result, err = client.ListExportStatusResponder(resp) 1369 if err != nil { 1370 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "listExportStatusNextResults", resp, "Failure responding to next results request") 1371 } 1372 return 1373} 1374 1375// ListExportStatusComplete enumerates all values, automatically crossing page boundaries as required. 1376func (client ServicesClient) ListExportStatusComplete(ctx context.Context, serviceName string) (result ExportStatusesIterator, err error) { 1377 if tracing.IsEnabled() { 1378 ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.ListExportStatus") 1379 defer func() { 1380 sc := -1 1381 if result.Response().Response.Response != nil { 1382 sc = result.page.Response().Response.Response.StatusCode 1383 } 1384 tracing.EndSpan(ctx, sc, err) 1385 }() 1386 } 1387 result.page, err = client.ListExportStatus(ctx, serviceName) 1388 return 1389} 1390 1391// ListMetricMetadata gets the service related metrics information. 1392// Parameters: 1393// serviceName - the name of the service. 1394// filter - the metric metadata property filter to apply. 1395// perfCounter - indicates if only performance counter metrics are requested. 1396func (client ServicesClient) ListMetricMetadata(ctx context.Context, serviceName string, filter string, perfCounter *bool) (result MetricMetadataListPage, err error) { 1397 if tracing.IsEnabled() { 1398 ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.ListMetricMetadata") 1399 defer func() { 1400 sc := -1 1401 if result.mml.Response.Response != nil { 1402 sc = result.mml.Response.Response.StatusCode 1403 } 1404 tracing.EndSpan(ctx, sc, err) 1405 }() 1406 } 1407 result.fn = client.listMetricMetadataNextResults 1408 req, err := client.ListMetricMetadataPreparer(ctx, serviceName, filter, perfCounter) 1409 if err != nil { 1410 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "ListMetricMetadata", nil, "Failure preparing request") 1411 return 1412 } 1413 1414 resp, err := client.ListMetricMetadataSender(req) 1415 if err != nil { 1416 result.mml.Response = autorest.Response{Response: resp} 1417 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "ListMetricMetadata", resp, "Failure sending request") 1418 return 1419 } 1420 1421 result.mml, err = client.ListMetricMetadataResponder(resp) 1422 if err != nil { 1423 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "ListMetricMetadata", resp, "Failure responding to request") 1424 return 1425 } 1426 if result.mml.hasNextLink() && result.mml.IsEmpty() { 1427 err = result.NextWithContext(ctx) 1428 return 1429 } 1430 1431 return 1432} 1433 1434// ListMetricMetadataPreparer prepares the ListMetricMetadata request. 1435func (client ServicesClient) ListMetricMetadataPreparer(ctx context.Context, serviceName string, filter string, perfCounter *bool) (*http.Request, error) { 1436 pathParameters := map[string]interface{}{ 1437 "serviceName": autorest.Encode("path", serviceName), 1438 } 1439 1440 const APIVersion = "2014-01-01" 1441 queryParameters := map[string]interface{}{ 1442 "api-version": APIVersion, 1443 } 1444 if len(filter) > 0 { 1445 queryParameters["$filter"] = autorest.Encode("query", filter) 1446 } 1447 if perfCounter != nil { 1448 queryParameters["perfCounter"] = autorest.Encode("query", *perfCounter) 1449 } 1450 1451 preparer := autorest.CreatePreparer( 1452 autorest.AsGet(), 1453 autorest.WithBaseURL(client.BaseURI), 1454 autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/services/{serviceName}/metricmetadata", pathParameters), 1455 autorest.WithQueryParameters(queryParameters)) 1456 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 1457} 1458 1459// ListMetricMetadataSender sends the ListMetricMetadata request. The method will close the 1460// http.Response Body if it receives an error. 1461func (client ServicesClient) ListMetricMetadataSender(req *http.Request) (*http.Response, error) { 1462 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1463} 1464 1465// ListMetricMetadataResponder handles the response to the ListMetricMetadata request. The method always 1466// closes the http.Response Body. 1467func (client ServicesClient) ListMetricMetadataResponder(resp *http.Response) (result MetricMetadataList, err error) { 1468 err = autorest.Respond( 1469 resp, 1470 azure.WithErrorUnlessStatusCode(http.StatusOK), 1471 autorest.ByUnmarshallingJSON(&result), 1472 autorest.ByClosing()) 1473 result.Response = autorest.Response{Response: resp} 1474 return 1475} 1476 1477// listMetricMetadataNextResults retrieves the next set of results, if any. 1478func (client ServicesClient) listMetricMetadataNextResults(ctx context.Context, lastResults MetricMetadataList) (result MetricMetadataList, err error) { 1479 req, err := lastResults.metricMetadataListPreparer(ctx) 1480 if err != nil { 1481 return result, autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "listMetricMetadataNextResults", nil, "Failure preparing next results request") 1482 } 1483 if req == nil { 1484 return 1485 } 1486 resp, err := client.ListMetricMetadataSender(req) 1487 if err != nil { 1488 result.Response = autorest.Response{Response: resp} 1489 return result, autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "listMetricMetadataNextResults", resp, "Failure sending next results request") 1490 } 1491 result, err = client.ListMetricMetadataResponder(resp) 1492 if err != nil { 1493 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "listMetricMetadataNextResults", resp, "Failure responding to next results request") 1494 } 1495 return 1496} 1497 1498// ListMetricMetadataComplete enumerates all values, automatically crossing page boundaries as required. 1499func (client ServicesClient) ListMetricMetadataComplete(ctx context.Context, serviceName string, filter string, perfCounter *bool) (result MetricMetadataListIterator, err error) { 1500 if tracing.IsEnabled() { 1501 ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.ListMetricMetadata") 1502 defer func() { 1503 sc := -1 1504 if result.Response().Response.Response != nil { 1505 sc = result.page.Response().Response.Response.StatusCode 1506 } 1507 tracing.EndSpan(ctx, sc, err) 1508 }() 1509 } 1510 result.page, err = client.ListMetricMetadata(ctx, serviceName, filter, perfCounter) 1511 return 1512} 1513 1514// ListMetricsAverage gets the average of the metric values for a given metric and group combination. 1515// Parameters: 1516// serviceName - the name of the service. 1517// metricName - the metric name 1518// groupName - the group name 1519func (client ServicesClient) ListMetricsAverage(ctx context.Context, serviceName string, metricName string, groupName string) (result MetricsPage, err error) { 1520 if tracing.IsEnabled() { 1521 ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.ListMetricsAverage") 1522 defer func() { 1523 sc := -1 1524 if result.mVar.Response.Response != nil { 1525 sc = result.mVar.Response.Response.StatusCode 1526 } 1527 tracing.EndSpan(ctx, sc, err) 1528 }() 1529 } 1530 result.fn = client.listMetricsAverageNextResults 1531 req, err := client.ListMetricsAveragePreparer(ctx, serviceName, metricName, groupName) 1532 if err != nil { 1533 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "ListMetricsAverage", nil, "Failure preparing request") 1534 return 1535 } 1536 1537 resp, err := client.ListMetricsAverageSender(req) 1538 if err != nil { 1539 result.mVar.Response = autorest.Response{Response: resp} 1540 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "ListMetricsAverage", resp, "Failure sending request") 1541 return 1542 } 1543 1544 result.mVar, err = client.ListMetricsAverageResponder(resp) 1545 if err != nil { 1546 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "ListMetricsAverage", resp, "Failure responding to request") 1547 return 1548 } 1549 if result.mVar.hasNextLink() && result.mVar.IsEmpty() { 1550 err = result.NextWithContext(ctx) 1551 return 1552 } 1553 1554 return 1555} 1556 1557// ListMetricsAveragePreparer prepares the ListMetricsAverage request. 1558func (client ServicesClient) ListMetricsAveragePreparer(ctx context.Context, serviceName string, metricName string, groupName string) (*http.Request, error) { 1559 pathParameters := map[string]interface{}{ 1560 "groupName": autorest.Encode("path", groupName), 1561 "metricName": autorest.Encode("path", metricName), 1562 "serviceName": autorest.Encode("path", serviceName), 1563 } 1564 1565 const APIVersion = "2014-01-01" 1566 queryParameters := map[string]interface{}{ 1567 "api-version": APIVersion, 1568 } 1569 1570 preparer := autorest.CreatePreparer( 1571 autorest.AsGet(), 1572 autorest.WithBaseURL(client.BaseURI), 1573 autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/services/{serviceName}/metrics/{metricName}/groups/{groupName}/average", pathParameters), 1574 autorest.WithQueryParameters(queryParameters)) 1575 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 1576} 1577 1578// ListMetricsAverageSender sends the ListMetricsAverage request. The method will close the 1579// http.Response Body if it receives an error. 1580func (client ServicesClient) ListMetricsAverageSender(req *http.Request) (*http.Response, error) { 1581 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1582} 1583 1584// ListMetricsAverageResponder handles the response to the ListMetricsAverage request. The method always 1585// closes the http.Response Body. 1586func (client ServicesClient) ListMetricsAverageResponder(resp *http.Response) (result Metrics, err error) { 1587 err = autorest.Respond( 1588 resp, 1589 azure.WithErrorUnlessStatusCode(http.StatusOK), 1590 autorest.ByUnmarshallingJSON(&result), 1591 autorest.ByClosing()) 1592 result.Response = autorest.Response{Response: resp} 1593 return 1594} 1595 1596// listMetricsAverageNextResults retrieves the next set of results, if any. 1597func (client ServicesClient) listMetricsAverageNextResults(ctx context.Context, lastResults Metrics) (result Metrics, err error) { 1598 req, err := lastResults.metricsPreparer(ctx) 1599 if err != nil { 1600 return result, autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "listMetricsAverageNextResults", nil, "Failure preparing next results request") 1601 } 1602 if req == nil { 1603 return 1604 } 1605 resp, err := client.ListMetricsAverageSender(req) 1606 if err != nil { 1607 result.Response = autorest.Response{Response: resp} 1608 return result, autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "listMetricsAverageNextResults", resp, "Failure sending next results request") 1609 } 1610 result, err = client.ListMetricsAverageResponder(resp) 1611 if err != nil { 1612 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "listMetricsAverageNextResults", resp, "Failure responding to next results request") 1613 } 1614 return 1615} 1616 1617// ListMetricsAverageComplete enumerates all values, automatically crossing page boundaries as required. 1618func (client ServicesClient) ListMetricsAverageComplete(ctx context.Context, serviceName string, metricName string, groupName string) (result MetricsIterator, err error) { 1619 if tracing.IsEnabled() { 1620 ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.ListMetricsAverage") 1621 defer func() { 1622 sc := -1 1623 if result.Response().Response.Response != nil { 1624 sc = result.page.Response().Response.Response.StatusCode 1625 } 1626 tracing.EndSpan(ctx, sc, err) 1627 }() 1628 } 1629 result.page, err = client.ListMetricsAverage(ctx, serviceName, metricName, groupName) 1630 return 1631} 1632 1633// ListMetricsSum gets the sum of the metric values for a given metric and group combination. 1634// Parameters: 1635// serviceName - the name of the service. 1636// metricName - the metric name 1637// groupName - the group name 1638func (client ServicesClient) ListMetricsSum(ctx context.Context, serviceName string, metricName string, groupName string) (result MetricsPage, err error) { 1639 if tracing.IsEnabled() { 1640 ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.ListMetricsSum") 1641 defer func() { 1642 sc := -1 1643 if result.mVar.Response.Response != nil { 1644 sc = result.mVar.Response.Response.StatusCode 1645 } 1646 tracing.EndSpan(ctx, sc, err) 1647 }() 1648 } 1649 result.fn = client.listMetricsSumNextResults 1650 req, err := client.ListMetricsSumPreparer(ctx, serviceName, metricName, groupName) 1651 if err != nil { 1652 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "ListMetricsSum", nil, "Failure preparing request") 1653 return 1654 } 1655 1656 resp, err := client.ListMetricsSumSender(req) 1657 if err != nil { 1658 result.mVar.Response = autorest.Response{Response: resp} 1659 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "ListMetricsSum", resp, "Failure sending request") 1660 return 1661 } 1662 1663 result.mVar, err = client.ListMetricsSumResponder(resp) 1664 if err != nil { 1665 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "ListMetricsSum", resp, "Failure responding to request") 1666 return 1667 } 1668 if result.mVar.hasNextLink() && result.mVar.IsEmpty() { 1669 err = result.NextWithContext(ctx) 1670 return 1671 } 1672 1673 return 1674} 1675 1676// ListMetricsSumPreparer prepares the ListMetricsSum request. 1677func (client ServicesClient) ListMetricsSumPreparer(ctx context.Context, serviceName string, metricName string, groupName string) (*http.Request, error) { 1678 pathParameters := map[string]interface{}{ 1679 "groupName": autorest.Encode("path", groupName), 1680 "metricName": autorest.Encode("path", metricName), 1681 "serviceName": autorest.Encode("path", serviceName), 1682 } 1683 1684 const APIVersion = "2014-01-01" 1685 queryParameters := map[string]interface{}{ 1686 "api-version": APIVersion, 1687 } 1688 1689 preparer := autorest.CreatePreparer( 1690 autorest.AsGet(), 1691 autorest.WithBaseURL(client.BaseURI), 1692 autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/services/{serviceName}/metrics/{metricName}/groups/{groupName}/sum", pathParameters), 1693 autorest.WithQueryParameters(queryParameters)) 1694 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 1695} 1696 1697// ListMetricsSumSender sends the ListMetricsSum request. The method will close the 1698// http.Response Body if it receives an error. 1699func (client ServicesClient) ListMetricsSumSender(req *http.Request) (*http.Response, error) { 1700 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1701} 1702 1703// ListMetricsSumResponder handles the response to the ListMetricsSum request. The method always 1704// closes the http.Response Body. 1705func (client ServicesClient) ListMetricsSumResponder(resp *http.Response) (result Metrics, err error) { 1706 err = autorest.Respond( 1707 resp, 1708 azure.WithErrorUnlessStatusCode(http.StatusOK), 1709 autorest.ByUnmarshallingJSON(&result), 1710 autorest.ByClosing()) 1711 result.Response = autorest.Response{Response: resp} 1712 return 1713} 1714 1715// listMetricsSumNextResults retrieves the next set of results, if any. 1716func (client ServicesClient) listMetricsSumNextResults(ctx context.Context, lastResults Metrics) (result Metrics, err error) { 1717 req, err := lastResults.metricsPreparer(ctx) 1718 if err != nil { 1719 return result, autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "listMetricsSumNextResults", nil, "Failure preparing next results request") 1720 } 1721 if req == nil { 1722 return 1723 } 1724 resp, err := client.ListMetricsSumSender(req) 1725 if err != nil { 1726 result.Response = autorest.Response{Response: resp} 1727 return result, autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "listMetricsSumNextResults", resp, "Failure sending next results request") 1728 } 1729 result, err = client.ListMetricsSumResponder(resp) 1730 if err != nil { 1731 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "listMetricsSumNextResults", resp, "Failure responding to next results request") 1732 } 1733 return 1734} 1735 1736// ListMetricsSumComplete enumerates all values, automatically crossing page boundaries as required. 1737func (client ServicesClient) ListMetricsSumComplete(ctx context.Context, serviceName string, metricName string, groupName string) (result MetricsIterator, err error) { 1738 if tracing.IsEnabled() { 1739 ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.ListMetricsSum") 1740 defer func() { 1741 sc := -1 1742 if result.Response().Response.Response != nil { 1743 sc = result.page.Response().Response.Response.StatusCode 1744 } 1745 tracing.EndSpan(ctx, sc, err) 1746 }() 1747 } 1748 result.page, err = client.ListMetricsSum(ctx, serviceName, metricName, groupName) 1749 return 1750} 1751 1752// ListMonitoringConfigurations gets the service level monitoring configurations. 1753// Parameters: 1754// serviceName - the name of the service. 1755func (client ServicesClient) ListMonitoringConfigurations(ctx context.Context, serviceName string) (result Items, err error) { 1756 if tracing.IsEnabled() { 1757 ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.ListMonitoringConfigurations") 1758 defer func() { 1759 sc := -1 1760 if result.Response.Response != nil { 1761 sc = result.Response.Response.StatusCode 1762 } 1763 tracing.EndSpan(ctx, sc, err) 1764 }() 1765 } 1766 req, err := client.ListMonitoringConfigurationsPreparer(ctx, serviceName) 1767 if err != nil { 1768 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "ListMonitoringConfigurations", nil, "Failure preparing request") 1769 return 1770 } 1771 1772 resp, err := client.ListMonitoringConfigurationsSender(req) 1773 if err != nil { 1774 result.Response = autorest.Response{Response: resp} 1775 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "ListMonitoringConfigurations", resp, "Failure sending request") 1776 return 1777 } 1778 1779 result, err = client.ListMonitoringConfigurationsResponder(resp) 1780 if err != nil { 1781 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "ListMonitoringConfigurations", resp, "Failure responding to request") 1782 return 1783 } 1784 1785 return 1786} 1787 1788// ListMonitoringConfigurationsPreparer prepares the ListMonitoringConfigurations request. 1789func (client ServicesClient) ListMonitoringConfigurationsPreparer(ctx context.Context, serviceName string) (*http.Request, error) { 1790 pathParameters := map[string]interface{}{ 1791 "serviceName": autorest.Encode("path", serviceName), 1792 } 1793 1794 const APIVersion = "2014-01-01" 1795 queryParameters := map[string]interface{}{ 1796 "api-version": APIVersion, 1797 } 1798 1799 preparer := autorest.CreatePreparer( 1800 autorest.AsGet(), 1801 autorest.WithBaseURL(client.BaseURI), 1802 autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/services/{serviceName}/monitoringconfigurations", pathParameters), 1803 autorest.WithQueryParameters(queryParameters)) 1804 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 1805} 1806 1807// ListMonitoringConfigurationsSender sends the ListMonitoringConfigurations request. The method will close the 1808// http.Response Body if it receives an error. 1809func (client ServicesClient) ListMonitoringConfigurationsSender(req *http.Request) (*http.Response, error) { 1810 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1811} 1812 1813// ListMonitoringConfigurationsResponder handles the response to the ListMonitoringConfigurations request. The method always 1814// closes the http.Response Body. 1815func (client ServicesClient) ListMonitoringConfigurationsResponder(resp *http.Response) (result Items, err error) { 1816 err = autorest.Respond( 1817 resp, 1818 azure.WithErrorUnlessStatusCode(http.StatusOK), 1819 autorest.ByUnmarshallingJSON(&result), 1820 autorest.ByClosing()) 1821 result.Response = autorest.Response{Response: resp} 1822 return 1823} 1824 1825// ListPremium gets the details of services for a tenant having Azure AD Premium license and is onboarded to Azure 1826// Active Directory Connect Health. 1827// Parameters: 1828// filter - the service property filter to apply. 1829// serviceType - the service type for the services onboarded to Azure Active Directory Connect Health. 1830// Depending on whether the service is monitoring, ADFS, Sync or ADDS roles, the service type can either be 1831// AdFederationService or AadSyncService or AdDomainService. 1832// skipCount - the skip count, which specifies the number of elements that can be bypassed from a sequence and 1833// then return the remaining elements. 1834// takeCount - the take count , which specifies the number of elements that can be returned from a sequence. 1835func (client ServicesClient) ListPremium(ctx context.Context, filter string, serviceType string, skipCount *int32, takeCount *int32) (result ServicesPage, err error) { 1836 if tracing.IsEnabled() { 1837 ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.ListPremium") 1838 defer func() { 1839 sc := -1 1840 if result.s.Response.Response != nil { 1841 sc = result.s.Response.Response.StatusCode 1842 } 1843 tracing.EndSpan(ctx, sc, err) 1844 }() 1845 } 1846 result.fn = client.listPremiumNextResults 1847 req, err := client.ListPremiumPreparer(ctx, filter, serviceType, skipCount, takeCount) 1848 if err != nil { 1849 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "ListPremium", nil, "Failure preparing request") 1850 return 1851 } 1852 1853 resp, err := client.ListPremiumSender(req) 1854 if err != nil { 1855 result.s.Response = autorest.Response{Response: resp} 1856 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "ListPremium", resp, "Failure sending request") 1857 return 1858 } 1859 1860 result.s, err = client.ListPremiumResponder(resp) 1861 if err != nil { 1862 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "ListPremium", resp, "Failure responding to request") 1863 return 1864 } 1865 if result.s.hasNextLink() && result.s.IsEmpty() { 1866 err = result.NextWithContext(ctx) 1867 return 1868 } 1869 1870 return 1871} 1872 1873// ListPremiumPreparer prepares the ListPremium request. 1874func (client ServicesClient) ListPremiumPreparer(ctx context.Context, filter string, serviceType string, skipCount *int32, takeCount *int32) (*http.Request, error) { 1875 const APIVersion = "2014-01-01" 1876 queryParameters := map[string]interface{}{ 1877 "api-version": APIVersion, 1878 } 1879 if len(filter) > 0 { 1880 queryParameters["$filter"] = autorest.Encode("query", filter) 1881 } 1882 if len(serviceType) > 0 { 1883 queryParameters["serviceType"] = autorest.Encode("query", serviceType) 1884 } 1885 if skipCount != nil { 1886 queryParameters["skipCount"] = autorest.Encode("query", *skipCount) 1887 } 1888 if takeCount != nil { 1889 queryParameters["takeCount"] = autorest.Encode("query", *takeCount) 1890 } 1891 1892 preparer := autorest.CreatePreparer( 1893 autorest.AsGet(), 1894 autorest.WithBaseURL(client.BaseURI), 1895 autorest.WithPath("/providers/Microsoft.ADHybridHealthService/services/premiumCheck"), 1896 autorest.WithQueryParameters(queryParameters)) 1897 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 1898} 1899 1900// ListPremiumSender sends the ListPremium request. The method will close the 1901// http.Response Body if it receives an error. 1902func (client ServicesClient) ListPremiumSender(req *http.Request) (*http.Response, error) { 1903 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1904} 1905 1906// ListPremiumResponder handles the response to the ListPremium request. The method always 1907// closes the http.Response Body. 1908func (client ServicesClient) ListPremiumResponder(resp *http.Response) (result Services, err error) { 1909 err = autorest.Respond( 1910 resp, 1911 azure.WithErrorUnlessStatusCode(http.StatusOK), 1912 autorest.ByUnmarshallingJSON(&result), 1913 autorest.ByClosing()) 1914 result.Response = autorest.Response{Response: resp} 1915 return 1916} 1917 1918// listPremiumNextResults retrieves the next set of results, if any. 1919func (client ServicesClient) listPremiumNextResults(ctx context.Context, lastResults Services) (result Services, err error) { 1920 req, err := lastResults.servicesPreparer(ctx) 1921 if err != nil { 1922 return result, autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "listPremiumNextResults", nil, "Failure preparing next results request") 1923 } 1924 if req == nil { 1925 return 1926 } 1927 resp, err := client.ListPremiumSender(req) 1928 if err != nil { 1929 result.Response = autorest.Response{Response: resp} 1930 return result, autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "listPremiumNextResults", resp, "Failure sending next results request") 1931 } 1932 result, err = client.ListPremiumResponder(resp) 1933 if err != nil { 1934 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "listPremiumNextResults", resp, "Failure responding to next results request") 1935 } 1936 return 1937} 1938 1939// ListPremiumComplete enumerates all values, automatically crossing page boundaries as required. 1940func (client ServicesClient) ListPremiumComplete(ctx context.Context, filter string, serviceType string, skipCount *int32, takeCount *int32) (result ServicesIterator, err error) { 1941 if tracing.IsEnabled() { 1942 ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.ListPremium") 1943 defer func() { 1944 sc := -1 1945 if result.Response().Response.Response != nil { 1946 sc = result.page.Response().Response.Response.StatusCode 1947 } 1948 tracing.EndSpan(ctx, sc, err) 1949 }() 1950 } 1951 result.page, err = client.ListPremium(ctx, filter, serviceType, skipCount, takeCount) 1952 return 1953} 1954 1955// ListUserBadPasswordReport gets the bad password login attempt report for an user 1956// Parameters: 1957// serviceName - the name of the service. 1958// dataSource - the source of data, if its test data or customer data. 1959func (client ServicesClient) ListUserBadPasswordReport(ctx context.Context, serviceName string, dataSource string) (result ErrorReportUsersEntries, err error) { 1960 if tracing.IsEnabled() { 1961 ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.ListUserBadPasswordReport") 1962 defer func() { 1963 sc := -1 1964 if result.Response.Response != nil { 1965 sc = result.Response.Response.StatusCode 1966 } 1967 tracing.EndSpan(ctx, sc, err) 1968 }() 1969 } 1970 req, err := client.ListUserBadPasswordReportPreparer(ctx, serviceName, dataSource) 1971 if err != nil { 1972 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "ListUserBadPasswordReport", nil, "Failure preparing request") 1973 return 1974 } 1975 1976 resp, err := client.ListUserBadPasswordReportSender(req) 1977 if err != nil { 1978 result.Response = autorest.Response{Response: resp} 1979 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "ListUserBadPasswordReport", resp, "Failure sending request") 1980 return 1981 } 1982 1983 result, err = client.ListUserBadPasswordReportResponder(resp) 1984 if err != nil { 1985 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "ListUserBadPasswordReport", resp, "Failure responding to request") 1986 return 1987 } 1988 1989 return 1990} 1991 1992// ListUserBadPasswordReportPreparer prepares the ListUserBadPasswordReport request. 1993func (client ServicesClient) ListUserBadPasswordReportPreparer(ctx context.Context, serviceName string, dataSource string) (*http.Request, error) { 1994 pathParameters := map[string]interface{}{ 1995 "serviceName": autorest.Encode("path", serviceName), 1996 } 1997 1998 const APIVersion = "2014-01-01" 1999 queryParameters := map[string]interface{}{ 2000 "api-version": APIVersion, 2001 } 2002 if len(dataSource) > 0 { 2003 queryParameters["dataSource"] = autorest.Encode("query", dataSource) 2004 } 2005 2006 preparer := autorest.CreatePreparer( 2007 autorest.AsGet(), 2008 autorest.WithBaseURL(client.BaseURI), 2009 autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/services/{serviceName}/reports/badpassword/details/user", pathParameters), 2010 autorest.WithQueryParameters(queryParameters)) 2011 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 2012} 2013 2014// ListUserBadPasswordReportSender sends the ListUserBadPasswordReport request. The method will close the 2015// http.Response Body if it receives an error. 2016func (client ServicesClient) ListUserBadPasswordReportSender(req *http.Request) (*http.Response, error) { 2017 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2018} 2019 2020// ListUserBadPasswordReportResponder handles the response to the ListUserBadPasswordReport request. The method always 2021// closes the http.Response Body. 2022func (client ServicesClient) ListUserBadPasswordReportResponder(resp *http.Response) (result ErrorReportUsersEntries, err error) { 2023 err = autorest.Respond( 2024 resp, 2025 azure.WithErrorUnlessStatusCode(http.StatusOK), 2026 autorest.ByUnmarshallingJSON(&result), 2027 autorest.ByClosing()) 2028 result.Response = autorest.Response{Response: resp} 2029 return 2030} 2031 2032// Update updates the service properties of an onboarded service. 2033// Parameters: 2034// serviceName - the name of the service which needs to be deleted. 2035// service - the service object. 2036func (client ServicesClient) Update(ctx context.Context, serviceName string, service ServiceProperties) (result ServiceProperties, err error) { 2037 if tracing.IsEnabled() { 2038 ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.Update") 2039 defer func() { 2040 sc := -1 2041 if result.Response.Response != nil { 2042 sc = result.Response.Response.StatusCode 2043 } 2044 tracing.EndSpan(ctx, sc, err) 2045 }() 2046 } 2047 req, err := client.UpdatePreparer(ctx, serviceName, service) 2048 if err != nil { 2049 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "Update", nil, "Failure preparing request") 2050 return 2051 } 2052 2053 resp, err := client.UpdateSender(req) 2054 if err != nil { 2055 result.Response = autorest.Response{Response: resp} 2056 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "Update", resp, "Failure sending request") 2057 return 2058 } 2059 2060 result, err = client.UpdateResponder(resp) 2061 if err != nil { 2062 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "Update", resp, "Failure responding to request") 2063 return 2064 } 2065 2066 return 2067} 2068 2069// UpdatePreparer prepares the Update request. 2070func (client ServicesClient) UpdatePreparer(ctx context.Context, serviceName string, service ServiceProperties) (*http.Request, error) { 2071 pathParameters := map[string]interface{}{ 2072 "serviceName": autorest.Encode("path", serviceName), 2073 } 2074 2075 const APIVersion = "2014-01-01" 2076 queryParameters := map[string]interface{}{ 2077 "api-version": APIVersion, 2078 } 2079 2080 preparer := autorest.CreatePreparer( 2081 autorest.AsContentType("application/json; charset=utf-8"), 2082 autorest.AsPatch(), 2083 autorest.WithBaseURL(client.BaseURI), 2084 autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/services/{serviceName}", pathParameters), 2085 autorest.WithJSON(service), 2086 autorest.WithQueryParameters(queryParameters)) 2087 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 2088} 2089 2090// UpdateSender sends the Update request. The method will close the 2091// http.Response Body if it receives an error. 2092func (client ServicesClient) UpdateSender(req *http.Request) (*http.Response, error) { 2093 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2094} 2095 2096// UpdateResponder handles the response to the Update request. The method always 2097// closes the http.Response Body. 2098func (client ServicesClient) UpdateResponder(resp *http.Response) (result ServiceProperties, err error) { 2099 err = autorest.Respond( 2100 resp, 2101 azure.WithErrorUnlessStatusCode(http.StatusOK), 2102 autorest.ByUnmarshallingJSON(&result), 2103 autorest.ByClosing()) 2104 result.Response = autorest.Response{Response: resp} 2105 return 2106} 2107 2108// UpdateMonitoringConfiguration updates the service level monitoring configuration. 2109// Parameters: 2110// serviceName - the name of the service. 2111// configurationSetting - the monitoring configuration to update 2112func (client ServicesClient) UpdateMonitoringConfiguration(ctx context.Context, serviceName string, configurationSetting Item) (result autorest.Response, err error) { 2113 if tracing.IsEnabled() { 2114 ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.UpdateMonitoringConfiguration") 2115 defer func() { 2116 sc := -1 2117 if result.Response != nil { 2118 sc = result.Response.StatusCode 2119 } 2120 tracing.EndSpan(ctx, sc, err) 2121 }() 2122 } 2123 req, err := client.UpdateMonitoringConfigurationPreparer(ctx, serviceName, configurationSetting) 2124 if err != nil { 2125 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "UpdateMonitoringConfiguration", nil, "Failure preparing request") 2126 return 2127 } 2128 2129 resp, err := client.UpdateMonitoringConfigurationSender(req) 2130 if err != nil { 2131 result.Response = resp 2132 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "UpdateMonitoringConfiguration", resp, "Failure sending request") 2133 return 2134 } 2135 2136 result, err = client.UpdateMonitoringConfigurationResponder(resp) 2137 if err != nil { 2138 err = autorest.NewErrorWithError(err, "adhybridhealthservice.ServicesClient", "UpdateMonitoringConfiguration", resp, "Failure responding to request") 2139 return 2140 } 2141 2142 return 2143} 2144 2145// UpdateMonitoringConfigurationPreparer prepares the UpdateMonitoringConfiguration request. 2146func (client ServicesClient) UpdateMonitoringConfigurationPreparer(ctx context.Context, serviceName string, configurationSetting Item) (*http.Request, error) { 2147 pathParameters := map[string]interface{}{ 2148 "serviceName": autorest.Encode("path", serviceName), 2149 } 2150 2151 const APIVersion = "2014-01-01" 2152 queryParameters := map[string]interface{}{ 2153 "api-version": APIVersion, 2154 } 2155 2156 preparer := autorest.CreatePreparer( 2157 autorest.AsContentType("application/json; charset=utf-8"), 2158 autorest.AsPatch(), 2159 autorest.WithBaseURL(client.BaseURI), 2160 autorest.WithPathParameters("/providers/Microsoft.ADHybridHealthService/services/{serviceName}/monitoringconfiguration", pathParameters), 2161 autorest.WithJSON(configurationSetting), 2162 autorest.WithQueryParameters(queryParameters)) 2163 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 2164} 2165 2166// UpdateMonitoringConfigurationSender sends the UpdateMonitoringConfiguration request. The method will close the 2167// http.Response Body if it receives an error. 2168func (client ServicesClient) UpdateMonitoringConfigurationSender(req *http.Request) (*http.Response, error) { 2169 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2170} 2171 2172// UpdateMonitoringConfigurationResponder handles the response to the UpdateMonitoringConfiguration request. The method always 2173// closes the http.Response Body. 2174func (client ServicesClient) UpdateMonitoringConfigurationResponder(resp *http.Response) (result autorest.Response, err error) { 2175 err = autorest.Respond( 2176 resp, 2177 azure.WithErrorUnlessStatusCode(http.StatusOK), 2178 autorest.ByClosing()) 2179 result.Response = resp 2180 return 2181} 2182