public virtual async Task <Response <StorageQueueResource> > UpdateAsync(StorageQueueData data, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNull(data, nameof(data));

            using var scope = _storageQueueQueueClientDiagnostics.CreateScope("StorageQueueResource.Update");
            scope.Start();
            try
            {
                var response = await _storageQueueQueueRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false);

                return(Response.FromValue(new StorageQueueResource(Client, response.Value), response.GetRawResponse()));
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }
Esempio n. 2
0
        public virtual async Task <Response <StorageQueue> > UpdateAsync(StorageQueueData queue, CancellationToken cancellationToken = default)
        {
            if (queue == null)
            {
                throw new ArgumentNullException(nameof(queue));
            }

            using var scope = _clientDiagnostics.CreateScope("StorageQueue.Update");
            scope.Start();
            try
            {
                var response = await _restClient.UpdateAsync(Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, queue, cancellationToken).ConfigureAwait(false);

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