public async virtual Task <Response <VCenter> > UpdateAsync(ResourcePatch body = null, CancellationToken cancellationToken = default) { using var scope = _vCenterClientDiagnostics.CreateScope("VCenter.Update"); scope.Start(); try { var response = await _vCenterRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, body, cancellationToken).ConfigureAwait(false); return(Response.FromValue(new VCenter(ArmClient, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual async Task <Response <VCenterResource> > UpdateAsync(ResourcePatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNull(patch, nameof(patch)); using var scope = _vCenterClientDiagnostics.CreateScope("VCenterResource.Update"); scope.Start(); try { var response = await _vCenterRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); return(Response.FromValue(new VCenterResource(Client, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }