Ejemplo n.º 1
0
        /// <summary>
        /// Constructs a client wrapper for the CampaignCriterionService service, with the specified gRPC client and
        /// settings.
        /// </summary>
        /// <param name="grpcClient">The underlying gRPC client.</param>
        /// <param name="settings">
        /// The base <see cref="CampaignCriterionServiceSettings"/> used within this client.
        /// </param>
        public CampaignCriterionServiceClientImpl(CampaignCriterionService.CampaignCriterionServiceClient grpcClient, CampaignCriterionServiceSettings settings)
        {
            GrpcClient = grpcClient;
            CampaignCriterionServiceSettings effectiveSettings = settings ?? CampaignCriterionServiceSettings.GetDefault();
            gaxgrpc::ClientHelper            clientHelper      = new gaxgrpc::ClientHelper(effectiveSettings);

            _callGetCampaignCriterion = clientHelper.BuildApiCall <GetCampaignCriterionRequest, gagvr::CampaignCriterion>(grpcClient.GetCampaignCriterionAsync, grpcClient.GetCampaignCriterion, effectiveSettings.GetCampaignCriterionSettings).WithGoogleRequestParam("resource_name", request => request.ResourceName);
            Modify_ApiCall(ref _callGetCampaignCriterion);
            Modify_GetCampaignCriterionApiCall(ref _callGetCampaignCriterion);
            _callMutateCampaignCriteria = clientHelper.BuildApiCall <MutateCampaignCriteriaRequest, MutateCampaignCriteriaResponse>(grpcClient.MutateCampaignCriteriaAsync, grpcClient.MutateCampaignCriteria, effectiveSettings.MutateCampaignCriteriaSettings).WithGoogleRequestParam("customer_id", request => request.CustomerId);
            Modify_ApiCall(ref _callMutateCampaignCriteria);
            Modify_MutateCampaignCriteriaApiCall(ref _callMutateCampaignCriteria);
            OnConstruction(grpcClient, effectiveSettings, clientHelper);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Constructs a client wrapper for the CampaignCriterionService service, with the specified gRPC client and settings.
        /// </summary>
        /// <param name="grpcClient">The underlying gRPC client.</param>
        /// <param name="settings">The base <see cref="CampaignCriterionServiceSettings"/> used within this client </param>
        public CampaignCriterionServiceClientImpl(CampaignCriterionService.CampaignCriterionServiceClient grpcClient, CampaignCriterionServiceSettings settings)
        {
            GrpcClient = grpcClient;
            CampaignCriterionServiceSettings effectiveSettings = settings ?? CampaignCriterionServiceSettings.GetDefault();
            gaxgrpc::ClientHelper            clientHelper      = new gaxgrpc::ClientHelper(effectiveSettings);

            _callGetCampaignCriterion = clientHelper.BuildApiCall <GetCampaignCriterionRequest, gagvr::CampaignCriterion>(
                GrpcClient.GetCampaignCriterionAsync, GrpcClient.GetCampaignCriterion, effectiveSettings.GetCampaignCriterionSettings)
                                        .WithCallSettingsOverlay(request => gaxgrpc::CallSettings.FromHeader("x-goog-request-params", $"resource_name={request.ResourceName}"));
            _callMutateCampaignCriteria = clientHelper.BuildApiCall <MutateCampaignCriteriaRequest, MutateCampaignCriteriaResponse>(
                GrpcClient.MutateCampaignCriteriaAsync, GrpcClient.MutateCampaignCriteria, effectiveSettings.MutateCampaignCriteriaSettings)
                                          .WithCallSettingsOverlay(request => gaxgrpc::CallSettings.FromHeader("x-goog-request-params", $"customer_id={request.CustomerId}"));
            Modify_ApiCall(ref _callGetCampaignCriterion);
            Modify_GetCampaignCriterionApiCall(ref _callGetCampaignCriterion);
            Modify_ApiCall(ref _callMutateCampaignCriteria);
            Modify_MutateCampaignCriteriaApiCall(ref _callMutateCampaignCriteria);
            OnConstruction(grpcClient, effectiveSettings, clientHelper);
        }