/// <summary>Snippet for GetKeywordPlanCampaign</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GetKeywordPlanCampaignResourceNames()
 {
     // Create client
     KeywordPlanCampaignServiceClient keywordPlanCampaignServiceClient = KeywordPlanCampaignServiceClient.Create();
     // Initialize request argument(s)
     KeywordPlanCampaignName resourceName = KeywordPlanCampaignName.FromCustomerKeywordPlanCampaign("[CUSTOMER]", "[KEYWORD_PLAN_CAMPAIGN]");
     // Make the request
     KeywordPlanCampaign response = keywordPlanCampaignServiceClient.GetKeywordPlanCampaign(resourceName);
 }
        /// <summary>Snippet for GetKeywordPlanCampaignAsync</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 GetKeywordPlanCampaignResourceNamesAsync()
        {
            // Create client
            KeywordPlanCampaignServiceClient keywordPlanCampaignServiceClient = await KeywordPlanCampaignServiceClient.CreateAsync();

            // Initialize request argument(s)
            KeywordPlanCampaignName resourceName = KeywordPlanCampaignName.FromCustomerKeywordPlanCampaign("[CUSTOMER_ID]", "[KEYWORD_PLAN_CAMPAIGN_ID]");
            // Make the request
            KeywordPlanCampaign response = await keywordPlanCampaignServiceClient.GetKeywordPlanCampaignAsync(resourceName);
        }
Beispiel #3
0
 /// <summary>Snippet for GetKeywordPlanCampaign</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GetKeywordPlanCampaignRequestObject()
 {
     // Create client
     KeywordPlanCampaignServiceClient keywordPlanCampaignServiceClient = KeywordPlanCampaignServiceClient.Create();
     // Initialize request argument(s)
     GetKeywordPlanCampaignRequest request = new GetKeywordPlanCampaignRequest
     {
         ResourceNameAsKeywordPlanCampaignName = KeywordPlanCampaignName.FromCustomerKeywordPlanCampaign("[CUSTOMER_ID]", "[KEYWORD_PLAN_CAMPAIGN_ID]"),
     };
     // Make the request
     KeywordPlanCampaign response = keywordPlanCampaignServiceClient.GetKeywordPlanCampaign(request);
 }
        /// <summary>Snippet for GetKeywordPlanCampaignAsync</summary>
        public async Task GetKeywordPlanCampaignResourceNamesAsync()
        {
            // Snippet: GetKeywordPlanCampaignAsync(KeywordPlanCampaignName, CallSettings)
            // Additional: GetKeywordPlanCampaignAsync(KeywordPlanCampaignName, CancellationToken)
            // Create client
            KeywordPlanCampaignServiceClient keywordPlanCampaignServiceClient = await KeywordPlanCampaignServiceClient.CreateAsync();

            // Initialize request argument(s)
            KeywordPlanCampaignName resourceName = KeywordPlanCampaignName.FromCustomerKeywordPlanCampaign("[CUSTOMER_ID]", "[KEYWORD_PLAN_CAMPAIGN_ID]");
            // Make the request
            KeywordPlanCampaign response = await keywordPlanCampaignServiceClient.GetKeywordPlanCampaignAsync(resourceName);

            // End snippet
        }
Beispiel #5
0
        public async Task GetKeywordPlanCampaignAsync()
        {
            Mock <KeywordPlanCampaignService.KeywordPlanCampaignServiceClient> mockGrpcClient = new Mock <KeywordPlanCampaignService.KeywordPlanCampaignServiceClient>(MockBehavior.Strict);
            GetKeywordPlanCampaignRequest expectedRequest = new GetKeywordPlanCampaignRequest
            {
                ResourceName = new KeywordPlanCampaignName("[CUSTOMER]", "[KEYWORD_PLAN_CAMPAIGN]").ToString(),
            };
            KeywordPlanCampaign expectedResponse = new KeywordPlanCampaign
            {
                ResourceName = "resourceName2625949903",
            };

            mockGrpcClient.Setup(x => x.GetKeywordPlanCampaignAsync(expectedRequest, It.IsAny <CallOptions>()))
            .Returns(new Grpc.Core.AsyncUnaryCall <KeywordPlanCampaign>(Task.FromResult(expectedResponse), null, null, null, null));
            KeywordPlanCampaignServiceClient client = new KeywordPlanCampaignServiceClientImpl(mockGrpcClient.Object, null);
            string formattedResourceName            = new KeywordPlanCampaignName("[CUSTOMER]", "[KEYWORD_PLAN_CAMPAIGN]").ToString();
            KeywordPlanCampaign response            = await client.GetKeywordPlanCampaignAsync(formattedResourceName);

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