예제 #1
0
 public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default)
 {
     using var scope = _addressResourceClientDiagnostics.CreateScope("AddressResource.Delete");
     scope.Start();
     try
     {
         var response  = _addressResourceRestClient.DeleteAddressByName(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken);
         var operation = new EdgeOrderArmOperation(_addressResourceClientDiagnostics, Pipeline, _addressResourceRestClient.CreateDeleteAddressByNameRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location);
         if (waitUntil == WaitUntil.Completed)
         {
             operation.WaitForCompletionResponse(cancellationToken);
         }
         return(operation);
     }
     catch (Exception e)
     {
         scope.Failed(e);
         throw;
     }
 }
예제 #2
0
        public virtual ArmOperation ReturnOrderItem(WaitUntil waitUntil, ReturnOrderItemDetails returnOrderItemDetails, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNull(returnOrderItemDetails, nameof(returnOrderItemDetails));

            using var scope = _orderItemResourceClientDiagnostics.CreateScope("OrderItemResource.ReturnOrderItem");
            scope.Start();
            try
            {
                var response  = _orderItemResourceRestClient.ReturnOrderItem(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, returnOrderItemDetails, cancellationToken);
                var operation = new EdgeOrderArmOperation(_orderItemResourceClientDiagnostics, Pipeline, _orderItemResourceRestClient.CreateReturnOrderItemRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, returnOrderItemDetails).Request, response, OperationFinalStateVia.Location);
                if (waitUntil == WaitUntil.Completed)
                {
                    operation.WaitForCompletionResponse(cancellationToken);
                }
                return(operation);
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }