Пример #1
0
 /// <summary>Snippet for GetAdGroupCriterionLabel</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GetAdGroupCriterionLabel()
 {
     // Create client
     AdGroupCriterionLabelServiceClient adGroupCriterionLabelServiceClient = AdGroupCriterionLabelServiceClient.Create();
     // Initialize request argument(s)
     string resourceName = "customers/[CUSTOMER_ID]/adGroupCriterionLabels/[AD_GROUP_ID]~[CRITERION_ID]~[LABEL_ID]";
     // Make the request
     AdGroupCriterionLabel response = adGroupCriterionLabelServiceClient.GetAdGroupCriterionLabel(resourceName);
 }
 /// <summary>Snippet for GetAdGroupCriterionLabelAsync</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 GetAdGroupCriterionLabelResourceNamesAsync()
 {
     // Create client
     AdGroupCriterionLabelServiceClient adGroupCriterionLabelServiceClient = await AdGroupCriterionLabelServiceClient.CreateAsync();
     // Initialize request argument(s)
     AdGroupCriterionLabelName resourceName = AdGroupCriterionLabelName.FromCustomerAdGroupCriterionLabel("[CUSTOMER]", "[AD_GROUP_CRITERION_LABEL]");
     // Make the request
     AdGroupCriterionLabel response = await adGroupCriterionLabelServiceClient.GetAdGroupCriterionLabelAsync(resourceName);
 }
 /// <summary>Snippet for GetAdGroupCriterionLabel</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GetAdGroupCriterionLabelResourceNames()
 {
     // Create client
     AdGroupCriterionLabelServiceClient adGroupCriterionLabelServiceClient = AdGroupCriterionLabelServiceClient.Create();
     // Initialize request argument(s)
     AdGroupCriterionLabelName resourceName = AdGroupCriterionLabelName.FromCustomerAdGroupCriterionLabel("[CUSTOMER_ID]", "[AD_GROUP_ID]", "[CRITERION_ID]", "[LABEL_ID]");
     // Make the request
     AdGroupCriterionLabel response = adGroupCriterionLabelServiceClient.GetAdGroupCriterionLabel(resourceName);
 }
Пример #4
0
        /// <summary>Snippet for GetAdGroupCriterionLabelAsync</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 GetAdGroupCriterionLabelAsync()
        {
            // Create client
            AdGroupCriterionLabelServiceClient adGroupCriterionLabelServiceClient = await AdGroupCriterionLabelServiceClient.CreateAsync();

            // Initialize request argument(s)
            string resourceName = "customers/[CUSTOMER]/adGroupCriterionLabels/[AD_GROUP_CRITERION_LABEL]";
            // Make the request
            AdGroupCriterionLabel response = await adGroupCriterionLabelServiceClient.GetAdGroupCriterionLabelAsync(resourceName);
        }
Пример #5
0
 /// <summary>Snippet for GetAdGroupCriterionLabel</summary>
 public void GetAdGroupCriterionLabelResourceNames()
 {
     // Snippet: GetAdGroupCriterionLabel(AdGroupCriterionLabelName, CallSettings)
     // Create client
     AdGroupCriterionLabelServiceClient adGroupCriterionLabelServiceClient = AdGroupCriterionLabelServiceClient.Create();
     // Initialize request argument(s)
     AdGroupCriterionLabelName resourceName = AdGroupCriterionLabelName.FromCustomerAdGroupCriterionLabel("[CUSTOMER]", "[AD_GROUP_CRITERION_LABEL]");
     // Make the request
     AdGroupCriterionLabel response = adGroupCriterionLabelServiceClient.GetAdGroupCriterionLabel(resourceName);
     // End snippet
 }
Пример #6
0
 /// <summary>Snippet for GetAdGroupCriterionLabel</summary>
 public void GetAdGroupCriterionLabel()
 {
     // Snippet: GetAdGroupCriterionLabel(string, CallSettings)
     // Create client
     AdGroupCriterionLabelServiceClient adGroupCriterionLabelServiceClient = AdGroupCriterionLabelServiceClient.Create();
     // Initialize request argument(s)
     string resourceName = "customers/[CUSTOMER]/adGroupCriterionLabels/[AD_GROUP_CRITERION_LABEL]";
     // Make the request
     AdGroupCriterionLabel response = adGroupCriterionLabelServiceClient.GetAdGroupCriterionLabel(resourceName);
     // End snippet
 }
 /// <summary>Snippet for GetAdGroupCriterionLabel</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GetAdGroupCriterionLabelRequestObject()
 {
     // Create client
     AdGroupCriterionLabelServiceClient adGroupCriterionLabelServiceClient = AdGroupCriterionLabelServiceClient.Create();
     // Initialize request argument(s)
     GetAdGroupCriterionLabelRequest request = new GetAdGroupCriterionLabelRequest
     {
         ResourceNameAsAdGroupCriterionLabelName = AdGroupCriterionLabelName.FromCustomerAdGroupCriterionLabel("[CUSTOMER]", "[AD_GROUP_CRITERION_LABEL]"),
     };
     // Make the request
     AdGroupCriterionLabel response = adGroupCriterionLabelServiceClient.GetAdGroupCriterionLabel(request);
 }
