Exemplo n.º 1
0
        public async virtual Task <Response <MsixPackage> > UpdateAsync(MsixPackageUpdateOptions options = null, CancellationToken cancellationToken = default)
        {
            using var scope = _msixPackageMSIXPackagesClientDiagnostics.CreateScope("MsixPackage.Update");
            scope.Start();
            try
            {
                var response = await _msixPackageMSIXPackagesRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, options, cancellationToken).ConfigureAwait(false);

                return(Response.FromValue(new MsixPackage(Client, response.Value), response.GetRawResponse()));
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }
        public virtual async Task <Response <MsixPackageResource> > UpdateAsync(MsixPackagePatch patch, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNull(patch, nameof(patch));

            using var scope = _msixPackageMSIXPackagesClientDiagnostics.CreateScope("MsixPackageResource.Update");
            scope.Start();
            try
            {
                var response = await _msixPackageMSIXPackagesRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken).ConfigureAwait(false);

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