Ejemplo n.º 1
0
 /// <summary>Snippet for GetCustomInterest</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GetCustomInterestResourceNames()
 {
     // Create client
     CustomInterestServiceClient customInterestServiceClient = CustomInterestServiceClient.Create();
     // Initialize request argument(s)
     CustomInterestName resourceName = CustomInterestName.FromCustomerCustomInterest("[CUSTOMER]", "[CUSTOM_INTEREST]");
     // Make the request
     CustomInterest response = customInterestServiceClient.GetCustomInterest(resourceName);
 }
 /// <summary>Snippet for GetCustomInterest</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GetCustomInterest()
 {
     // Create client
     CustomInterestServiceClient customInterestServiceClient = CustomInterestServiceClient.Create();
     // Initialize request argument(s)
     string resourceName = "customers/[CUSTOMER_ID]/customInterests/[CUSTOM_INTEREST_ID]";
     // Make the request
     CustomInterest response = customInterestServiceClient.GetCustomInterest(resourceName);
 }
        /// <summary>Snippet for GetCustomInterestAsync</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 GetCustomInterestResourceNamesAsync()
        {
            // Create client
            CustomInterestServiceClient customInterestServiceClient = await CustomInterestServiceClient.CreateAsync();

            // Initialize request argument(s)
            CustomInterestName resourceName = CustomInterestName.FromCustomerCustomInterest("[CUSTOMER_ID]", "[CUSTOM_INTEREST_ID]");
            // Make the request
            CustomInterest response = await customInterestServiceClient.GetCustomInterestAsync(resourceName);
        }
Ejemplo n.º 4
0
        /// <summary>Snippet for GetCustomInterestAsync</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 GetCustomInterestAsync()
        {
            // Create client
            CustomInterestServiceClient customInterestServiceClient = await CustomInterestServiceClient.CreateAsync();

            // Initialize request argument(s)
            string resourceName = "customers/[CUSTOMER]/customInterests/[CUSTOM_INTEREST]";
            // Make the request
            CustomInterest response = await customInterestServiceClient.GetCustomInterestAsync(resourceName);
        }
 /// <summary>Snippet for GetCustomInterest</summary>
 public void GetCustomInterest()
 {
     // Snippet: GetCustomInterest(string, CallSettings)
     // Create client
     CustomInterestServiceClient customInterestServiceClient = CustomInterestServiceClient.Create();
     // Initialize request argument(s)
     string resourceName = "customers/[CUSTOMER]/customInterests/[CUSTOM_INTEREST]";
     // Make the request
     CustomInterest response = customInterestServiceClient.GetCustomInterest(resourceName);
     // End snippet
 }
 /// <summary>Snippet for GetCustomInterest</summary>
 public void GetCustomInterestResourceNames()
 {
     // Snippet: GetCustomInterest(CustomInterestName, CallSettings)
     // Create client
     CustomInterestServiceClient customInterestServiceClient = CustomInterestServiceClient.Create();
     // Initialize request argument(s)
     CustomInterestName resourceName = CustomInterestName.FromCustomerCustomInterest("[CUSTOMER_ID]", "[CUSTOM_INTEREST_ID]");
     // Make the request
     CustomInterest response = customInterestServiceClient.GetCustomInterest(resourceName);
     // End snippet
 }