Пример #8
0
        /// <summary>Snippet for GetAdGroupCriterionLabelAsync</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 GetAdGroupCriterionLabelRequestObjectAsync()
        {
            // Create client
            AdGroupCriterionLabelServiceClient adGroupCriterionLabelServiceClient = await AdGroupCriterionLabelServiceClient.CreateAsync();

            // Initialize request argument(s)
            GetAdGroupCriterionLabelRequest request = new GetAdGroupCriterionLabelRequest
            {
                ResourceNameAsAdGroupCriterionLabelName = AdGroupCriterionLabelName.FromCustomerAdGroupCriterionLabel("[CUSTOMER_ID]", "[AD_GROUP_ID]", "[CRITERION_ID]", "[LABEL_ID]"),
            };
            // Make the request
            AdGroupCriterionLabel response = await adGroupCriterionLabelServiceClient.GetAdGroupCriterionLabelAsync(request);
        }
Пример #9
0
        /// <summary>Snippet for GetAdGroupCriterionLabelAsync</summary>
        public async Task GetAdGroupCriterionLabelAsync()
        {
            // Snippet: GetAdGroupCriterionLabelAsync(string, CallSettings)
            // Additional: GetAdGroupCriterionLabelAsync(string, CancellationToken)
            // Create client
            AdGroupCriterionLabelServiceClient adGroupCriterionLabelServiceClient = await AdGroupCriterionLabelServiceClient.CreateAsync();

            // Initialize request argument(s)
            string resourceName = "customers/[CUSTOMER]/adGroupCriterionLabels/[AD_GROUP_CRITERION_LABEL]";
            // Make the request
            AdGroupCriterionLabel response = await adGroupCriterionLabelServiceClient.GetAdGroupCriterionLabelAsync(resourceName);

            // End snippet
        }
Пример #10
0
        /// <summary>Snippet for GetAdGroupCriterionLabelAsync</summary>
        public async Task GetAdGroupCriterionLabelResourceNamesAsync()
        {
            // Snippet: GetAdGroupCriterionLabelAsync(AdGroupCriterionLabelName, CallSettings)
            // Additional: GetAdGroupCriterionLabelAsync(AdGroupCriterionLabelName, CancellationToken)
            // Create client
            AdGroupCriterionLabelServiceClient adGroupCriterionLabelServiceClient = await AdGroupCriterionLabelServiceClient.CreateAsync();

            // Initialize request argument(s)
            AdGroupCriterionLabelName resourceName = AdGroupCriterionLabelName.FromCustomerAdGroupCriterionLabel("[CUSTOMER]", "[AD_GROUP_CRITERION_LABEL]");
            // Make the request
            AdGroupCriterionLabel response = await adGroupCriterionLabelServiceClient.GetAdGroupCriterionLabelAsync(resourceName);

            // End snippet
        }
        public void GetAdGroupCriterionLabel2()
        {
            Mock <AdGroupCriterionLabelService.AdGroupCriterionLabelServiceClient> mockGrpcClient = new Mock <AdGroupCriterionLabelService.AdGroupCriterionLabelServiceClient>(MockBehavior.Strict);
            GetAdGroupCriterionLabelRequest request = new GetAdGroupCriterionLabelRequest
            {
                ResourceName = new AdGroupCriterionLabelName("[CUSTOMER]", "[AD_GROUP_CRITERION_LABEL]").ToString(),
            };
            AdGroupCriterionLabel expectedResponse = new AdGroupCriterionLabel
            {
                ResourceName = "resourceName2625949903",
            };

            mockGrpcClient.Setup(x => x.GetAdGroupCriterionLabel(request, It.IsAny <CallOptions>()))
            .Returns(expectedResponse);
            AdGroupCriterionLabelServiceClient client = new AdGroupCriterionLabelServiceClientImpl(mockGrpcClient.Object, null);
            AdGroupCriterionLabel response            = client.GetAdGroupCriterionLabel(request);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
        public async Task GetAdGroupCriterionLabelAsync()
        {
            Mock <AdGroupCriterionLabelService.AdGroupCriterionLabelServiceClient> mockGrpcClient = new Mock <AdGroupCriterionLabelService.AdGroupCriterionLabelServiceClient>(MockBehavior.Strict);
            GetAdGroupCriterionLabelRequest expectedRequest = new GetAdGroupCriterionLabelRequest
            {
                ResourceName = new AdGroupCriterionLabelName("[CUSTOMER]", "[AD_GROUP_CRITERION_LABEL]").ToString(),
            };
            AdGroupCriterionLabel expectedResponse = new AdGroupCriterionLabel
            {
                ResourceName = "resourceName2625949903",
            };

            mockGrpcClient.Setup(x => x.GetAdGroupCriterionLabelAsync(expectedRequest, It.IsAny <CallOptions>()))
            .Returns(new Grpc.Core.AsyncUnaryCall <AdGroupCriterionLabel>(Task.FromResult(expectedResponse), null, null, null, null));
            AdGroupCriterionLabelServiceClient client = new AdGroupCriterionLabelServiceClientImpl(mockGrpcClient.Object, null);
            string formattedResourceName   = new AdGroupCriterionLabelName("[CUSTOMER]", "[AD_GROUP_CRITERION_LABEL]").ToString();
            AdGroupCriterionLabel response = await client.GetAdGroupCriterionLabelAsync(formattedResourceName);

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