Exemplo n.º 1
0
 /// <summary>Snippet for GetDistanceView</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GetDistanceViewResourceNames()
 {
     // Create client
     DistanceViewServiceClient distanceViewServiceClient = DistanceViewServiceClient.Create();
     // Initialize request argument(s)
     DistanceViewName resourceName = DistanceViewName.FromCustomerPlaceholderChainDistanceBucket("[CUSTOMER_ID]", "[PLACEHOLDER_CHAIN_ID]", "[DISTANCE_BUCKET]");
     // Make the request
     DistanceView response = distanceViewServiceClient.GetDistanceView(resourceName);
 }
Exemplo n.º 2
0
 /// <summary>Snippet for GetDistanceView</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GetDistanceViewResourceNames()
 {
     // Create client
     DistanceViewServiceClient distanceViewServiceClient = DistanceViewServiceClient.Create();
     // Initialize request argument(s)
     DistanceViewName resourceName = DistanceViewName.FromCustomerDistanceView("[CUSTOMER]", "[DISTANCE_VIEW]");
     // Make the request
     DistanceView response = distanceViewServiceClient.GetDistanceView(resourceName);
 }
        /// <summary>Snippet for GetDistanceViewAsync</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 GetDistanceViewResourceNamesAsync()
        {
            // Create client
            DistanceViewServiceClient distanceViewServiceClient = await DistanceViewServiceClient.CreateAsync();

            // Initialize request argument(s)
            DistanceViewName resourceName = DistanceViewName.FromCustomerDistanceView("[CUSTOMER]", "[DISTANCE_VIEW]");
            // Make the request
            DistanceView response = await distanceViewServiceClient.GetDistanceViewAsync(resourceName);
        }
Exemplo n.º 4
0
        /// <summary>Snippet for GetDistanceViewAsync</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 GetDistanceViewRequestObjectAsync()
        {
            // Create client
            DistanceViewServiceClient distanceViewServiceClient = await DistanceViewServiceClient.CreateAsync();

            // Initialize request argument(s)
            GetDistanceViewRequest request = new GetDistanceViewRequest
            {
                ResourceNameAsDistanceViewName = DistanceViewName.FromCustomerPlaceholderChainDistanceBucket("[CUSTOMER_ID]", "[PLACEHOLDER_CHAIN_ID]", "[DISTANCE_BUCKET]"),
            };
            // Make the request
            DistanceView response = await distanceViewServiceClient.GetDistanceViewAsync(request);
        }
 /// <summary>Snippet for GetDistanceView</summary>
 public void GetDistanceViewRequestObject()
 {
     // Snippet: GetDistanceView(GetDistanceViewRequest, CallSettings)
     // Create client
     DistanceViewServiceClient distanceViewServiceClient = DistanceViewServiceClient.Create();
     // Initialize request argument(s)
     GetDistanceViewRequest request = new GetDistanceViewRequest
     {
         ResourceNameAsDistanceViewName = DistanceViewName.FromCustomerDistanceView("[CUSTOMER]", "[DISTANCE_VIEW]"),
     };
     // Make the request
     DistanceView response = distanceViewServiceClient.GetDistanceView(request);
     // End snippet
 }
        /// <summary>Snippet for GetDistanceViewAsync</summary>
        public async Task GetDistanceViewResourceNamesAsync()
        {
            // Snippet: GetDistanceViewAsync(DistanceViewName, CallSettings)
            // Additional: GetDistanceViewAsync(DistanceViewName, CancellationToken)
            // Create client
            DistanceViewServiceClient distanceViewServiceClient = await DistanceViewServiceClient.CreateAsync();

            // Initialize request argument(s)
            DistanceViewName resourceName = DistanceViewName.FromCustomerDistanceView("[CUSTOMER]", "[DISTANCE_VIEW]");
            // Make the request
            DistanceView response = await distanceViewServiceClient.GetDistanceViewAsync(resourceName);

            // End snippet
        }
Exemplo n.º 7
0
 /// <summary>Snippet for GetDistanceView</summary>
 public void GetDistanceViewRequestObject()
 {
     // Snippet: GetDistanceView(GetDistanceViewRequest, CallSettings)
     // Create client
     DistanceViewServiceClient distanceViewServiceClient = DistanceViewServiceClient.Create();
     // Initialize request argument(s)
     GetDistanceViewRequest request = new GetDistanceViewRequest
     {
         ResourceNameAsDistanceViewName = DistanceViewName.FromCustomerPlaceholderChainDistanceBucket("[CUSTOMER_ID]", "[PLACEHOLDER_CHAIN_ID]", "[DISTANCE_BUCKET]"),
     };
     // Make the request
     DistanceView response = distanceViewServiceClient.GetDistanceView(request);
     // End snippet
 }
Exemplo n.º 8
0
        /// <summary>Snippet for GetDistanceViewAsync</summary>
        public async Task GetDistanceViewResourceNamesAsync()
        {
            // Snippet: GetDistanceViewAsync(DistanceViewName, CallSettings)
            // Additional: GetDistanceViewAsync(DistanceViewName, CancellationToken)
            // Create client
            DistanceViewServiceClient distanceViewServiceClient = await DistanceViewServiceClient.CreateAsync();

            // Initialize request argument(s)
            DistanceViewName resourceName = DistanceViewName.FromCustomerPlaceholderChainDistanceBucket("[CUSTOMER_ID]", "[PLACEHOLDER_CHAIN_ID]", "[DISTANCE_BUCKET]");
            // Make the request
            DistanceView response = await distanceViewServiceClient.GetDistanceViewAsync(resourceName);

            // End snippet
        }
        public async Task GetDistanceViewAsync()
        {
            Mock <DistanceViewService.DistanceViewServiceClient> mockGrpcClient = new Mock <DistanceViewService.DistanceViewServiceClient>(MockBehavior.Strict);
            GetDistanceViewRequest expectedRequest = new GetDistanceViewRequest
            {
                ResourceName = new DistanceViewName("[CUSTOMER]", "[DISTANCE_VIEW]").ToString(),
            };
            DistanceView expectedResponse = new DistanceView
            {
                ResourceName = "resourceName2625949903",
            };

            mockGrpcClient.Setup(x => x.GetDistanceViewAsync(expectedRequest, It.IsAny <CallOptions>()))
            .Returns(new Grpc.Core.AsyncUnaryCall <DistanceView>(Task.FromResult(expectedResponse), null, null, null, null));
            DistanceViewServiceClient client   = new DistanceViewServiceClientImpl(mockGrpcClient.Object, null);
            string       formattedResourceName = new DistanceViewName("[CUSTOMER]", "[DISTANCE_VIEW]").ToString();
            DistanceView response = await client.GetDistanceViewAsync(formattedResourceName);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }