public void DeleteTransitionRouteGroupResourceNames() { moq::Mock <TransitionRouteGroups.TransitionRouteGroupsClient> mockGrpcClient = new moq::Mock <TransitionRouteGroups.TransitionRouteGroupsClient>(moq::MockBehavior.Strict); DeleteTransitionRouteGroupRequest request = new DeleteTransitionRouteGroupRequest { TransitionRouteGroupName = TransitionRouteGroupName.FromProjectLocationAgentFlowTransitionRouteGroup("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]"), }; wkt::Empty expectedResponse = new wkt::Empty { }; mockGrpcClient.Setup(x => x.DeleteTransitionRouteGroup(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); TransitionRouteGroupsClient client = new TransitionRouteGroupsClientImpl(mockGrpcClient.Object, null); client.DeleteTransitionRouteGroup(request.TransitionRouteGroupName); mockGrpcClient.VerifyAll(); }
/// <summary>Snippet for DeleteTransitionRouteGroup</summary> public void DeleteTransitionRouteGroupRequestObject() { // Snippet: DeleteTransitionRouteGroup(DeleteTransitionRouteGroupRequest, CallSettings) // Create client TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.Create(); // Initialize request argument(s) DeleteTransitionRouteGroupRequest request = new DeleteTransitionRouteGroupRequest { TransitionRouteGroupName = TransitionRouteGroupName.FromProjectLocationAgentFlowTransitionRouteGroup("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]"), Force = false, }; // Make the request transitionRouteGroupsClient.DeleteTransitionRouteGroup(request); // End snippet }
public async stt::Task DeleteTransitionRouteGroupResourceNamesAsync() { moq::Mock <TransitionRouteGroups.TransitionRouteGroupsClient> mockGrpcClient = new moq::Mock <TransitionRouteGroups.TransitionRouteGroupsClient>(moq::MockBehavior.Strict); DeleteTransitionRouteGroupRequest request = new DeleteTransitionRouteGroupRequest { TransitionRouteGroupName = TransitionRouteGroupName.FromProjectLocationAgentFlowTransitionRouteGroup("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]"), }; wkt::Empty expectedResponse = new wkt::Empty { }; mockGrpcClient.Setup(x => x.DeleteTransitionRouteGroupAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <wkt::Empty>(stt::Task.FromResult(expectedResponse), null, null, null, null)); TransitionRouteGroupsClient client = new TransitionRouteGroupsClientImpl(mockGrpcClient.Object, null); await client.DeleteTransitionRouteGroupAsync(request.TransitionRouteGroupName, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); await client.DeleteTransitionRouteGroupAsync(request.TransitionRouteGroupName, st::CancellationToken.None); mockGrpcClient.VerifyAll(); }
/// <summary>Snippet for DeleteTransitionRouteGroupAsync</summary> public async Task DeleteTransitionRouteGroupRequestObjectAsync() { // Snippet: DeleteTransitionRouteGroupAsync(DeleteTransitionRouteGroupRequest, CallSettings) // Additional: DeleteTransitionRouteGroupAsync(DeleteTransitionRouteGroupRequest, CancellationToken) // Create client TransitionRouteGroupsClient transitionRouteGroupsClient = await TransitionRouteGroupsClient.CreateAsync(); // Initialize request argument(s) DeleteTransitionRouteGroupRequest request = new DeleteTransitionRouteGroupRequest { TransitionRouteGroupName = TransitionRouteGroupName.FromProjectLocationAgentFlowTransitionRouteGroup("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]"), Force = false, }; // Make the request await transitionRouteGroupsClient.DeleteTransitionRouteGroupAsync(request); // End snippet }