google-ads-nodejs-client
Version:
Googleads client for Node.js
685 lines • 335 kB
JavaScript
"use strict";
// Copyright 2025 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// ** This file is automatically generated by gapic-generator-typescript. **
// ** https://github.com/googleapis/gapic-generator-typescript **
// ** All changes to this file may be overwritten. **
Object.defineProperty(exports, "__esModule", { value: true });
exports.ConversionGoalCampaignConfigServiceClient = void 0;
const jsonProtos = require("../../protos/protos.json");
const google_gax_1 = require("google-gax");
/**
* Client JSON configuration object, loaded from
* `src/v19/conversion_goal_campaign_config_service_client_config.json`.
* This file defines retry strategy and timeouts for all API methods in this library.
*/
const gapicConfig = require("./conversion_goal_campaign_config_service_client_config.json");
const version = require('../../../package.json').version;
/**
* Service to manage conversion goal campaign config.
* @class
* @memberof v19
*/
class ConversionGoalCampaignConfigServiceClient {
/**
* Construct an instance of ConversionGoalCampaignConfigServiceClient.
*
* @param {object} [options] - The configuration object.
* The options accepted by the constructor are described in detail
* in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance).
* The common options are:
* @param {object} [options.credentials] - Credentials object.
* @param {string} [options.credentials.client_email]
* @param {string} [options.credentials.private_key]
* @param {string} [options.email] - Account email address. Required when
* using a .pem or .p12 keyFilename.
* @param {string} [options.keyFilename] - Full path to the a .json, .pem, or
* .p12 key downloaded from the Google Developers Console. If you provide
* a path to a JSON file, the projectId option below is not necessary.
* NOTE: .pem and .p12 require you to specify options.email as well.
* @param {number} [options.port] - The port on which to connect to
* the remote host.
* @param {string} [options.projectId] - The project ID from the Google
* Developer's Console, e.g. 'grape-spaceship-123'. We will also check
* the environment variable GCLOUD_PROJECT for your project ID. If your
* app is running in an environment which supports
* {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials},
* your project ID will be detected automatically.
* @param {string} [options.apiEndpoint] - The domain name of the
* API remote host.
* @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.
* Follows the structure of {@link gapicConfig}.
* @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode.
* For more information, please check the
* {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
* @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you
* need to avoid loading the default gRPC version and want to use the fallback
* HTTP implementation. Load only fallback version and pass it to the constructor:
* ```
* const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC
* const client = new ConversionGoalCampaignConfigServiceClient({fallback: true}, gax);
* ```
*/
constructor(opts, gaxInstance) {
var _a, _b, _c, _d, _e;
this._terminated = false;
this._log = google_gax_1.loggingUtils.log('google-ads');
this.descriptors = {
page: {},
stream: {},
longrunning: {},
batching: {},
};
// Ensure that options include all the required fields.
const staticMembers = this.constructor;
if ((opts === null || opts === void 0 ? void 0 : opts.universe_domain) && (opts === null || opts === void 0 ? void 0 : opts.universeDomain) && (opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== (opts === null || opts === void 0 ? void 0 : opts.universeDomain)) {
throw new Error('Please set either universe_domain or universeDomain, but not both.');
}
const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined;
this._universeDomain = (_c = (_b = (_a = opts === null || opts === void 0 ? void 0 : opts.universeDomain) !== null && _a !== void 0 ? _a : opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== null && _b !== void 0 ? _b : universeDomainEnvVar) !== null && _c !== void 0 ? _c : 'googleapis.com';
this._servicePath = 'googleads.' + this._universeDomain;
const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || this._servicePath;
this._providedCustomServicePath = !!((opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint));
const port = (opts === null || opts === void 0 ? void 0 : opts.port) || staticMembers.port;
const clientConfig = (_d = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _d !== void 0 ? _d : {};
const fallback = (_e = opts === null || opts === void 0 ? void 0 : opts.fallback) !== null && _e !== void 0 ? _e : (typeof window !== 'undefined' && typeof (window === null || window === void 0 ? void 0 : window.fetch) === 'function');
opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
// If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case.
if (servicePath !== this._servicePath && !('scopes' in opts)) {
opts['scopes'] = staticMembers.scopes;
}
// Load google-gax module synchronously if needed
if (!gaxInstance) {
gaxInstance = require('google-gax');
}
// Choose either gRPC or proto-over-HTTP implementation of google-gax.
this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance;
// Create a `gaxGrpc` object, with any grpc-specific options sent to the client.
this._gaxGrpc = new this._gaxModule.GrpcClient(opts);
// Save options to use in initialize() method.
this._opts = opts;
// Save the auth object to the client, for use by other methods.
this.auth = this._gaxGrpc.auth;
// Set useJWTAccessWithScope on the auth object.
this.auth.useJWTAccessWithScope = true;
// Set defaultServicePath on the auth object.
this.auth.defaultServicePath = this._servicePath;
// Set the default scopes in auth client if needed.
if (servicePath === this._servicePath) {
this.auth.defaultScopes = staticMembers.scopes;
}
// Determine the client header string.
const clientHeader = [
`gax/${this._gaxModule.version}`,
`gapic/${version}`,
];
if (typeof process === 'object' && 'versions' in process) {
clientHeader.push(`gl-node/${process.versions.node}`);
}
else {
clientHeader.push(`gl-web/${this._gaxModule.version}`);
}
if (!opts.fallback) {
clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`);
}
else {
clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`);
}
if (opts.libName && opts.libVersion) {
clientHeader.push(`${opts.libName}/${opts.libVersion}`);
}
// Load the applicable protos.
this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos);
// This API contains "path templates"; forward-slash-separated
// identifiers to uniquely identify resources within the API.
// Create useful helper objects for these.
this.pathTemplates = {
accessibleBiddingStrategyPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/accessibleBiddingStrategies/{bidding_strategy_id}'),
accountBudgetPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/accountBudgets/{account_budget_id}'),
accountBudgetProposalPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/accountBudgetProposals/{account_budget_proposal_id}'),
accountLinkPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/accountLinks/{account_link_id}'),
adPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/ads/{ad_id}'),
adGroupPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/adGroups/{ad_group_id}'),
adGroupAdPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/adGroupAds/{ad_group_id}~{ad_id}'),
adGroupAdAssetCombinationViewPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/adGroupAdAssetCombinationViews/{ad_group_id}~{ad_id}~{asset_combination_id_low}~{asset_combination_id_high}'),
adGroupAdAssetViewPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/adGroupAdAssetViews/{ad_group_id}~{ad_id}~{asset_id}~{field_type}'),
adGroupAdLabelPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/adGroupAdLabels/{ad_group_id}~{ad_id}~{label_id}'),
adGroupAssetPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/adGroupAssets/{ad_group_id}~{asset_id}~{field_type}'),
adGroupAssetSetPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/adGroupAssetSets/{ad_group_id}~{asset_set_id}'),
adGroupAudienceViewPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/adGroupAudienceViews/{ad_group_id}~{criterion_id}'),
adGroupBidModifierPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/adGroupBidModifiers/{ad_group_id}~{criterion_id}'),
adGroupCriterionPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/adGroupCriteria/{ad_group_id}~{criterion_id}'),
adGroupCriterionCustomizerPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/adGroupCriterionCustomizers/{ad_group_id}~{criterion_id}~{customizer_attribute_id}'),
adGroupCriterionLabelPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/adGroupCriterionLabels/{ad_group_id}~{criterion_id}~{label_id}'),
adGroupCriterionSimulationPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/adGroupCriterionSimulations/{ad_group_id}~{criterion_id}~{type}~{modification_method}~{start_date}~{end_date}'),
adGroupCustomizerPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/adGroupCustomizers/{ad_group_id}~{customizer_attribute_id}'),
adGroupLabelPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/adGroupLabels/{ad_group_id}~{label_id}'),
adGroupSimulationPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/adGroupSimulations/{ad_group_id}~{type}~{modification_method}~{start_date}~{end_date}'),
adParameterPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/adParameters/{ad_group_id}~{criterion_id}~{parameter_index}'),
adScheduleViewPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/adScheduleViews/{campaign_id}~{criterion_id}'),
ageRangeViewPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/ageRangeViews/{ad_group_id}~{criterion_id}'),
androidPrivacySharedKeyGoogleAdGroupPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/androidPrivacySharedKeyGoogleAdGroups/{campaign_id}~{ad_group_id}~{android_privacy_interaction_type}~{android_privacy_network_type}~{android_privacy_interaction_date}'),
androidPrivacySharedKeyGoogleCampaignPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/androidPrivacySharedKeyGoogleCampaigns/{campaign_id}~{android_privacy_interaction_type}~{android_privacy_interaction_date}'),
androidPrivacySharedKeyGoogleNetworkTypePathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/androidPrivacySharedKeyGoogleNetworkTypes/{campaign_id}~{android_privacy_interaction_type}~{android_privacy_network_type}~{android_privacy_interaction_date}'),
assetPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/assets/{asset_id}'),
assetFieldTypeViewPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/assetFieldTypeViews/{field_type}'),
assetGroupPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/assetGroups/{asset_group_id}'),
assetGroupAssetPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/assetGroupAssets/{asset_group_id}~{asset_id}~{field_type}'),
assetGroupListingGroupFilterPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/assetGroupListingGroupFilters/{asset_group_id}~{listing_group_filter_id}'),
assetGroupProductGroupViewPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/assetGroupProductGroupViews/{asset_group_id}~{listing_group_filter_id}'),
assetGroupSignalPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/assetGroupSignals/{asset_group_id}~{criterion_id}'),
assetGroupTopCombinationViewPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/assetGroupTopCombinationViews/{asset_group_id}~{asset_combination_category}'),
assetSetPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/assetSets/{asset_set_id}'),
assetSetAssetPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/assetSetAssets/{asset_set_id}~{asset_id}'),
assetSetTypeViewPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/assetSetTypeViews/{asset_set_type}'),
audiencePathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/audiences/{audience_id}'),
batchJobPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/batchJobs/{batch_job_id}'),
biddingDataExclusionPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/biddingDataExclusions/{seasonality_event_id}'),
biddingSeasonalityAdjustmentPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/biddingSeasonalityAdjustments/{seasonality_event_id}'),
biddingStrategyPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/biddingStrategies/{bidding_strategy_id}'),
biddingStrategySimulationPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/biddingStrategySimulations/{bidding_strategy_id}~{type}~{modification_method}~{start_date}~{end_date}'),
billingSetupPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/billingSetups/{billing_setup_id}'),
callViewPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/callViews/{call_detail_id}'),
campaignPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/campaigns/{campaign_id}'),
campaignAggregateAssetViewPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/campaignAggregateAssetViews/{campaign_id}~{asset_id}~{asset_link_source}~{field_type}'),
campaignAssetPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/campaignAssets/{campaign_id}~{asset_id}~{field_type}'),
campaignAssetSetPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/campaignAssetSets/{campaign_id}~{asset_set_id}'),
campaignAudienceViewPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/campaignAudienceViews/{campaign_id}~{criterion_id}'),
campaignBidModifierPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/campaignBidModifiers/{campaign_id}~{criterion_id}'),
campaignBudgetPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/campaignBudgets/{campaign_budget_id}'),
campaignConversionGoalPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/campaignConversionGoals/{campaign_id}~{category}~{source}'),
campaignCriterionPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/campaignCriteria/{campaign_id}~{criterion_id}'),
campaignCustomizerPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/campaignCustomizers/{campaign_id}~{customizer_attribute_id}'),
campaignDraftPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/campaignDrafts/{base_campaign_id}~{draft_id}'),
campaignGroupPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/campaignGroups/{campaign_group_id}'),
campaignLabelPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/campaignLabels/{campaign_id}~{label_id}'),
campaignLifecycleGoalPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/campaignLifecycleGoals/{campaign_id}'),
campaignSearchTermInsightPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/campaignSearchTermInsights/{campaign_id}~{cluster_id}'),
campaignSharedSetPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/campaignSharedSets/{campaign_id}~{shared_set_id}'),
campaignSimulationPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/campaignSimulations/{campaign_id}~{type}~{modification_method}~{start_date}~{end_date}'),
carrierConstantPathTemplate: new this._gaxModule.PathTemplate('carrierConstants/{criterion_id}'),
changeEventPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/changeEvents/{timestamp_micros}~{command_index}~{mutate_index}'),
changeStatusPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/changeStatus/{change_status_id}'),
channelAggregateAssetViewPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/channelAggregateAssetViews/{advertising_channel_type}~{asset_id}~{asset_source}~{field_type}'),
clickViewPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/clickViews/{date}~{gclid}'),
combinedAudiencePathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/combinedAudiences/{combined_audience_id}'),
contentCriterionViewPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/contentCriterionViews/{ad_group_id}~{criterion_id}'),
conversionActionPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/conversionActions/{conversion_action_id}'),
conversionCustomVariablePathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/conversionCustomVariables/{conversion_custom_variable_id}'),
conversionGoalCampaignConfigPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/conversionGoalCampaignConfigs/{campaign_id}'),
conversionValueRulePathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/conversionValueRules/{conversion_value_rule_id}'),
conversionValueRuleSetPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/conversionValueRuleSets/{conversion_value_rule_set_id}'),
currencyConstantPathTemplate: new this._gaxModule.PathTemplate('currencyConstants/{code}'),
customAudiencePathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/customAudiences/{custom_audience_id}'),
customConversionGoalPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/customConversionGoals/{goal_id}'),
customInterestPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/customInterests/{custom_interest_id}'),
customerPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}'),
customerAssetPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/customerAssets/{asset_id}~{field_type}'),
customerAssetSetPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/customerAssetSets/{asset_set_id}'),
customerClientPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/customerClients/{client_customer_id}'),
customerClientLinkPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/customerClientLinks/{client_customer_id}~{manager_link_id}'),
customerConversionGoalPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/customerConversionGoals/{category}~{source}'),
customerCustomizerPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/customerCustomizers/{customizer_attribute_id}'),
customerLabelPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/customerLabels/{label_id}'),
customerLifecycleGoalPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/customerLifecycleGoals'),
customerManagerLinkPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/customerManagerLinks/{manager_customer_id}~{manager_link_id}'),
customerNegativeCriterionPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/customerNegativeCriteria/{criterion_id}'),
customerSearchTermInsightPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/customerSearchTermInsights/{cluster_id}'),
customerSkAdNetworkConversionValueSchemaPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/customerSkAdNetworkConversionValueSchemas/{account_link_id}'),
customerUserAccessPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/customerUserAccesses/{user_id}'),
customerUserAccessInvitationPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/customerUserAccessInvitations/{invitation_id}'),
customizerAttributePathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/customizerAttributes/{customizer_attribute_id}'),
dataLinkPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/dataLinks/{product_link_id}~{data_link_id}'),
detailPlacementViewPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/detailPlacementViews/{ad_group_id}~{base64_placement}'),
detailedDemographicPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/detailedDemographics/{detailed_demographic_id}'),
displayKeywordViewPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/displayKeywordViews/{ad_group_id}~{criterion_id}'),
distanceViewPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/distanceViews/{placeholder_chain_id}~{distance_bucket}'),
domainCategoryPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/domainCategories/{campaign_id}~{base64_category}~{language_code}'),
dynamicSearchAdsSearchTermViewPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/dynamicSearchAdsSearchTermViews/{ad_group_id}~{search_term_fingerprint}~{headline_fingerprint}~{landing_page_fingerprint}~{page_url_fingerprint}'),
expandedLandingPageViewPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/expandedLandingPageViews/{expanded_final_url_fingerprint}'),
experimentPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/experiments/{trial_id}'),
experimentArmPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/experimentArms/{trial_id}~{trial_arm_id}'),
genderViewPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/genderViews/{ad_group_id}~{criterion_id}'),
geoTargetConstantPathTemplate: new this._gaxModule.PathTemplate('geoTargetConstants/{criterion_id}'),
geographicViewPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/geographicViews/{country_criterion_id}~{location_type}'),
googleAdsFieldPathTemplate: new this._gaxModule.PathTemplate('googleAdsFields/{google_ads_field}'),
groupPlacementViewPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/groupPlacementViews/{ad_group_id}~{base64_placement}'),
hotelGroupViewPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/hotelGroupViews/{ad_group_id}~{criterion_id}'),
hotelPerformanceViewPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/hotelPerformanceView'),
hotelReconciliationPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/hotelReconciliations/{commission_id}'),
incomeRangeViewPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/incomeRangeViews/{ad_group_id}~{criterion_id}'),
invoicePathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/invoices/{invoice_id}'),
keywordPlanPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/keywordPlans/{keyword_plan_id}'),
keywordPlanAdGroupPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/keywordPlanAdGroups/{keyword_plan_ad_group_id}'),
keywordPlanAdGroupKeywordPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/keywordPlanAdGroupKeywords/{keyword_plan_ad_group_keyword_id}'),
keywordPlanCampaignPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/keywordPlanCampaigns/{keyword_plan_campaign_id}'),
keywordPlanCampaignKeywordPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/keywordPlanCampaignKeywords/{keyword_plan_campaign_keyword_id}'),
keywordThemeConstantPathTemplate: new this._gaxModule.PathTemplate('keywordThemeConstants/{express_category_id}~{express_sub_category_id}'),
keywordViewPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/keywordViews/{ad_group_id}~{criterion_id}'),
labelPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/labels/{label_id}'),
landingPageViewPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/landingPageViews/{unexpanded_final_url_fingerprint}'),
languageConstantPathTemplate: new this._gaxModule.PathTemplate('languageConstants/{criterion_id}'),
leadFormSubmissionDataPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/leadFormSubmissionData/{lead_form_user_submission_id}'),
lifeEventPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/lifeEvents/{life_event_id}'),
localServicesEmployeePathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/localServicesEmployees/{gls_employee_id}'),
localServicesLeadPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/localServicesLeads/{local_services_lead_id}'),
localServicesLeadConversationPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/localServicesLeadConversations/{local_services_lead_conversation_id}'),
localServicesVerificationArtifactPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/localServicesVerificationArtifacts/{gls_verification_artifact_id}'),
locationViewPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/locationViews/{campaign_id}~{criterion_id}'),
managedPlacementViewPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/managedPlacementViews/{ad_group_id}~{criterion_id}'),
mediaFilePathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/mediaFiles/{media_file_id}'),
mobileAppCategoryConstantPathTemplate: new this._gaxModule.PathTemplate('mobileAppCategoryConstants/{mobile_app_category_id}'),
mobileDeviceConstantPathTemplate: new this._gaxModule.PathTemplate('mobileDeviceConstants/{criterion_id}'),
offlineConversionUploadClientSummaryPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/offlineConversionUploadClientSummaries/{client}'),
offlineConversionUploadConversionActionSummaryPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/offlineConversionUploadConversionActionSummaries/{conversion_type_id}~{client}'),
offlineUserDataJobPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/offlineUserDataJobs/{offline_user_data_update_id}'),
operatingSystemVersionConstantPathTemplate: new this._gaxModule.PathTemplate('operatingSystemVersionConstants/{criterion_id}'),
paidOrganicSearchTermViewPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/paidOrganicSearchTermViews/{campaign_id}~{ad_group_id}~{base64_search_term}'),
parentalStatusViewPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/parentalStatusViews/{ad_group_id}~{criterion_id}'),
paymentsAccountPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/paymentsAccounts/{payments_account_id}'),
perStoreViewPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/perStoreViews/{place_id}'),
performanceMaxPlacementViewPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/performanceMaxPlacementViews/{base_64_placement}'),
productCategoryConstantPathTemplate: new this._gaxModule.PathTemplate('productCategoryConstants/{level}~{category_id}'),
productGroupViewPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/productGroupViews/{adgroup_id}~{criterion_id}'),
productLinkPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/productLinks/{product_link_id}'),
productLinkInvitationPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/productLinkInvitations/{customer_invitation_id}'),
qualifyingQuestionPathTemplate: new this._gaxModule.PathTemplate('qualifyingQuestions/{qualifying_question_id}'),
recommendationPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/recommendations/{recommendation_id}'),
recommendationSubscriptionPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/recommendationSubscriptions/{recommendation_type}'),
remarketingActionPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/remarketingActions/{remarketing_action_id}'),
searchTermViewPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/searchTermViews/{campaign_id}~{ad_group_id}~{query}'),
sharedCriterionPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/sharedCriteria/{shared_set_id}~{criterion_id}'),
sharedSetPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/sharedSets/{shared_set_id}'),
shoppingPerformanceViewPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/shoppingPerformanceView'),
shoppingProductPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/shoppingProducts/{merchant_center_id}~{channel}~{language_code}~{feed_label}~{item_id}'),
smartCampaignSearchTermViewPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/smartCampaignSearchTermViews/{campaign_id}~{query}'),
smartCampaignSettingPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/smartCampaignSettings/{campaign_id}'),
thirdPartyAppAnalyticsLinkPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/thirdPartyAppAnalyticsLinks/{customer_link_id}'),
topicConstantPathTemplate: new this._gaxModule.PathTemplate('topicConstants/{topic_id}'),
topicViewPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/topicViews/{ad_group_id}~{criterion_id}'),
travelActivityGroupViewPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/travelActivityGroupViews/{ad_group_id}~{criterion_id}'),
travelActivityPerformanceViewPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/travelActivityPerformanceViews'),
userInterestPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/userInterests/{user_interest_id}'),
userListPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/userLists/{user_list_id}'),
userListCustomerTypePathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/userListCustomerTypes/{user_list_id}~{semantic_label}'),
userLocationViewPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/userLocationViews/{country_criterion_id}~{is_targeting_location}'),
videoPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/videos/{video_id}'),
webpageViewPathTemplate: new this._gaxModule.PathTemplate('customers/{customer_id}/webpageViews/{ad_group_id}~{criterion_id}'),
};
// Put together the default options sent with requests.
this._defaults = this._gaxGrpc.constructSettings('google.ads.googleads.v19.services.ConversionGoalCampaignConfigService', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });
// Set up a dictionary of "inner API calls"; the core implementation
// of calling the API is handled in `google-gax`, with this code
// merely providing the destination and request information.
this.innerApiCalls = {};
// Add a warn function to the client constructor so it can be easily tested.
this.warn = this._gaxModule.warn;
}
/**
* Initialize the client.
* Performs asynchronous operations (such as authentication) and prepares the client.
* This function will be called automatically when any class method is called for the
* first time, but if you need to initialize it before calling an actual method,
* feel free to call initialize() directly.
*
* You can await on this method if you want to make sure the client is initialized.
*
* @returns {Promise} A promise that resolves to an authenticated service stub.
*/
initialize() {
// If the client stub promise is already initialized, return immediately.
if (this.conversionGoalCampaignConfigServiceStub) {
return this.conversionGoalCampaignConfigServiceStub;
}
// Put together the "service stub" for
// google.ads.googleads.v19.services.ConversionGoalCampaignConfigService.
this.conversionGoalCampaignConfigServiceStub = this._gaxGrpc.createStub(this._opts.fallback ?
this._protos.lookupService('google.ads.googleads.v19.services.ConversionGoalCampaignConfigService') :
// eslint-disable-next-line @typescript-eslint/no-explicit-any
this._protos.google.ads.googleads.v19.services.ConversionGoalCampaignConfigService, this._opts, this._providedCustomServicePath);
// Iterate over each of the methods that the service provides
// and create an API call method for each.
const conversionGoalCampaignConfigServiceStubMethods = ['mutateConversionGoalCampaignConfigs'];
for (const methodName of conversionGoalCampaignConfigServiceStubMethods) {
const callPromise = this.conversionGoalCampaignConfigServiceStub.then(stub => (...args) => {
if (this._terminated) {
return Promise.reject('The client has already been closed.');
}
const func = stub[methodName];
return func.apply(stub, args);
}, (err) => () => {
throw err;
});
const descriptor = undefined;
const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], descriptor, this._opts.fallback);
this.innerApiCalls[methodName] = apiCall;
}
return this.conversionGoalCampaignConfigServiceStub;
}
/**
* The DNS address for this API service.
* @deprecated Use the apiEndpoint method of the client instance.
* @returns {string} The DNS address for this service.
*/
static get servicePath() {
if (typeof process === 'object' && typeof process.emitWarning === 'function') {
process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
}
return 'googleads.googleapis.com';
}
/**
* The DNS address for this API service - same as servicePath.
* @deprecated Use the apiEndpoint method of the client instance.
* @returns {string} The DNS address for this service.
*/
static get apiEndpoint() {
if (typeof process === 'object' && typeof process.emitWarning === 'function') {
process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
}
return 'googleads.googleapis.com';
}
/**
* The DNS address for this API service.
* @returns {string} The DNS address for this service.
*/
get apiEndpoint() {
return this._servicePath;
}
get universeDomain() {
return this._universeDomain;
}
/**
* The port for this API service.
* @returns {number} The default port for this service.
*/
static get port() {
return 443;
}
/**
* The scopes needed to make gRPC calls for every method defined
* in this service.
* @returns {string[]} List of default scopes.
*/
static get scopes() {
return [
'https://www.googleapis.com/auth/adwords'
];
}
/**
* Return the project ID used by this class.
* @returns {Promise} A promise that resolves to string containing the project ID.
*/
getProjectId(callback) {
if (callback) {
this.auth.getProjectId(callback);
return;
}
return this.auth.getProjectId();
}
mutateConversionGoalCampaignConfigs(request, optionsOrCallback, callback) {
var _a, _b;
request = request || {};
let options;
if (typeof optionsOrCallback === 'function' && callback === undefined) {
callback = optionsOrCallback;
options = {};
}
else {
options = optionsOrCallback;
}
options = options || {};
options.otherArgs = options.otherArgs || {};
options.otherArgs.headers = options.otherArgs.headers || {};
options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({
'customer_id': (_a = request.customerId) !== null && _a !== void 0 ? _a : '',
});
this.initialize();
this._log.info('mutateConversionGoalCampaignConfigs request %j', request);
const wrappedCallback = callback
? (error, response, options, rawResponse) => {
this._log.info('mutateConversionGoalCampaignConfigs response %j', response);
callback(error, response, options, rawResponse); // We verified callback above.
}
: undefined;
return (_b = this.innerApiCalls.mutateConversionGoalCampaignConfigs(request, options, wrappedCallback)) === null || _b === void 0 ? void 0 : _b.then(([response, options, rawResponse]) => {
this._log.info('mutateConversionGoalCampaignConfigs response %j', response);
return [response, options, rawResponse];
});
}
// --------------------
// -- Path templates --
// --------------------
/**
* Return a fully-qualified accessibleBiddingStrategy resource name string.
*
* @param {string} customer_id
* @param {string} bidding_strategy_id
* @returns {string} Resource name string.
*/
accessibleBiddingStrategyPath(customerId, biddingStrategyId) {
return this.pathTemplates.accessibleBiddingStrategyPathTemplate.render({
customer_id: customerId,
bidding_strategy_id: biddingStrategyId,
});
}
/**
* Parse the customer_id from AccessibleBiddingStrategy resource.
*
* @param {string} accessibleBiddingStrategyName
* A fully-qualified path representing AccessibleBiddingStrategy resource.
* @returns {string} A string representing the customer_id.
*/
matchCustomerIdFromAccessibleBiddingStrategyName(accessibleBiddingStrategyName) {
return this.pathTemplates.accessibleBiddingStrategyPathTemplate.match(accessibleBiddingStrategyName).customer_id;
}
/**
* Parse the bidding_strategy_id from AccessibleBiddingStrategy resource.
*
* @param {string} accessibleBiddingStrategyName
* A fully-qualified path representing AccessibleBiddingStrategy resource.
* @returns {string} A string representing the bidding_strategy_id.
*/
matchBiddingStrategyIdFromAccessibleBiddingStrategyName(accessibleBiddingStrategyName) {
return this.pathTemplates.accessibleBiddingStrategyPathTemplate.match(accessibleBiddingStrategyName).bidding_strategy_id;
}
/**
* Return a fully-qualified accountBudget resource name string.
*
* @param {string} customer_id
* @param {string} account_budget_id
* @returns {string} Resource name string.
*/
accountBudgetPath(customerId, accountBudgetId) {
return this.pathTemplates.accountBudgetPathTemplate.render({
customer_id: customerId,
account_budget_id: accountBudgetId,
});
}
/**
* Parse the customer_id from AccountBudget resource.
*
* @param {string} accountBudgetName
* A fully-qualified path representing AccountBudget resource.
* @returns {string} A string representing the customer_id.
*/
matchCustomerIdFromAccountBudgetName(accountBudgetName) {
return this.pathTemplates.accountBudgetPathTemplate.match(accountBudgetName).customer_id;
}
/**
* Parse the account_budget_id from AccountBudget resource.
*
* @param {string} accountBudgetName
* A fully-qualified path representing AccountBudget resource.
* @returns {string} A string representing the account_budget_id.
*/
matchAccountBudgetIdFromAccountBudgetName(accountBudgetName) {
return this.pathTemplates.accountBudgetPathTemplate.match(accountBudgetName).account_budget_id;
}
/**
* Return a fully-qualified accountBudgetProposal resource name string.
*
* @param {string} customer_id
* @param {string} account_budget_proposal_id
* @returns {string} Resource name string.
*/
accountBudgetProposalPath(customerId, accountBudgetProposalId) {
return this.pathTemplates.accountBudgetProposalPathTemplate.render({
customer_id: customerId,
account_budget_proposal_id: accountBudgetProposalId,
});
}
/**
* Parse the customer_id from AccountBudgetProposal resource.
*
* @param {string} accountBudgetProposalName
* A fully-qualified path representing AccountBudgetProposal resource.
* @returns {string} A string representing the customer_id.
*/
matchCustomerIdFromAccountBudgetProposalName(accountBudgetProposalName) {
return this.pathTemplates.accountBudgetProposalPathTemplate.match(accountBudgetProposalName).customer_id;
}
/**
* Parse the account_budget_proposal_id from AccountBudgetProposal resource.
*
* @param {string} accountBudgetProposalName
* A fully-qualified path representing AccountBudgetProposal resource.
* @returns {string} A string representing the account_budget_proposal_id.
*/
matchAccountBudgetProposalIdFromAccountBudgetProposalName(accountBudgetProposalName) {
return this.pathTemplates.accountBudgetProposalPathTemplate.match(accountBudgetProposalName).account_budget_proposal_id;
}
/**
* Return a fully-qualified accountLink resource name string.
*
* @param {string} customer_id
* @param {string} account_link_id
* @returns {string} Resource name string.
*/
accountLinkPath(customerId, accountLinkId) {
return this.pathTemplates.accountLinkPathTemplate.render({
customer_id: customerId,
account_link_id: accountLinkId,
});
}
/**
* Parse the customer_id from AccountLink resource.
*
* @param {string} accountLinkName
* A fully-qualified path representing AccountLink resource.
* @returns {string} A string representing the customer_id.
*/
matchCustomerIdFromAccountLinkName(accountLinkName) {
return this.pathTemplates.accountLinkPathTemplate.match(accountLinkName).customer_id;
}
/**
* Parse the account_link_id from AccountLink resource.
*
* @param {string} accountLinkName
* A fully-qualified path representing AccountLink resource.
* @returns {string} A string representing the account_link_id.
*/
matchAccountLinkIdFromAccountLinkName(accountLinkName) {
return this.pathTemplates.accountLinkPathTemplate.match(accountLinkName).account_link_id;
}
/**
* Return a fully-qualified ad resource name string.
*
* @param {string} customer_id
* @param {string} ad_id
* @returns {string} Resource name string.
*/
adPath(customerId, adId) {
return this.pathTemplates.adPathTemplate.render({
customer_id: customerId,
ad_id: adId,
});
}
/**
* Parse the customer_id from Ad resource.
*
* @param {string} adName
* A fully-qualified path representing Ad resource.
* @returns {string} A string representing the customer_id.
*/
matchCustomerIdFromAdName(adName) {
return this.pathTemplates.adPathTemplate.match(adName).customer_id;
}
/**
* Parse the ad_id from Ad resource.
*
* @param {string} adName
* A fully-qualified path representing Ad resource.
* @returns {string} A string representing the ad_id.
*/
matchAdIdFromAdName(adName) {
return this.pathTemplates.adPathTemplate.match(adName).ad_id;
}
/**
* Return a fully-qualified adGroup resource name string.
*
* @param {string} customer_id
* @param {string} ad_group_id
* @returns {string} Resource name string.
*/
adGroupPath(customerId, adGroupId) {
return this.pathTemplates.adGroupPathTemplate.render({
customer_id: customerId,
ad_group_id: adGroupId,
});
}
/**
* Parse the customer_id from AdGroup resource.
*
* @param {string} adGroupName
* A fully-qualified path representing AdGroup resource.
* @returns {string} A string representing the customer_id.
*/
matchCustomerIdFromAdGroupName(adGroupName) {
return this.pathTemplates.adGroupPathTemplate.match(adGroupName).customer_id;
}
/**
* Parse the ad_group_id from AdGroup resource.
*
* @param {string} adGroupName
* A fully-qualified path representing AdGroup resource.
* @returns {string} A string representing the ad_group_id.
*/
matchAdGroupIdFromAdGroupName(adGroupName) {
return this.pathTemplates.adGroupPathTemplate.match(adGroupName).ad_group_id;
}
/**
* Return a fully-qualified adGroupAd resource name string.
*
* @param {string} customer_id
* @param {string} ad_group_id
* @param {string} ad_id
* @returns {string} Resource name string.
*/
adGroupAdPath(customerId, adGroupId, adId) {
return this.pathTemplates.adGroupAdPathTemplate.render({
customer_id: customerId,
ad_group_id: adGroupId,
ad_id: adId,
});
}
/**
* Parse the customer_id from AdGroupAd resource.
*
* @param {string} adGroupAdName
* A fully-qualified path representing AdGroupAd resource.
* @returns {string} A string representing the customer_id.
*/
matchCustomerIdFromAdGroupAdName(adGroupAdName) {
return this.pathTemplates.adGroupAdPathTemplate.mat