Exemplo n.º 1
0
        /// <summary>
        /// Creates a <see cref="KeywordPlanServiceClient"/> which uses the specified call invoker for remote
        /// operations.
        /// </summary>
        /// <param name="callInvoker">
        /// The <see cref="grpccore::CallInvoker"/> for remote operations. Must not be null.
        /// </param>
        /// <param name="settings">Optional <see cref="KeywordPlanServiceSettings"/>.</param>
        /// <returns>The created <see cref="KeywordPlanServiceClient"/>.</returns>
        internal static KeywordPlanServiceClient Create(grpccore::CallInvoker callInvoker, KeywordPlanServiceSettings settings = null)
        {
            gax::GaxPreconditions.CheckNotNull(callInvoker, nameof(callInvoker));
            grpcinter::Interceptor interceptor = settings?.Interceptor;

            if (interceptor != null)
            {
                callInvoker = grpcinter::CallInvokerExtensions.Intercept(callInvoker, interceptor);
            }
            KeywordPlanService.KeywordPlanServiceClient grpcClient = new KeywordPlanService.KeywordPlanServiceClient(callInvoker);
            return(new KeywordPlanServiceClientImpl(grpcClient, settings));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Constructs a client wrapper for the KeywordPlanService service, with the specified gRPC client and settings.
        /// </summary>
        /// <param name="grpcClient">The underlying gRPC client.</param>
        /// <param name="settings">The base <see cref="KeywordPlanServiceSettings"/> used within this client.</param>
        public KeywordPlanServiceClientImpl(KeywordPlanService.KeywordPlanServiceClient grpcClient, KeywordPlanServiceSettings settings)
        {
            GrpcClient = grpcClient;
            KeywordPlanServiceSettings effectiveSettings = settings ?? KeywordPlanServiceSettings.GetDefault();
            gaxgrpc::ClientHelper      clientHelper      = new gaxgrpc::ClientHelper(effectiveSettings);

            _callGetKeywordPlan = clientHelper.BuildApiCall <GetKeywordPlanRequest, gagvr::KeywordPlan>(grpcClient.GetKeywordPlanAsync, grpcClient.GetKeywordPlan, effectiveSettings.GetKeywordPlanSettings).WithGoogleRequestParam("resource_name", request => request.ResourceName);
            Modify_ApiCall(ref _callGetKeywordPlan);
            Modify_GetKeywordPlanApiCall(ref _callGetKeywordPlan);
            _callMutateKeywordPlans = clientHelper.BuildApiCall <MutateKeywordPlansRequest, MutateKeywordPlansResponse>(grpcClient.MutateKeywordPlansAsync, grpcClient.MutateKeywordPlans, effectiveSettings.MutateKeywordPlansSettings).WithGoogleRequestParam("customer_id", request => request.CustomerId);
            Modify_ApiCall(ref _callMutateKeywordPlans);
            Modify_MutateKeywordPlansApiCall(ref _callMutateKeywordPlans);
            _callGenerateForecastMetrics = clientHelper.BuildApiCall <GenerateForecastMetricsRequest, GenerateForecastMetricsResponse>(grpcClient.GenerateForecastMetricsAsync, grpcClient.GenerateForecastMetrics, effectiveSettings.GenerateForecastMetricsSettings).WithGoogleRequestParam("keyword_plan", request => request.KeywordPlan);
            Modify_ApiCall(ref _callGenerateForecastMetrics);
            Modify_GenerateForecastMetricsApiCall(ref _callGenerateForecastMetrics);
            _callGenerateHistoricalMetrics = clientHelper.BuildApiCall <GenerateHistoricalMetricsRequest, GenerateHistoricalMetricsResponse>(grpcClient.GenerateHistoricalMetricsAsync, grpcClient.GenerateHistoricalMetrics, effectiveSettings.GenerateHistoricalMetricsSettings).WithGoogleRequestParam("keyword_plan", request => request.KeywordPlan);
            Modify_ApiCall(ref _callGenerateHistoricalMetrics);
            Modify_GenerateHistoricalMetricsApiCall(ref _callGenerateHistoricalMetrics);
            OnConstruction(grpcClient, effectiveSettings, clientHelper);
        }
Exemplo n.º 3
0
 partial void OnConstruction(KeywordPlanService.KeywordPlanServiceClient grpcClient, KeywordPlanServiceSettings effectiveSettings, gaxgrpc::ClientHelper clientHelper);