Ejemplo n.º 1
0
 /// <summary>Snippet for GetGeographicView</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GetGeographicViewResourceNames()
 {
     // Create client
     GeographicViewServiceClient geographicViewServiceClient = GeographicViewServiceClient.Create();
     // Initialize request argument(s)
     GeographicViewName resourceName = GeographicViewName.FromCustomerGeographicView("[CUSTOMER]", "[GEOGRAPHIC_VIEW]");
     // Make the request
     GeographicView response = geographicViewServiceClient.GetGeographicView(resourceName);
 }
 /// <summary>Snippet for GetGeographicView</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GetGeographicViewResourceNames()
 {
     // Create client
     GeographicViewServiceClient geographicViewServiceClient = GeographicViewServiceClient.Create();
     // Initialize request argument(s)
     GeographicViewName resourceName = GeographicViewName.FromCustomerCountryCriterionLocationType("[CUSTOMER_ID]", "[COUNTRY_CRITERION_ID]", "[LOCATION_TYPE]");
     // Make the request
     GeographicView response = geographicViewServiceClient.GetGeographicView(resourceName);
 }
        /// <summary>Snippet for GetGeographicViewAsync</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 GetGeographicViewRequestObjectAsync()
        {
            // Create client
            GeographicViewServiceClient geographicViewServiceClient = await GeographicViewServiceClient.CreateAsync();

            // Initialize request argument(s)
            GetGeographicViewRequest request = new GetGeographicViewRequest
            {
                ResourceNameAsGeographicViewName = GeographicViewName.FromCustomerCountryCriterionLocationType("[CUSTOMER_ID]", "[COUNTRY_CRITERION_ID]", "[LOCATION_TYPE]"),
            };
            // Make the request
            GeographicView response = await geographicViewServiceClient.GetGeographicViewAsync(request);
        }
        /// <summary>Snippet for GetGeographicViewAsync</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 GetGeographicViewRequestObjectAsync()
        {
            // Create client
            GeographicViewServiceClient geographicViewServiceClient = await GeographicViewServiceClient.CreateAsync();

            // Initialize request argument(s)
            GetGeographicViewRequest request = new GetGeographicViewRequest
            {
                ResourceNameAsGeographicViewName = GeographicViewName.FromCustomerGeographicView("[CUSTOMER]", "[GEOGRAPHIC_VIEW]"),
            };
            // Make the request
            GeographicView response = await geographicViewServiceClient.GetGeographicViewAsync(request);
        }
Ejemplo n.º 5
0
 /// <summary>Snippet for GetGeographicView</summary>
 public void GetGeographicViewRequestObject()
 {
     // Snippet: GetGeographicView(GetGeographicViewRequest, CallSettings)
     // Create client
     GeographicViewServiceClient geographicViewServiceClient = GeographicViewServiceClient.Create();
     // Initialize request argument(s)
     GetGeographicViewRequest request = new GetGeographicViewRequest
     {
         ResourceNameAsGeographicViewName = GeographicViewName.FromCustomerGeographicView("[CUSTOMER]", "[GEOGRAPHIC_VIEW]"),
     };
     // Make the request
     GeographicView response = geographicViewServiceClient.GetGeographicView(request);
     // End snippet
 }
Ejemplo n.º 6
0
        /// <summary>Snippet for GetGeographicViewAsync</summary>
        public async Task GetGeographicViewResourceNamesAsync()
        {
            // Snippet: GetGeographicViewAsync(GeographicViewName, CallSettings)
            // Additional: GetGeographicViewAsync(GeographicViewName, CancellationToken)
            // Create client
            GeographicViewServiceClient geographicViewServiceClient = await GeographicViewServiceClient.CreateAsync();

            // Initialize request argument(s)
            GeographicViewName resourceName = GeographicViewName.FromCustomerGeographicView("[CUSTOMER]", "[GEOGRAPHIC_VIEW]");
            // Make the request
            GeographicView response = await geographicViewServiceClient.GetGeographicViewAsync(resourceName);

            // End snippet
        }
