Пример #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 GetGeographicView()
 {
     // Create client
     GeographicViewServiceClient geographicViewServiceClient = GeographicViewServiceClient.Create();
     // Initialize request argument(s)
     string resourceName = "customers/[CUSTOMER_ID]/geographicViews/[COUNTRY_CRITERION_ID]~[LOCATION_TYPE]";
     // Make the request
     GeographicView response = geographicViewServiceClient.GetGeographicView(resourceName);
 }
Пример #3
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 GetGeographicView()
 {
     // Create client
     GeographicViewServiceClient geographicViewServiceClient = GeographicViewServiceClient.Create();
     // Initialize request argument(s)
     string resourceName = "customers/[CUSTOMER]/geographicViews/[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);
        }
Пример #7
0
        /// <summary>Snippet for GetGeographicViewAsync</summary>
        public async Task GetGeographicViewAsync()
        {
            // Snippet: GetGeographicViewAsync(string, CallSettings)
            // Additional: GetGeographicViewAsync(string, CancellationToken)
            // Create client
            GeographicViewServiceClient geographicViewServiceClient = await GeographicViewServiceClient.CreateAsync();

            // Initialize request argument(s)
            string resourceName = "customers/[CUSTOMER]/geographicViews/[GEOGRAPHIC_VIEW]";
            // Make the request
            GeographicView response = await geographicViewServiceClient.GetGeographicViewAsync(resourceName);

            // End snippet
        }
Пример #8
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
 }
Пример #9
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
        }
Пример #10
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
 }
Пример #11
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
        }
Пример #12
0
        public void GetGeographicView2()
        {
            Mock <GeographicViewService.GeographicViewServiceClient> mockGrpcClient = new Mock <GeographicViewService.GeographicViewServiceClient>(MockBehavior.Strict);
            GetGeographicViewRequest request = new GetGeographicViewRequest
            {
                ResourceName = new GeographicViewName("[CUSTOMER]", "[GEOGRAPHIC_VIEW]").ToString(),
            };
            GeographicView expectedResponse = new GeographicView
            {
                ResourceName = "resourceName2625949903",
            };

            mockGrpcClient.Setup(x => x.GetGeographicView(request, It.IsAny <CallOptions>()))
            .Returns(expectedResponse);
            GeographicViewServiceClient client = new GeographicViewServiceClientImpl(mockGrpcClient.Object, null);
            GeographicView response            = client.GetGeographicView(request);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
Пример #13
0
        public async Task GetGeographicViewAsync2()
        {
            Mock <GeographicViewService.GeographicViewServiceClient> mockGrpcClient = new Mock <GeographicViewService.GeographicViewServiceClient>(MockBehavior.Strict);
            GetGeographicViewRequest request = new GetGeographicViewRequest
            {
                ResourceName = new GeographicViewName("[CUSTOMER]", "[GEOGRAPHIC_VIEW]").ToString(),
            };
            GeographicView expectedResponse = new GeographicView
            {
                ResourceName = "resourceName2625949903",
            };

            mockGrpcClient.Setup(x => x.GetGeographicViewAsync(request, It.IsAny <CallOptions>()))
            .Returns(new Grpc.Core.AsyncUnaryCall <GeographicView>(Task.FromResult(expectedResponse), null, null, null, null));
            GeographicViewServiceClient client = new GeographicViewServiceClientImpl(mockGrpcClient.Object, null);
            GeographicView response            = await client.GetGeographicViewAsync(request);

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