Exemplo n.º 1
0
 /// <summary>Snippet for BatchCreateReadSessionStreams</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void BatchCreateReadSessionStreams()
 {
     // Create client
     BigQueryStorageClient bigQueryStorageClient = BigQueryStorageClient.Create();
     // Initialize request argument(s)
     ReadSession session          = new ReadSession();
     int         requestedStreams = 0;
     // Make the request
     BatchCreateReadSessionStreamsResponse response = bigQueryStorageClient.BatchCreateReadSessionStreams(session, requestedStreams);
 }
Exemplo n.º 2
0
        /// <summary>Snippet for BatchCreateReadSessionStreamsAsync</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public async Task BatchCreateReadSessionStreamsAsync()
        {
            // Create client
            BigQueryStorageClient bigQueryStorageClient = await BigQueryStorageClient.CreateAsync();

            // Initialize request argument(s)
            ReadSession session          = new ReadSession();
            int         requestedStreams = 0;
            // Make the request
            BatchCreateReadSessionStreamsResponse response = await bigQueryStorageClient.BatchCreateReadSessionStreamsAsync(session, requestedStreams);
        }
Exemplo n.º 3
0
 /// <summary>Snippet for BatchCreateReadSessionStreams</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void BatchCreateReadSessionStreamsRequestObject()
 {
     // Create client
     BigQueryStorageClient bigQueryStorageClient = BigQueryStorageClient.Create();
     // Initialize request argument(s)
     BatchCreateReadSessionStreamsRequest request = new BatchCreateReadSessionStreamsRequest
     {
         Session          = new ReadSession(),
         RequestedStreams = 0,
     };
     // Make the request
     BatchCreateReadSessionStreamsResponse response = bigQueryStorageClient.BatchCreateReadSessionStreams(request);
 }
Exemplo n.º 4
0
        /// <summary>Snippet for BatchCreateReadSessionStreamsAsync</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public async Task BatchCreateReadSessionStreamsRequestObjectAsync()
        {
            // Create client
            BigQueryStorageClient bigQueryStorageClient = await BigQueryStorageClient.CreateAsync();

            // Initialize request argument(s)
            BatchCreateReadSessionStreamsRequest request = new BatchCreateReadSessionStreamsRequest
            {
                Session          = new ReadSession(),
                RequestedStreams = 0,
            };
            // Make the request
            BatchCreateReadSessionStreamsResponse response = await bigQueryStorageClient.BatchCreateReadSessionStreamsAsync(request);
        }
        /// <summary>Snippet for BatchCreateReadSessionStreamsAsync</summary>
        public async Task BatchCreateReadSessionStreamsAsync()
        {
            // Snippet: BatchCreateReadSessionStreamsAsync(ReadSession, int, CallSettings)
            // Additional: BatchCreateReadSessionStreamsAsync(ReadSession, int, CancellationToken)
            // Create client
            BigQueryStorageClient bigQueryStorageClient = await BigQueryStorageClient.CreateAsync();

            // Initialize request argument(s)
            ReadSession session          = new ReadSession();
            int         requestedStreams = 0;
            // Make the request
            BatchCreateReadSessionStreamsResponse response = await bigQueryStorageClient.BatchCreateReadSessionStreamsAsync(session, requestedStreams);

            // End snippet
        }
Exemplo n.º 6
0
        public void BatchCreateReadSessionStreams()
        {
            moq::Mock <BigQueryStorage.BigQueryStorageClient> mockGrpcClient = new moq::Mock <BigQueryStorage.BigQueryStorageClient>(moq::MockBehavior.Strict);
            BatchCreateReadSessionStreamsRequest request = new BatchCreateReadSessionStreamsRequest
            {
                Session          = new ReadSession(),
                RequestedStreams = -1338971660,
            };
            BatchCreateReadSessionStreamsResponse expectedResponse = new BatchCreateReadSessionStreamsResponse
            {
                Streams = { new Stream(), },
            };

            mockGrpcClient.Setup(x => x.BatchCreateReadSessionStreams(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            BigQueryStorageClient client = new BigQueryStorageClientImpl(mockGrpcClient.Object, null);
            BatchCreateReadSessionStreamsResponse response = client.BatchCreateReadSessionStreams(request.Session, request.RequestedStreams);

            xunit::Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
Exemplo n.º 7
0
        public async stt::Task BatchCreateReadSessionStreamsAsync()
        {
            moq::Mock <BigQueryStorage.BigQueryStorageClient> mockGrpcClient = new moq::Mock <BigQueryStorage.BigQueryStorageClient>(moq::MockBehavior.Strict);
            BatchCreateReadSessionStreamsRequest request = new BatchCreateReadSessionStreamsRequest
            {
                Session          = new ReadSession(),
                RequestedStreams = -1338971660,
            };
            BatchCreateReadSessionStreamsResponse expectedResponse = new BatchCreateReadSessionStreamsResponse
            {
                Streams = { new Stream(), },
            };

            mockGrpcClient.Setup(x => x.BatchCreateReadSessionStreamsAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <BatchCreateReadSessionStreamsResponse>(stt::Task.FromResult(expectedResponse), null, null, null, null));
            BigQueryStorageClient client = new BigQueryStorageClientImpl(mockGrpcClient.Object, null);
            BatchCreateReadSessionStreamsResponse responseCallSettings = await client.BatchCreateReadSessionStreamsAsync(request.Session, request.RequestedStreams, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None));

            xunit::Assert.Same(expectedResponse, responseCallSettings);
            BatchCreateReadSessionStreamsResponse responseCancellationToken = await client.BatchCreateReadSessionStreamsAsync(request.Session, request.RequestedStreams, st::CancellationToken.None);

            xunit::Assert.Same(expectedResponse, responseCancellationToken);
            mockGrpcClient.VerifyAll();
        }