public virtual QueueCreateOperation CreateOrUpdate(string queueName, StorageQueueData queue, bool waitForCompletion = true, CancellationToken cancellationToken = default) { if (queueName == null) { throw new ArgumentNullException(nameof(queueName)); } if (queue == null) { throw new ArgumentNullException(nameof(queue)); } using var scope = _clientDiagnostics.CreateScope("StorageQueueCollection.CreateOrUpdate"); scope.Start(); try { var response = _queueRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, queueName, queue, cancellationToken); var operation = new QueueCreateOperation(Parent, response); if (waitForCompletion) { operation.WaitForCompletion(cancellationToken); } return(operation); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual ArmOperation <StorageQueue> CreateOrUpdate(bool waitForCompletion, string queueName, StorageQueueData queue, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(queueName, nameof(queueName)); Argument.AssertNotNull(queue, nameof(queue)); using var scope = _storageQueueQueueClientDiagnostics.CreateScope("StorageQueueCollection.CreateOrUpdate"); scope.Start(); try { var response = _storageQueueQueueRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, queueName, queue, cancellationToken); var operation = new StorageArmOperation <StorageQueue>(Response.FromValue(new StorageQueue(Client, response), response.GetRawResponse())); if (waitForCompletion) { operation.WaitForCompletion(cancellationToken); } return(operation); } catch (Exception e) { scope.Failed(e); throw; } }