Пример #1
0
        public async stt::Task SuggestKeywordThemeConstantsRequestObjectAsync()
        {
            moq::Mock <KeywordThemeConstantService.KeywordThemeConstantServiceClient> mockGrpcClient = new moq::Mock <KeywordThemeConstantService.KeywordThemeConstantServiceClient>(moq::MockBehavior.Strict);
            SuggestKeywordThemeConstantsRequest request = new SuggestKeywordThemeConstantsRequest
            {
                QueryText    = "query_text3b0c4d80",
                CountryCode  = "country_code8debec55",
                LanguageCode = "language_code2f6c7160",
            };
            SuggestKeywordThemeConstantsResponse expectedResponse = new SuggestKeywordThemeConstantsResponse
            {
                KeywordThemeConstants =
                {
                    new gagvr::KeywordThemeConstant(),
                },
            };

            mockGrpcClient.Setup(x => x.SuggestKeywordThemeConstantsAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <SuggestKeywordThemeConstantsResponse>(stt::Task.FromResult(expectedResponse), null, null, null, null));
            KeywordThemeConstantServiceClient    client = new KeywordThemeConstantServiceClientImpl(mockGrpcClient.Object, null);
            SuggestKeywordThemeConstantsResponse responseCallSettings = await client.SuggestKeywordThemeConstantsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None));

            xunit::Assert.Same(expectedResponse, responseCallSettings);
            SuggestKeywordThemeConstantsResponse responseCancellationToken = await client.SuggestKeywordThemeConstantsAsync(request, st::CancellationToken.None);

            xunit::Assert.Same(expectedResponse, responseCancellationToken);
            mockGrpcClient.VerifyAll();
        }
 /// <summary>Snippet for SuggestKeywordThemeConstants</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void SuggestKeywordThemeConstantsRequestObject()
 {
     // Create client
     KeywordThemeConstantServiceClient keywordThemeConstantServiceClient = KeywordThemeConstantServiceClient.Create();
     // Initialize request argument(s)
     SuggestKeywordThemeConstantsRequest request = new SuggestKeywordThemeConstantsRequest
     {
         QueryText    = "",
         CountryCode  = "",
         LanguageCode = "",
     };
     // Make the request
     SuggestKeywordThemeConstantsResponse response = keywordThemeConstantServiceClient.SuggestKeywordThemeConstants(request);
 }
        /// <summary>Snippet for SuggestKeywordThemeConstantsAsync</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 SuggestKeywordThemeConstantsRequestObjectAsync()
        {
            // Create client
            KeywordThemeConstantServiceClient keywordThemeConstantServiceClient = await KeywordThemeConstantServiceClient.CreateAsync();

            // Initialize request argument(s)
            SuggestKeywordThemeConstantsRequest request = new SuggestKeywordThemeConstantsRequest
            {
                QueryText    = "",
                CountryCode  = "",
                LanguageCode = "",
            };
            // Make the request
            SuggestKeywordThemeConstantsResponse response = await keywordThemeConstantServiceClient.SuggestKeywordThemeConstantsAsync(request);
        }
        /// <summary>Snippet for SuggestKeywordThemeConstantsAsync</summary>
        public async Task SuggestKeywordThemeConstantsRequestObjectAsync()
        {
            // Snippet: SuggestKeywordThemeConstantsAsync(SuggestKeywordThemeConstantsRequest, CallSettings)
            // Additional: SuggestKeywordThemeConstantsAsync(SuggestKeywordThemeConstantsRequest, CancellationToken)
            // Create client
            KeywordThemeConstantServiceClient keywordThemeConstantServiceClient = await KeywordThemeConstantServiceClient.CreateAsync();

            // Initialize request argument(s)
            SuggestKeywordThemeConstantsRequest request = new SuggestKeywordThemeConstantsRequest
            {
                QueryText    = "",
                CountryCode  = "",
                LanguageCode = "",
            };
            // Make the request
            SuggestKeywordThemeConstantsResponse response = await keywordThemeConstantServiceClient.SuggestKeywordThemeConstantsAsync(request);

            // End snippet
        }
Пример #5
0
        // [END add_smart_campaign_11]


        // [START add_smart_campaign]
        /// <summary>
        /// Retrieves KeywordThemeConstants that are derived from autocomplete data for the
        /// given keyword text.
        /// </summary>
        /// <param name="client">The Google Ads client.</param>
        /// <param name="keywordText">A keyword used for generating keyword auto completions.
        /// </param>
        /// <returns>A list of KeywordThemeConstants.</returns>
        private IEnumerable <KeywordThemeConstant> GetKeywordTextAutoCompletions(
            GoogleAdsClient client, string keywordText)
        {
            KeywordThemeConstantServiceClient keywordThemeConstantServiceClient =
                client.GetService(Services.V10.KeywordThemeConstantService);

            SuggestKeywordThemeConstantsRequest request = new SuggestKeywordThemeConstantsRequest
            {
                QueryText    = keywordText,
                CountryCode  = COUNTRY_CODE,
                LanguageCode = LANGUAGE_CODE
            };

            SuggestKeywordThemeConstantsResponse response =
                keywordThemeConstantServiceClient.SuggestKeywordThemeConstants(request);

            Console.WriteLine($"Retrieved {response.KeywordThemeConstants.Count} keyword theme " +
                              $"constants using the keyword '{keywordText}'.");
            return(response.KeywordThemeConstants.ToList());
        }
Пример #6
0
        public void SuggestKeywordThemeConstantsRequestObject()
        {
            moq::Mock <KeywordThemeConstantService.KeywordThemeConstantServiceClient> mockGrpcClient = new moq::Mock <KeywordThemeConstantService.KeywordThemeConstantServiceClient>(moq::MockBehavior.Strict);
            SuggestKeywordThemeConstantsRequest request = new SuggestKeywordThemeConstantsRequest
            {
                QueryText    = "query_text3b0c4d80",
                CountryCode  = "country_code8debec55",
                LanguageCode = "language_code2f6c7160",
            };
            SuggestKeywordThemeConstantsResponse expectedResponse = new SuggestKeywordThemeConstantsResponse
            {
                KeywordThemeConstants =
                {
                    new gagvr::KeywordThemeConstant(),
                },
            };

            mockGrpcClient.Setup(x => x.SuggestKeywordThemeConstants(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            KeywordThemeConstantServiceClient    client   = new KeywordThemeConstantServiceClientImpl(mockGrpcClient.Object, null);
            SuggestKeywordThemeConstantsResponse response = client.SuggestKeywordThemeConstants(request);

            xunit::Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }