Exemplo n.º 1
0
 /// <summary>Snippet for GetAdParameter</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GetAdParameterResourceNames()
 {
     // Create client
     AdParameterServiceClient adParameterServiceClient = AdParameterServiceClient.Create();
     // Initialize request argument(s)
     AdParameterName resourceName = AdParameterName.FromCustomerAdGroupCriterionParameterIndex("[CUSTOMER_ID]", "[AD_GROUP_ID]", "[CRITERION_ID]", "[PARAMETER_INDEX]");
     // Make the request
     AdParameter response = adParameterServiceClient.GetAdParameter(resourceName);
 }
 /// <summary>Snippet for GetAdParameter</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GetAdParameterResourceNames()
 {
     // Create client
     AdParameterServiceClient adParameterServiceClient = AdParameterServiceClient.Create();
     // Initialize request argument(s)
     AdParameterName resourceName = AdParameterName.FromCustomerAdParameter("[CUSTOMER]", "[AD_PARAMETER]");
     // Make the request
     AdParameter response = adParameterServiceClient.GetAdParameter(resourceName);
 }
        /// <summary>Snippet for GetAdParameterAsync</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 GetAdParameterRequestObjectAsync()
        {
            // Create client
            AdParameterServiceClient adParameterServiceClient = await AdParameterServiceClient.CreateAsync();

            // Initialize request argument(s)
            GetAdParameterRequest request = new GetAdParameterRequest
            {
                ResourceNameAsAdParameterName = AdParameterName.FromCustomerAdParameter("[CUSTOMER]", "[AD_PARAMETER]"),
            };
            // Make the request
            AdParameter response = await adParameterServiceClient.GetAdParameterAsync(request);
        }
        /// <summary>Snippet for GetAdParameterAsync</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 GetAdParameterRequestObjectAsync()
        {
            // Create client
            AdParameterServiceClient adParameterServiceClient = await AdParameterServiceClient.CreateAsync();

            // Initialize request argument(s)
            GetAdParameterRequest request = new GetAdParameterRequest
            {
                ResourceNameAsAdParameterName = AdParameterName.FromCustomerAdGroupCriterionParameterIndex("[CUSTOMER_ID]", "[AD_GROUP_ID]", "[CRITERION_ID]", "[PARAMETER_INDEX]"),
            };
            // Make the request
            AdParameter response = await adParameterServiceClient.GetAdParameterAsync(request);
        }
Exemplo n.º 5
0
 /// <summary>Snippet for GetAdParameter</summary>
 public void GetAdParameterRequestObject()
 {
     // Snippet: GetAdParameter(GetAdParameterRequest, CallSettings)
     // Create client
     AdParameterServiceClient adParameterServiceClient = AdParameterServiceClient.Create();
     // Initialize request argument(s)
     GetAdParameterRequest request = new GetAdParameterRequest
     {
         ResourceNameAsAdParameterName = AdParameterName.FromCustomerAdParameter("[CUSTOMER]", "[AD_PARAMETER]"),
     };
     // Make the request
     AdParameter response = adParameterServiceClient.GetAdParameter(request);
     // End snippet
 }
Exemplo n.º 6
0
        /// <summary>Snippet for GetAdParameterAsync</summary>
        public async Task GetAdParameterResourceNamesAsync()
        {
            // Snippet: GetAdParameterAsync(AdParameterName, CallSettings)
            // Additional: GetAdParameterAsync(AdParameterName, CancellationToken)
            // Create client
            AdParameterServiceClient adParameterServiceClient = await AdParameterServiceClient.CreateAsync();

            // Initialize request argument(s)
            AdParameterName resourceName = AdParameterName.FromCustomerAdParameter("[CUSTOMER]", "[AD_PARAMETER]");
            // Make the request
            AdParameter response = await adParameterServiceClient.GetAdParameterAsync(resourceName);

            // End snippet
        }
        public async Task GetAdParameterAsync()
        {
            Mock <AdParameterService.AdParameterServiceClient> mockGrpcClient = new Mock <AdParameterService.AdParameterServiceClient>(MockBehavior.Strict);
            GetAdParameterRequest expectedRequest = new GetAdParameterRequest
            {
                ResourceName = new AdParameterName("[CUSTOMER]", "[AD_PARAMETER]").ToString(),
            };
            AdParameter expectedResponse = new AdParameter
            {
                ResourceName = "resourceName2625949903",
            };

            mockGrpcClient.Setup(x => x.GetAdParameterAsync(expectedRequest, It.IsAny <CallOptions>()))
            .Returns(new Grpc.Core.AsyncUnaryCall <AdParameter>(Task.FromResult(expectedResponse), null, null, null, null));
            AdParameterServiceClient client   = new AdParameterServiceClientImpl(mockGrpcClient.Object, null);
            string      formattedResourceName = new AdParameterName("[CUSTOMER]", "[AD_PARAMETER]").ToString();
            AdParameter response = await client.GetAdParameterAsync(formattedResourceName);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
        public void GetAdParameter()
        {
            Mock <AdParameterService.AdParameterServiceClient> mockGrpcClient = new Mock <AdParameterService.AdParameterServiceClient>(MockBehavior.Strict);
            GetAdParameterRequest expectedRequest = new GetAdParameterRequest
            {
                ResourceName = new AdParameterName("[CUSTOMER]", "[AD_PARAMETER]").ToString(),
            };
            AdParameter expectedResponse = new AdParameter
            {
                ResourceName = "resourceName2625949903",
            };

            mockGrpcClient.Setup(x => x.GetAdParameter(expectedRequest, It.IsAny <CallOptions>()))
            .Returns(expectedResponse);
            AdParameterServiceClient client   = new AdParameterServiceClientImpl(mockGrpcClient.Object, null);
            string      formattedResourceName = new AdParameterName("[CUSTOMER]", "[AD_PARAMETER]").ToString();
            AdParameter response = client.GetAdParameter(formattedResourceName);

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