Пример #1
0
        public virtual async Task <Response <CustomLocationResource> > UpdateAsync(PatchableCustomLocationData data, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNull(data, nameof(data));

            using var scope = _customLocationClientDiagnostics.CreateScope("CustomLocationResource.Update");
            scope.Start();
            try
            {
                var response = await _customLocationRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, data, cancellationToken).ConfigureAwait(false);

                return(Response.FromValue(new CustomLocationResource(Client, response.Value), response.GetRawResponse()));
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }
        public async virtual Task <Response <CustomLocation> > UpdateAsync(PatchableCustomLocations parameters, CancellationToken cancellationToken = default)
        {
            if (parameters == null)
            {
                throw new ArgumentNullException(nameof(parameters));
            }

            using var scope = _customLocationClientDiagnostics.CreateScope("CustomLocation.Update");
            scope.Start();
            try
            {
                var response = await _customLocationRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, parameters, cancellationToken).ConfigureAwait(false);

                return(Response.FromValue(new CustomLocation(ArmClient, response.Value), response.GetRawResponse()));
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }