/// <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 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 GetKeywordPlanCampaign() { // Create client KeywordPlanCampaignServiceClient keywordPlanCampaignServiceClient = KeywordPlanCampaignServiceClient.Create(); // Initialize request argument(s) string resourceName = "customers/[CUSTOMER]/keywordPlanCampaigns/[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 GetKeywordPlanCampaignAsync() { // Create client KeywordPlanCampaignServiceClient keywordPlanCampaignServiceClient = await KeywordPlanCampaignServiceClient.CreateAsync(); // Initialize request argument(s) string resourceName = "customers/[CUSTOMER_ID]/keywordPlanCampaigns/[KEYWORD_PLAN_CAMPAIGN_ID]"; // Make the request KeywordPlanCampaign response = await keywordPlanCampaignServiceClient.GetKeywordPlanCampaignAsync(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); }
/// <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 GetKeywordPlanCampaignAsync() { // Snippet: GetKeywordPlanCampaignAsync(string, CallSettings) // Additional: GetKeywordPlanCampaignAsync(string, CancellationToken) // Create client KeywordPlanCampaignServiceClient keywordPlanCampaignServiceClient = await KeywordPlanCampaignServiceClient.CreateAsync(); // Initialize request argument(s) string resourceName = "customers/[CUSTOMER_ID]/keywordPlanCampaigns/[KEYWORD_PLAN_CAMPAIGN_ID]"; // Make the request KeywordPlanCampaign response = await keywordPlanCampaignServiceClient.GetKeywordPlanCampaignAsync(resourceName); // End snippet }
/// <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 }
public void GetKeywordPlanCampaign2() { Mock <KeywordPlanCampaignService.KeywordPlanCampaignServiceClient> mockGrpcClient = new Mock <KeywordPlanCampaignService.KeywordPlanCampaignServiceClient>(MockBehavior.Strict); GetKeywordPlanCampaignRequest request = new GetKeywordPlanCampaignRequest { ResourceName = new KeywordPlanCampaignName("[CUSTOMER]", "[KEYWORD_PLAN_CAMPAIGN]").ToString(), }; KeywordPlanCampaign expectedResponse = new KeywordPlanCampaign { ResourceName = "resourceName2625949903", }; mockGrpcClient.Setup(x => x.GetKeywordPlanCampaign(request, It.IsAny <CallOptions>())) .Returns(expectedResponse); KeywordPlanCampaignServiceClient client = new KeywordPlanCampaignServiceClientImpl(mockGrpcClient.Object, null); KeywordPlanCampaign response = client.GetKeywordPlanCampaign(request); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }
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(); }