/// <summary>Snippet for Delete</summary>
        public void DeleteRequestObject()
        {
            // Snippet: Delete(DeleteRouteRequest, CallSettings)
            // Create client
            RoutesClient routesClient = RoutesClient.Create();
            // Initialize request argument(s)
            DeleteRouteRequest request = new DeleteRouteRequest
            {
                RequestId = "",
                Route     = "",
                Project   = "",
            };
            // Make the request
            lro::Operation <Operation, Operation> response = routesClient.Delete(request);

            // Poll until the returned long-running operation is complete
            lro::Operation <Operation, Operation> completedResponse = response.PollUntilCompleted();
            // Retrieve the operation result
            Operation result = completedResponse.Result;

            // Or get the name of the operation
            string operationName = response.Name;
            // This name can be stored, then the long-running operation retrieved later by name
            lro::Operation <Operation, Operation> retrievedResponse = routesClient.PollOnceDelete(operationName);

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                Operation retrievedResult = retrievedResponse.Result;
            }
            // End snippet
        }
        public void DeleteRouteCommnad_Ok()
        {
            //Arrenge
            DeleteRouteRequest request = new DeleteRouteRequest
            {
                PointFromCode = "from",
                PointToCode   = "to"
            };

            _routedataMock.Setup(p => p.GetRoute(It.IsIn(request.PointFromCode), It.IsIn(request.PointToCode)))
            .Returns(new Route()
            {
                PointFromCode = request.PointFromCode,
                PointToCode   = request.PointToCode,
            });

            //Act
            new DeleteRouteCommand(_routedataMock.Object).Execute(request);

            //Assert
            _routedataMock.Verify(p => p.Delete(It.Is((Route r) =>
                                                      r.PointFromCode.Equals(request.PointFromCode) &&
                                                      r.PointToCode.Equals(request.PointToCode)
                                                      )));
        }
예제 #3
0
        internal virtual DeleteRouteResponse DeleteRoute(DeleteRouteRequest request)
        {
            var marshaller   = DeleteRouteRequestMarshaller.Instance;
            var unmarshaller = DeleteRouteResponseUnmarshaller.Instance;

            return(Invoke <DeleteRouteRequest, DeleteRouteResponse>(request, marshaller, unmarshaller));
        }
예제 #4
0
        /// <summary>
        /// Initiates the asynchronous execution of the DeleteRoute operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the DeleteRoute operation.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// <returns>The task object representing the asynchronous operation.</returns>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/appmesh-2018-10-01/DeleteRoute">REST API Reference for DeleteRoute Operation</seealso>
        public virtual Task <DeleteRouteResponse> DeleteRouteAsync(DeleteRouteRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = DeleteRouteRequestMarshaller.Instance;
            var unmarshaller = DeleteRouteResponseUnmarshaller.Instance;

            return(InvokeAsync <DeleteRouteRequest, DeleteRouteResponse>(request, marshaller,
                                                                         unmarshaller, cancellationToken));
        }
예제 #5
0
        /// <summary>
        /// Initiates the asynchronous execution of the DeleteRoute operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the DeleteRoute operation.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// <returns>The task object representing the asynchronous operation.</returns>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/appmesh-2018-10-01/DeleteRoute">REST API Reference for DeleteRoute Operation</seealso>
        public virtual Task <DeleteRouteResponse> DeleteRouteAsync(DeleteRouteRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = DeleteRouteRequestMarshaller.Instance;
            options.ResponseUnmarshaller = DeleteRouteResponseUnmarshaller.Instance;

            return(InvokeAsync <DeleteRouteResponse>(request, options, cancellationToken));
        }
예제 #6
0
        internal virtual DeleteRouteResponse DeleteRoute(DeleteRouteRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = DeleteRouteRequestMarshaller.Instance;
            options.ResponseUnmarshaller = DeleteRouteResponseUnmarshaller.Instance;

            return(Invoke <DeleteRouteResponse>(request, options));
        }
예제 #7
0
        /// <summary>
        /// Deletes the specified Route resource.
        /// </summary>
        /// <param name="request">The request object containing all of the parameters for the API call.</param>
        /// <param name="callSettings">If not null, applies overrides to this RPC call.</param>
        /// <returns>The RPC response.</returns>
        public override lro::Operation <Operation, Operation> Delete(DeleteRouteRequest request, gaxgrpc::CallSettings callSettings = null)
        {
            Modify_DeleteRouteRequest(ref request, ref callSettings);
            Operation response = _callDelete.Sync(request, callSettings);
            GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response);

            request.PopulatePollRequestFields(pollRequest);
            return(new lro::Operation <Operation, Operation>(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient));
        }
        private async Task DeleteRoute(IAmazonEC2 client, RouteToTransitGateway route)
        {
            var request = new DeleteRouteRequest
            {
                DestinationCidrBlock = route.DestinationCidrBlock,
                RouteTableId         = route.RouteTableId
            };

            await client.DeleteRouteAsync(request);
        }