Ejemplo n.º 7
0
 /// <summary>Snippet for GetCustomInterest</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GetCustomInterestRequestObject()
 {
     // Create client
     CustomInterestServiceClient customInterestServiceClient = CustomInterestServiceClient.Create();
     // Initialize request argument(s)
     GetCustomInterestRequest request = new GetCustomInterestRequest
     {
         ResourceNameAsCustomInterestName = CustomInterestName.FromCustomerCustomInterest("[CUSTOMER_ID]", "[CUSTOM_INTEREST_ID]"),
     };
     // Make the request
     CustomInterest response = customInterestServiceClient.GetCustomInterest(request);
 }
        /// <summary>Snippet for GetCustomInterestAsync</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 GetCustomInterestRequestObjectAsync()
        {
            // Create client
            CustomInterestServiceClient customInterestServiceClient = await CustomInterestServiceClient.CreateAsync();

            // Initialize request argument(s)
            GetCustomInterestRequest request = new GetCustomInterestRequest
            {
                ResourceNameAsCustomInterestName = CustomInterestName.FromCustomerCustomInterest("[CUSTOMER]", "[CUSTOM_INTEREST]"),
            };
            // Make the request
            CustomInterest response = await customInterestServiceClient.GetCustomInterestAsync(request);
        }
        /// <summary>Snippet for GetCustomInterestAsync</summary>
        public async Task GetCustomInterestAsync()
        {
            // Snippet: GetCustomInterestAsync(string, CallSettings)
            // Additional: GetCustomInterestAsync(string, CancellationToken)
            // Create client
            CustomInterestServiceClient customInterestServiceClient = await CustomInterestServiceClient.CreateAsync();

            // Initialize request argument(s)
            string resourceName = "customers/[CUSTOMER]/customInterests/[CUSTOM_INTEREST]";
            // Make the request
            CustomInterest response = await customInterestServiceClient.GetCustomInterestAsync(resourceName);

            // End snippet
        }
        /// <summary>Snippet for GetCustomInterestAsync</summary>
        public async Task GetCustomInterestResourceNamesAsync()
        {
            // Snippet: GetCustomInterestAsync(CustomInterestName, CallSettings)
            // Additional: GetCustomInterestAsync(CustomInterestName, CancellationToken)
            // Create client
            CustomInterestServiceClient customInterestServiceClient = await CustomInterestServiceClient.CreateAsync();

            // Initialize request argument(s)
            CustomInterestName resourceName = CustomInterestName.FromCustomerCustomInterest("[CUSTOMER]", "[CUSTOM_INTEREST]");
            // Make the request
            CustomInterest response = await customInterestServiceClient.GetCustomInterestAsync(resourceName);

            // End snippet
        }
Ejemplo n.º 11
0
        public void GetCustomInterest2()
        {
            Mock <CustomInterestService.CustomInterestServiceClient> mockGrpcClient = new Mock <CustomInterestService.CustomInterestServiceClient>(MockBehavior.Strict);
            GetCustomInterestRequest request = new GetCustomInterestRequest
            {
                ResourceName = new CustomInterestName("[CUSTOMER]", "[CUSTOM_INTEREST]").ToString(),
            };
            CustomInterest expectedResponse = new CustomInterest
            {
                ResourceName = "resourceName2625949903",
            };

            mockGrpcClient.Setup(x => x.GetCustomInterest(request, It.IsAny <CallOptions>()))
            .Returns(expectedResponse);
            CustomInterestServiceClient client = new CustomInterestServiceClientImpl(mockGrpcClient.Object, null);
            CustomInterest response            = client.GetCustomInterest(request);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
Ejemplo n.º 12
0
        public async Task GetCustomInterestAsync2()
        {
            Mock <CustomInterestService.CustomInterestServiceClient> mockGrpcClient = new Mock <CustomInterestService.CustomInterestServiceClient>(MockBehavior.Strict);
            GetCustomInterestRequest request = new GetCustomInterestRequest
            {
                ResourceName = new CustomInterestName("[CUSTOMER]", "[CUSTOM_INTEREST]").ToString(),
            };
            CustomInterest expectedResponse = new CustomInterest
            {
                ResourceName = "resourceName2625949903",
            };

            mockGrpcClient.Setup(x => x.GetCustomInterestAsync(request, It.IsAny <CallOptions>()))
            .Returns(new Grpc.Core.AsyncUnaryCall <CustomInterest>(Task.FromResult(expectedResponse), null, null, null, null));
            CustomInterestServiceClient client = new CustomInterestServiceClientImpl(mockGrpcClient.Object, null);
            CustomInterest response            = await client.GetCustomInterestAsync(request);

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