/// <summary>Snippet for StartMigrationWorkflow</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void StartMigrationWorkflowRequestObject() { // Create client MigrationServiceClient migrationServiceClient = MigrationServiceClient.Create(); // Initialize request argument(s) StartMigrationWorkflowRequest request = new StartMigrationWorkflowRequest { MigrationWorkflowName = MigrationWorkflowName.FromProjectLocationWorkflow("[PROJECT]", "[LOCATION]", "[WORKFLOW]"), }; // Make the request migrationServiceClient.StartMigrationWorkflow(request); }
public void StartMigrationWorkflowResourceNames() { moq::Mock <MigrationService.MigrationServiceClient> mockGrpcClient = new moq::Mock <MigrationService.MigrationServiceClient>(moq::MockBehavior.Strict); StartMigrationWorkflowRequest request = new StartMigrationWorkflowRequest { MigrationWorkflowName = MigrationWorkflowName.FromProjectLocationWorkflow("[PROJECT]", "[LOCATION]", "[WORKFLOW]"), }; wkt::Empty expectedResponse = new wkt::Empty { }; mockGrpcClient.Setup(x => x.StartMigrationWorkflow(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); MigrationServiceClient client = new MigrationServiceClientImpl(mockGrpcClient.Object, null); client.StartMigrationWorkflow(request.MigrationWorkflowName); mockGrpcClient.VerifyAll(); }
public async stt::Task StartMigrationWorkflowResourceNamesAsync() { moq::Mock <MigrationService.MigrationServiceClient> mockGrpcClient = new moq::Mock <MigrationService.MigrationServiceClient>(moq::MockBehavior.Strict); StartMigrationWorkflowRequest request = new StartMigrationWorkflowRequest { MigrationWorkflowName = MigrationWorkflowName.FromProjectLocationWorkflow("[PROJECT]", "[LOCATION]", "[WORKFLOW]"), }; wkt::Empty expectedResponse = new wkt::Empty { }; mockGrpcClient.Setup(x => x.StartMigrationWorkflowAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <wkt::Empty>(stt::Task.FromResult(expectedResponse), null, null, null, null)); MigrationServiceClient client = new MigrationServiceClientImpl(mockGrpcClient.Object, null); await client.StartMigrationWorkflowAsync(request.MigrationWorkflowName, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); await client.StartMigrationWorkflowAsync(request.MigrationWorkflowName, st::CancellationToken.None); mockGrpcClient.VerifyAll(); }