예제 #9
0
 /// <summary>Snippet for Delete</summary>
 public void DeleteRequestObject()
 {
     // Snippet: Delete(DeleteRouteRequest, CallSettings)
     // Create client
     RoutesClient routesClient = RoutesClient.Create();
     // Initialize request argument(s)
     DeleteRouteRequest request = new DeleteRouteRequest
     {
         RequestId = "",
         Route     = "",
         Project   = "",
     };
     // Make the request
     Operation response = routesClient.Delete(request);
     // End snippet
 }
        public async stt::Task DeleteRequestObjectAsync()
        {
            moq::Mock <Routes.RoutesClient> mockGrpcClient = new moq::Mock <Routes.RoutesClient>(moq::MockBehavior.Strict);
            DeleteRouteRequest request = new DeleteRouteRequest
            {
                RequestId = "request_id362c8df6",
                Route     = "route8a40469c",
                Project   = "projectaa6ff846",
            };
            Operation expectedResponse = new Operation
            {
                Id   = 11672635353343658936UL,
                Kind = "kindf7aa39d9",
                Name = "name1c9368b0",
                User = "******",
                Zone = "zone255f4ea8",
                CreationTimestamp   = "creation_timestamp235e59a1",
                StartTime           = "start_timebd8dd9c4",
                OperationGroupId    = "operation_group_idd2040cf0",
                TargetLink          = "target_link9b435dc0",
                Progress            = 278622268,
                Error               = new Error(),
                EndTime             = "end_time89285d30",
                Region              = "regionedb20d96",
                OperationType       = "operation_typeece9e153",
                Status              = Operation.Types.Status.Pending,
                HttpErrorMessage    = "http_error_messageb5ef3c7f",
                TargetId            = 6263187990225347157UL,
                ClientOperationId   = "client_operation_id4e51b631",
                StatusMessage       = "status_message2c618f86",
                HttpErrorStatusCode = 1766362655,
                Description         = "description2cf9da67",
                InsertTime          = "insert_time7467185a",
                SelfLink            = "self_link7e87f12d",
                Warnings            = { new Warnings(), },
            };

            mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <Operation>(stt::Task.FromResult(expectedResponse), null, null, null, null));
            RoutesClient client = new RoutesClientImpl(mockGrpcClient.Object, null);
            Operation    responseCallSettings = await client.DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None));

            xunit::Assert.Same(expectedResponse, responseCallSettings);
            Operation responseCancellationToken = await client.DeleteAsync(request, st::CancellationToken.None);

            xunit::Assert.Same(expectedResponse, responseCancellationToken);
            mockGrpcClient.VerifyAll();
        }
