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

            using var scope = _appServicePlanClientDiagnostics.CreateScope("AppServicePlan.Update");
            scope.Start();
            try
            {
                var response = await _appServicePlanRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, options, cancellationToken).ConfigureAwait(false);

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

            using var scope = _clientDiagnostics.CreateScope("AppServicePlan.Update");
            scope.Start();
            try
            {
                var response = await _appServicePlansRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, appServicePlan, cancellationToken).ConfigureAwait(false);

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