コード例 #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);
 }
コード例 #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);
        }
コード例 #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);
 }
コード例 #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);
        }
コード例 #5
0
        /// <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
        }
コード例 #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();
        }
コード例 #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();
        }