1package apimanagement 2 3// Copyright (c) Microsoft and contributors. All rights reserved. 4// 5// Licensed under the Apache License, Version 2.0 (the "License"); 6// you may not use this file except in compliance with the License. 7// You may obtain a copy of the License at 8// http://www.apache.org/licenses/LICENSE-2.0 9// 10// Unless required by applicable law or agreed to in writing, software 11// distributed under the License is distributed on an "AS IS" BASIS, 12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13// 14// See the License for the specific language governing permissions and 15// limitations under the License. 16// 17// Code generated by Microsoft (R) AutoRest Code Generator. 18// Changes may cause incorrect behavior and will be lost if the code is regenerated. 19 20import ( 21 "context" 22 "github.com/Azure/go-autorest/autorest" 23 "github.com/Azure/go-autorest/autorest/azure" 24 "github.com/Azure/go-autorest/autorest/validation" 25 "github.com/Azure/go-autorest/tracing" 26 "net/http" 27) 28 29// LoggersClient is the apiManagement Client 30type LoggersClient struct { 31 BaseClient 32} 33 34// NewLoggersClient creates an instance of the LoggersClient client. 35func NewLoggersClient(subscriptionID string) LoggersClient { 36 return NewLoggersClientWithBaseURI(DefaultBaseURI, subscriptionID) 37} 38 39// NewLoggersClientWithBaseURI creates an instance of the LoggersClient client using a custom endpoint. Use this when 40// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). 41func NewLoggersClientWithBaseURI(baseURI string, subscriptionID string) LoggersClient { 42 return LoggersClient{NewWithBaseURI(baseURI, subscriptionID)} 43} 44 45// CreateOrUpdate creates or Updates a logger. 46// Parameters: 47// resourceGroupName - the name of the resource group. 48// serviceName - the name of the API Management service. 49// loggerid - identifier of the logger. 50// parameters - create parameters. 51func (client LoggersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, loggerid string, parameters LoggerCreateParameters) (result autorest.Response, err error) { 52 if tracing.IsEnabled() { 53 ctx = tracing.StartSpan(ctx, fqdn+"/LoggersClient.CreateOrUpdate") 54 defer func() { 55 sc := -1 56 if result.Response != nil { 57 sc = result.Response.StatusCode 58 } 59 tracing.EndSpan(ctx, sc, err) 60 }() 61 } 62 if err := validation.Validate([]validation.Validation{ 63 {TargetValue: serviceName, 64 Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, 65 {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, 66 {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, 67 {TargetValue: loggerid, 68 Constraints: []validation.Constraint{{Target: "loggerid", Name: validation.MaxLength, Rule: 256, Chain: nil}, 69 {Target: "loggerid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, 70 {TargetValue: parameters, 71 Constraints: []validation.Constraint{{Target: "parameters.Type", Name: validation.Null, Rule: true, Chain: nil}, 72 {Target: "parameters.Credentials", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { 73 return result, validation.NewError("apimanagement.LoggersClient", "CreateOrUpdate", err.Error()) 74 } 75 76 req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, loggerid, parameters) 77 if err != nil { 78 err = autorest.NewErrorWithError(err, "apimanagement.LoggersClient", "CreateOrUpdate", nil, "Failure preparing request") 79 return 80 } 81 82 resp, err := client.CreateOrUpdateSender(req) 83 if err != nil { 84 result.Response = resp 85 err = autorest.NewErrorWithError(err, "apimanagement.LoggersClient", "CreateOrUpdate", resp, "Failure sending request") 86 return 87 } 88 89 result, err = client.CreateOrUpdateResponder(resp) 90 if err != nil { 91 err = autorest.NewErrorWithError(err, "apimanagement.LoggersClient", "CreateOrUpdate", resp, "Failure responding to request") 92 return 93 } 94 95 return 96} 97 98// CreateOrUpdatePreparer prepares the CreateOrUpdate request. 99func (client LoggersClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, loggerid string, parameters LoggerCreateParameters) (*http.Request, error) { 100 pathParameters := map[string]interface{}{ 101 "loggerid": autorest.Encode("path", loggerid), 102 "resourceGroupName": autorest.Encode("path", resourceGroupName), 103 "serviceName": autorest.Encode("path", serviceName), 104 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 105 } 106 107 const APIVersion = "2016-07-07" 108 queryParameters := map[string]interface{}{ 109 "api-version": APIVersion, 110 } 111 112 preparer := autorest.CreatePreparer( 113 autorest.AsContentType("application/json; charset=utf-8"), 114 autorest.AsPut(), 115 autorest.WithBaseURL(client.BaseURI), 116 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerid}", pathParameters), 117 autorest.WithJSON(parameters), 118 autorest.WithQueryParameters(queryParameters)) 119 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 120} 121 122// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the 123// http.Response Body if it receives an error. 124func (client LoggersClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { 125 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 126} 127 128// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always 129// closes the http.Response Body. 130func (client LoggersClient) CreateOrUpdateResponder(resp *http.Response) (result autorest.Response, err error) { 131 err = autorest.Respond( 132 resp, 133 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusNoContent), 134 autorest.ByClosing()) 135 result.Response = resp 136 return 137} 138 139// Delete deletes the specified logger. 140// Parameters: 141// resourceGroupName - the name of the resource group. 142// serviceName - the name of the API Management service. 143// loggerid - identifier of the logger. 144// ifMatch - the entity state (Etag) version of the logger to delete. A value of "*" can be used for If-Match 145// to unconditionally apply the operation. 146func (client LoggersClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, loggerid string, ifMatch string) (result autorest.Response, err error) { 147 if tracing.IsEnabled() { 148 ctx = tracing.StartSpan(ctx, fqdn+"/LoggersClient.Delete") 149 defer func() { 150 sc := -1 151 if result.Response != nil { 152 sc = result.Response.StatusCode 153 } 154 tracing.EndSpan(ctx, sc, err) 155 }() 156 } 157 if err := validation.Validate([]validation.Validation{ 158 {TargetValue: serviceName, 159 Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, 160 {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, 161 {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { 162 return result, validation.NewError("apimanagement.LoggersClient", "Delete", err.Error()) 163 } 164 165 req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, loggerid, ifMatch) 166 if err != nil { 167 err = autorest.NewErrorWithError(err, "apimanagement.LoggersClient", "Delete", nil, "Failure preparing request") 168 return 169 } 170 171 resp, err := client.DeleteSender(req) 172 if err != nil { 173 result.Response = resp 174 err = autorest.NewErrorWithError(err, "apimanagement.LoggersClient", "Delete", resp, "Failure sending request") 175 return 176 } 177 178 result, err = client.DeleteResponder(resp) 179 if err != nil { 180 err = autorest.NewErrorWithError(err, "apimanagement.LoggersClient", "Delete", resp, "Failure responding to request") 181 return 182 } 183 184 return 185} 186 187// DeletePreparer prepares the Delete request. 188func (client LoggersClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, loggerid string, ifMatch string) (*http.Request, error) { 189 pathParameters := map[string]interface{}{ 190 "loggerid": autorest.Encode("path", loggerid), 191 "resourceGroupName": autorest.Encode("path", resourceGroupName), 192 "serviceName": autorest.Encode("path", serviceName), 193 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 194 } 195 196 const APIVersion = "2016-07-07" 197 queryParameters := map[string]interface{}{ 198 "api-version": APIVersion, 199 } 200 201 preparer := autorest.CreatePreparer( 202 autorest.AsDelete(), 203 autorest.WithBaseURL(client.BaseURI), 204 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerid}", pathParameters), 205 autorest.WithQueryParameters(queryParameters), 206 autorest.WithHeader("If-Match", autorest.String(ifMatch))) 207 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 208} 209 210// DeleteSender sends the Delete request. The method will close the 211// http.Response Body if it receives an error. 212func (client LoggersClient) DeleteSender(req *http.Request) (*http.Response, error) { 213 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 214} 215 216// DeleteResponder handles the response to the Delete request. The method always 217// closes the http.Response Body. 218func (client LoggersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { 219 err = autorest.Respond( 220 resp, 221 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), 222 autorest.ByClosing()) 223 result.Response = resp 224 return 225} 226 227// Get gets the details of the logger specified by its identifier. 228// Parameters: 229// resourceGroupName - the name of the resource group. 230// serviceName - the name of the API Management service. 231// loggerid - identifier of the logger. 232func (client LoggersClient) Get(ctx context.Context, resourceGroupName string, serviceName string, loggerid string) (result LoggerResponse, err error) { 233 if tracing.IsEnabled() { 234 ctx = tracing.StartSpan(ctx, fqdn+"/LoggersClient.Get") 235 defer func() { 236 sc := -1 237 if result.Response.Response != nil { 238 sc = result.Response.Response.StatusCode 239 } 240 tracing.EndSpan(ctx, sc, err) 241 }() 242 } 243 if err := validation.Validate([]validation.Validation{ 244 {TargetValue: serviceName, 245 Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, 246 {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, 247 {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { 248 return result, validation.NewError("apimanagement.LoggersClient", "Get", err.Error()) 249 } 250 251 req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, loggerid) 252 if err != nil { 253 err = autorest.NewErrorWithError(err, "apimanagement.LoggersClient", "Get", nil, "Failure preparing request") 254 return 255 } 256 257 resp, err := client.GetSender(req) 258 if err != nil { 259 result.Response = autorest.Response{Response: resp} 260 err = autorest.NewErrorWithError(err, "apimanagement.LoggersClient", "Get", resp, "Failure sending request") 261 return 262 } 263 264 result, err = client.GetResponder(resp) 265 if err != nil { 266 err = autorest.NewErrorWithError(err, "apimanagement.LoggersClient", "Get", resp, "Failure responding to request") 267 return 268 } 269 270 return 271} 272 273// GetPreparer prepares the Get request. 274func (client LoggersClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, loggerid string) (*http.Request, error) { 275 pathParameters := map[string]interface{}{ 276 "loggerid": autorest.Encode("path", loggerid), 277 "resourceGroupName": autorest.Encode("path", resourceGroupName), 278 "serviceName": autorest.Encode("path", serviceName), 279 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 280 } 281 282 const APIVersion = "2016-07-07" 283 queryParameters := map[string]interface{}{ 284 "api-version": APIVersion, 285 } 286 287 preparer := autorest.CreatePreparer( 288 autorest.AsGet(), 289 autorest.WithBaseURL(client.BaseURI), 290 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerid}", pathParameters), 291 autorest.WithQueryParameters(queryParameters)) 292 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 293} 294 295// GetSender sends the Get request. The method will close the 296// http.Response Body if it receives an error. 297func (client LoggersClient) GetSender(req *http.Request) (*http.Response, error) { 298 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 299} 300 301// GetResponder handles the response to the Get request. The method always 302// closes the http.Response Body. 303func (client LoggersClient) GetResponder(resp *http.Response) (result LoggerResponse, err error) { 304 err = autorest.Respond( 305 resp, 306 azure.WithErrorUnlessStatusCode(http.StatusOK), 307 autorest.ByUnmarshallingJSON(&result), 308 autorest.ByClosing()) 309 result.Response = autorest.Response{Response: resp} 310 return 311} 312 313// ListByService lists a collection of loggers in the specified service instance. 314// Parameters: 315// resourceGroupName - the name of the resource group. 316// serviceName - the name of the API Management service. 317// filter - | Field | Supported operators | Supported functions | 318// |-------|------------------------|---------------------------------------------| 319// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | 320// | type | eq | | 321// top - number of records to return. 322// skip - number of records to skip. 323func (client LoggersClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result LoggerCollectionPage, err error) { 324 if tracing.IsEnabled() { 325 ctx = tracing.StartSpan(ctx, fqdn+"/LoggersClient.ListByService") 326 defer func() { 327 sc := -1 328 if result.lc.Response.Response != nil { 329 sc = result.lc.Response.Response.StatusCode 330 } 331 tracing.EndSpan(ctx, sc, err) 332 }() 333 } 334 if err := validation.Validate([]validation.Validation{ 335 {TargetValue: serviceName, 336 Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, 337 {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, 338 {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, 339 {TargetValue: top, 340 Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, 341 Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}}}}}, 342 {TargetValue: skip, 343 Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, 344 Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}}}); err != nil { 345 return result, validation.NewError("apimanagement.LoggersClient", "ListByService", err.Error()) 346 } 347 348 result.fn = client.listByServiceNextResults 349 req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, filter, top, skip) 350 if err != nil { 351 err = autorest.NewErrorWithError(err, "apimanagement.LoggersClient", "ListByService", nil, "Failure preparing request") 352 return 353 } 354 355 resp, err := client.ListByServiceSender(req) 356 if err != nil { 357 result.lc.Response = autorest.Response{Response: resp} 358 err = autorest.NewErrorWithError(err, "apimanagement.LoggersClient", "ListByService", resp, "Failure sending request") 359 return 360 } 361 362 result.lc, err = client.ListByServiceResponder(resp) 363 if err != nil { 364 err = autorest.NewErrorWithError(err, "apimanagement.LoggersClient", "ListByService", resp, "Failure responding to request") 365 return 366 } 367 if result.lc.hasNextLink() && result.lc.IsEmpty() { 368 err = result.NextWithContext(ctx) 369 return 370 } 371 372 return 373} 374 375// ListByServicePreparer prepares the ListByService request. 376func (client LoggersClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (*http.Request, error) { 377 pathParameters := map[string]interface{}{ 378 "resourceGroupName": autorest.Encode("path", resourceGroupName), 379 "serviceName": autorest.Encode("path", serviceName), 380 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 381 } 382 383 const APIVersion = "2016-07-07" 384 queryParameters := map[string]interface{}{ 385 "api-version": APIVersion, 386 } 387 if len(filter) > 0 { 388 queryParameters["$filter"] = autorest.Encode("query", filter) 389 } 390 if top != nil { 391 queryParameters["$top"] = autorest.Encode("query", *top) 392 } 393 if skip != nil { 394 queryParameters["$skip"] = autorest.Encode("query", *skip) 395 } 396 397 preparer := autorest.CreatePreparer( 398 autorest.AsGet(), 399 autorest.WithBaseURL(client.BaseURI), 400 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers", pathParameters), 401 autorest.WithQueryParameters(queryParameters)) 402 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 403} 404 405// ListByServiceSender sends the ListByService request. The method will close the 406// http.Response Body if it receives an error. 407func (client LoggersClient) ListByServiceSender(req *http.Request) (*http.Response, error) { 408 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 409} 410 411// ListByServiceResponder handles the response to the ListByService request. The method always 412// closes the http.Response Body. 413func (client LoggersClient) ListByServiceResponder(resp *http.Response) (result LoggerCollection, err error) { 414 err = autorest.Respond( 415 resp, 416 azure.WithErrorUnlessStatusCode(http.StatusOK), 417 autorest.ByUnmarshallingJSON(&result), 418 autorest.ByClosing()) 419 result.Response = autorest.Response{Response: resp} 420 return 421} 422 423// listByServiceNextResults retrieves the next set of results, if any. 424func (client LoggersClient) listByServiceNextResults(ctx context.Context, lastResults LoggerCollection) (result LoggerCollection, err error) { 425 req, err := lastResults.loggerCollectionPreparer(ctx) 426 if err != nil { 427 return result, autorest.NewErrorWithError(err, "apimanagement.LoggersClient", "listByServiceNextResults", nil, "Failure preparing next results request") 428 } 429 if req == nil { 430 return 431 } 432 resp, err := client.ListByServiceSender(req) 433 if err != nil { 434 result.Response = autorest.Response{Response: resp} 435 return result, autorest.NewErrorWithError(err, "apimanagement.LoggersClient", "listByServiceNextResults", resp, "Failure sending next results request") 436 } 437 result, err = client.ListByServiceResponder(resp) 438 if err != nil { 439 err = autorest.NewErrorWithError(err, "apimanagement.LoggersClient", "listByServiceNextResults", resp, "Failure responding to next results request") 440 } 441 return 442} 443 444// ListByServiceComplete enumerates all values, automatically crossing page boundaries as required. 445func (client LoggersClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result LoggerCollectionIterator, err error) { 446 if tracing.IsEnabled() { 447 ctx = tracing.StartSpan(ctx, fqdn+"/LoggersClient.ListByService") 448 defer func() { 449 sc := -1 450 if result.Response().Response.Response != nil { 451 sc = result.page.Response().Response.Response.StatusCode 452 } 453 tracing.EndSpan(ctx, sc, err) 454 }() 455 } 456 result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, filter, top, skip) 457 return 458} 459 460// Update updates an existing logger. 461// Parameters: 462// resourceGroupName - the name of the resource group. 463// serviceName - the name of the API Management service. 464// loggerid - identifier of the logger. 465// parameters - update parameters. 466// ifMatch - the entity state (Etag) version of the logger to update. A value of "*" can be used for If-Match 467// to unconditionally apply the operation. 468func (client LoggersClient) Update(ctx context.Context, resourceGroupName string, serviceName string, loggerid string, parameters LoggerUpdateParameters, ifMatch string) (result autorest.Response, err error) { 469 if tracing.IsEnabled() { 470 ctx = tracing.StartSpan(ctx, fqdn+"/LoggersClient.Update") 471 defer func() { 472 sc := -1 473 if result.Response != nil { 474 sc = result.Response.StatusCode 475 } 476 tracing.EndSpan(ctx, sc, err) 477 }() 478 } 479 if err := validation.Validate([]validation.Validation{ 480 {TargetValue: serviceName, 481 Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, 482 {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, 483 {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { 484 return result, validation.NewError("apimanagement.LoggersClient", "Update", err.Error()) 485 } 486 487 req, err := client.UpdatePreparer(ctx, resourceGroupName, serviceName, loggerid, parameters, ifMatch) 488 if err != nil { 489 err = autorest.NewErrorWithError(err, "apimanagement.LoggersClient", "Update", nil, "Failure preparing request") 490 return 491 } 492 493 resp, err := client.UpdateSender(req) 494 if err != nil { 495 result.Response = resp 496 err = autorest.NewErrorWithError(err, "apimanagement.LoggersClient", "Update", resp, "Failure sending request") 497 return 498 } 499 500 result, err = client.UpdateResponder(resp) 501 if err != nil { 502 err = autorest.NewErrorWithError(err, "apimanagement.LoggersClient", "Update", resp, "Failure responding to request") 503 return 504 } 505 506 return 507} 508 509// UpdatePreparer prepares the Update request. 510func (client LoggersClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, loggerid string, parameters LoggerUpdateParameters, ifMatch string) (*http.Request, error) { 511 pathParameters := map[string]interface{}{ 512 "loggerid": autorest.Encode("path", loggerid), 513 "resourceGroupName": autorest.Encode("path", resourceGroupName), 514 "serviceName": autorest.Encode("path", serviceName), 515 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 516 } 517 518 const APIVersion = "2016-07-07" 519 queryParameters := map[string]interface{}{ 520 "api-version": APIVersion, 521 } 522 523 preparer := autorest.CreatePreparer( 524 autorest.AsContentType("application/json; charset=utf-8"), 525 autorest.AsPatch(), 526 autorest.WithBaseURL(client.BaseURI), 527 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerid}", pathParameters), 528 autorest.WithJSON(parameters), 529 autorest.WithQueryParameters(queryParameters), 530 autorest.WithHeader("If-Match", autorest.String(ifMatch))) 531 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 532} 533 534// UpdateSender sends the Update request. The method will close the 535// http.Response Body if it receives an error. 536func (client LoggersClient) UpdateSender(req *http.Request) (*http.Response, error) { 537 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 538} 539 540// UpdateResponder handles the response to the Update request. The method always 541// closes the http.Response Body. 542func (client LoggersClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) { 543 err = autorest.Respond( 544 resp, 545 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), 546 autorest.ByClosing()) 547 result.Response = resp 548 return 549} 550