Ejemplo n.º 7
0
 /// <summary>Snippet for GetGeographicView</summary>
 public void GetGeographicViewRequestObject()
 {
     // Snippet: GetGeographicView(GetGeographicViewRequest, CallSettings)
     // Create client
     GeographicViewServiceClient geographicViewServiceClient = GeographicViewServiceClient.Create();
     // Initialize request argument(s)
     GetGeographicViewRequest request = new GetGeographicViewRequest
     {
         ResourceNameAsGeographicViewName = GeographicViewName.FromCustomerCountryCriterionLocationType("[CUSTOMER_ID]", "[COUNTRY_CRITERION_ID]", "[LOCATION_TYPE]"),
     };
     // Make the request
     GeographicView response = geographicViewServiceClient.GetGeographicView(request);
     // End snippet
 }
Ejemplo n.º 8
0
        /// <summary>Snippet for GetGeographicViewAsync</summary>
        public async Task GetGeographicViewResourceNamesAsync()
        {
            // Snippet: GetGeographicViewAsync(GeographicViewName, CallSettings)
            // Additional: GetGeographicViewAsync(GeographicViewName, CancellationToken)
            // Create client
            GeographicViewServiceClient geographicViewServiceClient = await GeographicViewServiceClient.CreateAsync();

            // Initialize request argument(s)
            GeographicViewName resourceName = GeographicViewName.FromCustomerCountryCriterionLocationType("[CUSTOMER_ID]", "[COUNTRY_CRITERION_ID]", "[LOCATION_TYPE]");
            // Make the request
            GeographicView response = await geographicViewServiceClient.GetGeographicViewAsync(resourceName);

            // End snippet
        }
Ejemplo n.º 9
0
        public async Task GetGeographicViewAsync()
        {
            Mock <GeographicViewService.GeographicViewServiceClient> mockGrpcClient = new Mock <GeographicViewService.GeographicViewServiceClient>(MockBehavior.Strict);
            GetGeographicViewRequest expectedRequest = new GetGeographicViewRequest
            {
                ResourceName = new GeographicViewName("[CUSTOMER]", "[GEOGRAPHIC_VIEW]").ToString(),
            };
            GeographicView expectedResponse = new GeographicView
            {
                ResourceName = "resourceName2625949903",
            };

            mockGrpcClient.Setup(x => x.GetGeographicViewAsync(expectedRequest, It.IsAny <CallOptions>()))
            .Returns(new Grpc.Core.AsyncUnaryCall <GeographicView>(Task.FromResult(expectedResponse), null, null, null, null));
            GeographicViewServiceClient client   = new GeographicViewServiceClientImpl(mockGrpcClient.Object, null);
            string         formattedResourceName = new GeographicViewName("[CUSTOMER]", "[GEOGRAPHIC_VIEW]").ToString();
            GeographicView response = await client.GetGeographicViewAsync(formattedResourceName);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
Ejemplo n.º 10
0
        public void GetGeographicView()
        {
            Mock <GeographicViewService.GeographicViewServiceClient> mockGrpcClient = new Mock <GeographicViewService.GeographicViewServiceClient>(MockBehavior.Strict);
            GetGeographicViewRequest expectedRequest = new GetGeographicViewRequest
            {
                ResourceName = new GeographicViewName("[CUSTOMER]", "[GEOGRAPHIC_VIEW]").ToString(),
            };
            GeographicView expectedResponse = new GeographicView
            {
                ResourceName = "resourceName2625949903",
            };

            mockGrpcClient.Setup(x => x.GetGeographicView(expectedRequest, It.IsAny <CallOptions>()))
            .Returns(expectedResponse);
            GeographicViewServiceClient client   = new GeographicViewServiceClientImpl(mockGrpcClient.Object, null);
            string         formattedResourceName = new GeographicViewName("[CUSTOMER]", "[GEOGRAPHIC_VIEW]").ToString();
            GeographicView response = client.GetGeographicView(formattedResourceName);

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