예제 #11
0
        public async Task DeleteRouteForRouteTable(string destinationCidrBlock, string routeTableId)
        {
            try
            {
                var request = new DeleteRouteRequest()
                {
                    DestinationCidrBlock = destinationCidrBlock,
                    RouteTableId         = routeTableId
                };

                await client.DeleteRouteAsync(request);
            }
            catch (Exception ex)
            {
                //Check if destinationCidrBlock doesn't exist, should skip
                throw ex;
            }
        }
        public void DeleteRequestObject()
        {
            moq::Mock <Routes.RoutesClient> mockGrpcClient = new moq::Mock <Routes.RoutesClient>(moq::MockBehavior.Strict);
            DeleteRouteRequest request = new DeleteRouteRequest
            {
                RequestId = "request_id362c8df6",
                Route     = "route8a40469c",
                Project   = "projectaa6ff846",
            };
            Operation expectedResponse = new Operation
            {
                Id   = "id74b70bb8",
                Kind = "kindf7aa39d9",
                Name = "name1c9368b0",
                User = "******",
                Zone = "zone255f4ea8",
                CreationTimestamp   = "creation_timestamp235e59a1",
                StartTime           = "start_timebd8dd9c4",
                OperationGroupId    = "operation_group_idd2040cf0",
                TargetLink          = "target_link9b435dc0",
                Progress            = 278622268,
                Error               = new Error(),
                EndTime             = "end_time89285d30",
                Region              = "regionedb20d96",
                OperationType       = "operation_typeece9e153",
                Status              = Operation.Types.Status.Pending,
                HttpErrorMessage    = "http_error_messageb5ef3c7f",
                TargetId            = "target_id16dfe255",
                ClientOperationId   = "client_operation_id4e51b631",
                StatusMessage       = "status_message2c618f86",
                HttpErrorStatusCode = 1766362655,
                Description         = "description2cf9da67",
                InsertTime          = "insert_time7467185a",
                SelfLink            = "self_link7e87f12d",
                Warnings            = { new Warnings(), },
            };

            mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            RoutesClient client   = new RoutesClientImpl(mockGrpcClient.Object, null);
            Operation    response = client.Delete(request);

            xunit::Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
예제 #13
0
        /// <summary>Snippet for DeleteAsync</summary>
        public async Task DeleteRequestObjectAsync()
        {
            // Snippet: DeleteAsync(DeleteRouteRequest, CallSettings)
            // Additional: DeleteAsync(DeleteRouteRequest, CancellationToken)
            // Create client
            RoutesClient routesClient = await RoutesClient.CreateAsync();

            // Initialize request argument(s)
            DeleteRouteRequest request = new DeleteRouteRequest
            {
                RequestId = "",
                Route     = "",
                Project   = "",
            };
            // Make the request
            Operation response = await routesClient.DeleteAsync(request);

            // End snippet
        }
 /// <summary>
 /// Deletes the specified Route resource.
 /// </summary>
 /// <param name="request">The request object containing all of the parameters for the API call.</param>
 /// <param name="callSettings">If not null, applies overrides to this RPC call.</param>
 /// <returns>A Task containing the RPC response.</returns>
 public override stt::Task <Operation> DeleteAsync(DeleteRouteRequest request, gaxgrpc::CallSettings callSettings = null)
 {
     Modify_DeleteRouteRequest(ref request, ref callSettings);
     return(_callDelete.Async(request, callSettings));
 }
 /// <summary>
 /// Deletes the specified Route resource.
 /// </summary>
 /// <param name="request">The request object containing all of the parameters for the API call.</param>
 /// <param name="callSettings">If not null, applies overrides to this RPC call.</param>
 /// <returns>The RPC response.</returns>
 public override Operation Delete(DeleteRouteRequest request, gaxgrpc::CallSettings callSettings = null)
 {
     Modify_DeleteRouteRequest(ref request, ref callSettings);
     return(_callDelete.Sync(request, callSettings));
 }
 partial void Modify_DeleteRouteRequest(ref DeleteRouteRequest request, ref gaxgrpc::CallSettings settings);
 /// <summary>
 /// Deletes the specified Route resource.
 /// </summary>
 /// <param name="request">The request object containing all of the parameters for the API call.</param>
 /// <param name="cancellationToken">A <see cref="st::CancellationToken"/> to use for this RPC.</param>
 /// <returns>A Task containing the RPC response.</returns>
 public virtual stt::Task <Operation> DeleteAsync(DeleteRouteRequest request, st::CancellationToken cancellationToken) =>
 DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken));
 /// <summary>
 /// Deletes the specified Route resource.
 /// </summary>
 /// <param name="request">The request object containing all of the parameters for the API call.</param>
 /// <param name="callSettings">If not null, applies overrides to this RPC call.</param>
 /// <returns>A Task containing the RPC response.</returns>
 public virtual stt::Task <Operation> DeleteAsync(DeleteRouteRequest request, gaxgrpc::CallSettings callSettings = null) =>
 throw new sys::NotImplementedException();
 /// <summary>
 /// Deletes the specified Route resource.
 /// </summary>
 /// <param name="request">The request object containing all of the parameters for the API call.</param>
 /// <param name="callSettings">If not null, applies overrides to this RPC call.</param>
 /// <returns>The RPC response.</returns>
 public virtual Operation Delete(DeleteRouteRequest request, gaxgrpc::CallSettings callSettings = null) =>
 throw new sys::NotImplementedException();
예제 #20
0
        /// <summary>
        /// Deletes the specified Route resource.
        /// </summary>
        /// <param name="request">The request object containing all of the parameters for the API call.</param>
        /// <param name="callSettings">If not null, applies overrides to this RPC call.</param>
        /// <returns>A Task containing the RPC response.</returns>
        public override async stt::Task <lro::Operation <Operation, Operation> > DeleteAsync(DeleteRouteRequest request, gaxgrpc::CallSettings callSettings = null)
        {
            Modify_DeleteRouteRequest(ref request, ref callSettings);
            Operation response = await _callDelete.Async(request, callSettings).ConfigureAwait(false);

            GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response);

            request.PopulatePollRequestFields(pollRequest);
            return(new lro::Operation <Operation, Operation>(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient));
        }
예제 #21
0
        public IActionResult Delete([FromBody] DeleteRouteRequest request)
        {
            _deleteRouteCommand.Execute(request);

            return(NoContent());
        }