import { ClientOptions } from "../../client" ; import { CustomerOptions } from "../../types" ; import { Service } from "../../service" ; import { resources , services , protobuf , longrunning } from "../index" ; import { BaseMutationHookArgs , HookedCancellation , HookedResolution , Hooks , } from "../../hooks" ; export default class ServiceFactory extends Service { constructor ( clientOptions , customerOptions , hooks ? ) { super ( clientOptions , customerOptions , hooks ?? { } ) ; } link public get accessibleBiddingStrategies ( ) { const service = this . loadService < services . AccessibleBiddingStrategyService > ( "AccessibleBiddingStrategyServiceClient" ) ; return { description warning returns get : async ( resourceName ) : Promise < resources . AccessibleBiddingStrategy > => { const request = new services . GetAccessibleBiddingStrategyRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getAccessibleBiddingStrategy ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get accountBudgetProposals ( ) { const service = this . loadService < services . AccountBudgetProposalService > ( "AccountBudgetProposalServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateAccountBudgetProposalRequest , "validate_only" > > ; return { description warning returns get : async ( resourceName ) : Promise < resources . AccountBudgetProposal > => { const request = new services . GetAccountBudgetProposalRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getAccountBudgetProposal ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , description returns create : async ( accountBudgetProposals , options ? ) : Promise < services . MutateAccountBudgetProposalResponse > => { const ops = this . buildOperations < services . AccountBudgetProposalOperation , resources . IAccountBudgetProposal > ( "create" , accountBudgetProposals ) ; const request = this . buildRequest < services . AccountBudgetProposalOperation , services . IMutateAccountBudgetProposalRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "AccountBudgetProposalService.mutateAccountBudgetProposal" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateAccountBudgetProposal ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return response ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns remove : async ( accountBudgetProposals , options ? ) : Promise < services . MutateAccountBudgetProposalResponse > => { const ops = this . buildOperations < services . AccountBudgetProposalOperation , string > ( "remove" , accountBudgetProposals ) ; const request = this . buildRequest < services . AccountBudgetProposalOperation , services . IMutateAccountBudgetProposalRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "AccountBudgetProposalService.mutateAccountBudgetProposal" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateAccountBudgetProposal ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return response ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get accountBudgets ( ) { const service = this . loadService < services . AccountBudgetService > ( "AccountBudgetServiceClient" ) ; return { description warning returns get : async ( resourceName ) : Promise < resources . AccountBudget > => { const request = new services . GetAccountBudgetRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getAccountBudget ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get accountLinks ( ) { const service = this . loadService < services . AccountLinkService > ( "AccountLinkServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateAccountLinkRequest , "partial_failure" | "validate_only" > > ; return { description warning returns get : async ( resourceName ) : Promise < resources . AccountLink > => { const request = new services . GetAccountLinkRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getAccountLink ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , link createAccountLink : async ( request ) : Promise < services . CreateAccountLinkResponse > => { try { const [ response ] = await service . createAccountLink ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , description returns update : async ( accountLinks , options ? ) : Promise < services . MutateAccountLinkResponse > => { const ops = this . buildOperations < services . AccountLinkOperation , resources . IAccountLink > ( "update" , accountLinks , resources . AccountLink ) ; const request = this . buildRequest < services . AccountLinkOperation , services . IMutateAccountLinkRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "AccountLinkService.mutateAccountLink" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateAccountLink ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns remove : async ( accountLinks , options ? ) : Promise < services . MutateAccountLinkResponse > => { const ops = this . buildOperations < services . AccountLinkOperation , string > ( "remove" , accountLinks ) ; const request = this . buildRequest < services . AccountLinkOperation , services . IMutateAccountLinkRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "AccountLinkService.mutateAccountLink" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateAccountLink ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get adGroupAdAssetViews ( ) { const service = this . loadService < services . AdGroupAdAssetViewService > ( "AdGroupAdAssetViewServiceClient" ) ; return { description warning returns get : async ( resourceName ) : Promise < resources . AdGroupAdAssetView > => { const request = new services . GetAdGroupAdAssetViewRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getAdGroupAdAssetView ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get adGroupAdLabels ( ) { const service = this . loadService < services . AdGroupAdLabelService > ( "AdGroupAdLabelServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateAdGroupAdLabelsRequest , "partial_failure" | "validate_only" > > ; return { description warning returns get : async ( resourceName ) : Promise < resources . AdGroupAdLabel > => { const request = new services . GetAdGroupAdLabelRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getAdGroupAdLabel ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , description returns create : async ( adGroupAdLabels , options ? ) : Promise < services . MutateAdGroupAdLabelsResponse > => { const ops = this . buildOperations < services . AdGroupAdLabelOperation , resources . IAdGroupAdLabel > ( "create" , adGroupAdLabels ) ; const request = this . buildRequest < services . AdGroupAdLabelOperation , services . IMutateAdGroupAdLabelsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "AdGroupAdLabelService.mutateAdGroupAdLabels" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateAdGroupAdLabels ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns remove : async ( adGroupAdLabels , options ? ) : Promise < services . MutateAdGroupAdLabelsResponse > => { const ops = this . buildOperations < services . AdGroupAdLabelOperation , string > ( "remove" , adGroupAdLabels ) ; const request = this . buildRequest < services . AdGroupAdLabelOperation , services . IMutateAdGroupAdLabelsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "AdGroupAdLabelService.mutateAdGroupAdLabels" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateAdGroupAdLabels ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get adGroupAds ( ) { const service = this . loadService < services . AdGroupAdService > ( "AdGroupAdServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateAdGroupAdsRequest , "partial_failure" | "validate_only" | "response_content_type" > > ; return { description warning returns get : async ( resourceName ) : Promise < resources . AdGroupAd > => { const request = new services . GetAdGroupAdRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getAdGroupAd ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , description returns create : async ( adGroupAds , options ? ) : Promise < services . MutateAdGroupAdsResponse > => { const ops = this . buildOperations < services . AdGroupAdOperation , resources . IAdGroupAd > ( "create" , adGroupAds ) ; const request = this . buildRequest < services . AdGroupAdOperation , services . IMutateAdGroupAdsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "AdGroupAdService.mutateAdGroupAds" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateAdGroupAds ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns update : async ( adGroupAds , options ? ) : Promise < services . MutateAdGroupAdsResponse > => { const ops = this . buildOperations < services . AdGroupAdOperation , resources . IAdGroupAd > ( "update" , adGroupAds , resources . AdGroupAd ) ; const request = this . buildRequest < services . AdGroupAdOperation , services . IMutateAdGroupAdsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "AdGroupAdService.mutateAdGroupAds" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateAdGroupAds ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns remove : async ( adGroupAds , options ? ) : Promise < services . MutateAdGroupAdsResponse > => { const ops = this . buildOperations < services . AdGroupAdOperation , string > ( "remove" , adGroupAds ) ; const request = this . buildRequest < services . AdGroupAdOperation , services . IMutateAdGroupAdsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "AdGroupAdService.mutateAdGroupAds" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateAdGroupAds ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get adGroupAssets ( ) { const service = this . loadService < services . AdGroupAssetService > ( "AdGroupAssetServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateAdGroupAssetsRequest , "partial_failure" | "validate_only" | "response_content_type" > > ; return { description warning returns get : async ( resourceName ) : Promise < resources . AdGroupAsset > => { const request = new services . GetAdGroupAssetRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getAdGroupAsset ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , description returns create : async ( adGroupAssets , options ? ) : Promise < services . MutateAdGroupAssetsResponse > => { const ops = this . buildOperations < services . AdGroupAssetOperation , resources . IAdGroupAsset > ( "create" , adGroupAssets ) ; const request = this . buildRequest < services . AdGroupAssetOperation , services . IMutateAdGroupAssetsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "AdGroupAssetService.mutateAdGroupAssets" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateAdGroupAssets ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns update : async ( adGroupAssets , options ? ) : Promise < services . MutateAdGroupAssetsResponse > => { const ops = this . buildOperations < services . AdGroupAssetOperation , resources . IAdGroupAsset > ( "update" , adGroupAssets , resources . AdGroupAsset ) ; const request = this . buildRequest < services . AdGroupAssetOperation , services . IMutateAdGroupAssetsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "AdGroupAssetService.mutateAdGroupAssets" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateAdGroupAssets ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns remove : async ( adGroupAssets , options ? ) : Promise < services . MutateAdGroupAssetsResponse > => { const ops = this . buildOperations < services . AdGroupAssetOperation , string > ( "remove" , adGroupAssets ) ; const request = this . buildRequest < services . AdGroupAssetOperation , services . IMutateAdGroupAssetsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "AdGroupAssetService.mutateAdGroupAssets" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateAdGroupAssets ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get adGroupAudienceViews ( ) { const service = this . loadService < services . AdGroupAudienceViewService > ( "AdGroupAudienceViewServiceClient" ) ; return { description warning returns get : async ( resourceName ) : Promise < resources . AdGroupAudienceView > => { const request = new services . GetAdGroupAudienceViewRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getAdGroupAudienceView ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get adGroupBidModifiers ( ) { const service = this . loadService < services . AdGroupBidModifierService > ( "AdGroupBidModifierServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateAdGroupBidModifiersRequest , "partial_failure" | "validate_only" | "response_content_type" > > ; return { description warning returns get : async ( resourceName ) : Promise < resources . AdGroupBidModifier > => { const request = new services . GetAdGroupBidModifierRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getAdGroupBidModifier ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , description returns create : async ( adGroupBidModifiers , options ? ) : Promise < services . MutateAdGroupBidModifiersResponse > => { const ops = this . buildOperations < services . AdGroupBidModifierOperation , resources . IAdGroupBidModifier > ( "create" , adGroupBidModifiers ) ; const request = this . buildRequest < services . AdGroupBidModifierOperation , services . IMutateAdGroupBidModifiersRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "AdGroupBidModifierService.mutateAdGroupBidModifiers" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateAdGroupBidModifiers ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns update : async ( adGroupBidModifiers , options ? ) : Promise < services . MutateAdGroupBidModifiersResponse > => { const ops = this . buildOperations < services . AdGroupBidModifierOperation , resources . IAdGroupBidModifier > ( "update" , adGroupBidModifiers , resources . AdGroupBidModifier ) ; const request = this . buildRequest < services . AdGroupBidModifierOperation , services . IMutateAdGroupBidModifiersRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "AdGroupBidModifierService.mutateAdGroupBidModifiers" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateAdGroupBidModifiers ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns remove : async ( adGroupBidModifiers , options ? ) : Promise < services . MutateAdGroupBidModifiersResponse > => { const ops = this . buildOperations < services . AdGroupBidModifierOperation , string > ( "remove" , adGroupBidModifiers ) ; const request = this . buildRequest < services . AdGroupBidModifierOperation , services . IMutateAdGroupBidModifiersRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "AdGroupBidModifierService.mutateAdGroupBidModifiers" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateAdGroupBidModifiers ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get adGroupCriterionCustomizers ( ) { const service = this . loadService < services . AdGroupCriterionCustomizerService > ( "AdGroupCriterionCustomizerServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateAdGroupCriterionCustomizersRequest , "partial_failure" | "validate_only" | "response_content_type" > > ; return { description returns create : async ( adGroupCriterionCustomizers , options ? ) : Promise < services . MutateAdGroupCriterionCustomizersResponse > => { const ops = this . buildOperations < services . AdGroupCriterionCustomizerOperation , resources . IAdGroupCriterionCustomizer > ( "create" , adGroupCriterionCustomizers ) ; const request = this . buildRequest < services . AdGroupCriterionCustomizerOperation , services . IMutateAdGroupCriterionCustomizersRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "AdGroupCriterionCustomizerService.mutateAdGroupCriterionCustomizers" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateAdGroupCriterionCustomizers ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns remove : async ( adGroupCriterionCustomizers , options ? ) : Promise < services . MutateAdGroupCriterionCustomizersResponse > => { const ops = this . buildOperations < services . AdGroupCriterionCustomizerOperation , string > ( "remove" , adGroupCriterionCustomizers ) ; const request = this . buildRequest < services . AdGroupCriterionCustomizerOperation , services . IMutateAdGroupCriterionCustomizersRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "AdGroupCriterionCustomizerService.mutateAdGroupCriterionCustomizers" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateAdGroupCriterionCustomizers ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get adGroupCriterionLabels ( ) { const service = this . loadService < services . AdGroupCriterionLabelService > ( "AdGroupCriterionLabelServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateAdGroupCriterionLabelsRequest , "partial_failure" | "validate_only" > > ; return { description warning returns get : async ( resourceName ) : Promise < resources . AdGroupCriterionLabel > => { const request = new services . GetAdGroupCriterionLabelRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getAdGroupCriterionLabel ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , description returns create : async ( adGroupCriterionLabels , options ? ) : Promise < services . MutateAdGroupCriterionLabelsResponse > => { const ops = this . buildOperations < services . AdGroupCriterionLabelOperation , resources . IAdGroupCriterionLabel > ( "create" , adGroupCriterionLabels ) ; const request = this . buildRequest < services . AdGroupCriterionLabelOperation , services . IMutateAdGroupCriterionLabelsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "AdGroupCriterionLabelService.mutateAdGroupCriterionLabels" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateAdGroupCriterionLabels ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns remove : async ( adGroupCriterionLabels , options ? ) : Promise < services . MutateAdGroupCriterionLabelsResponse > => { const ops = this . buildOperations < services . AdGroupCriterionLabelOperation , string > ( "remove" , adGroupCriterionLabels ) ; const request = this . buildRequest < services . AdGroupCriterionLabelOperation , services . IMutateAdGroupCriterionLabelsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "AdGroupCriterionLabelService.mutateAdGroupCriterionLabels" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateAdGroupCriterionLabels ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get adGroupCriteria ( ) { const service = this . loadService < services . AdGroupCriterionService > ( "AdGroupCriterionServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateAdGroupCriteriaRequest , "partial_failure" | "validate_only" | "response_content_type" > > ; return { description warning returns get : async ( resourceName ) : Promise < resources . AdGroupCriterion > => { const request = new services . GetAdGroupCriterionRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getAdGroupCriterion ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , description returns create : async ( adGroupCriteria , options ? ) : Promise < services . MutateAdGroupCriteriaResponse > => { const ops = this . buildOperations < services . AdGroupCriterionOperation , resources . IAdGroupCriterion > ( "create" , adGroupCriteria ) ; const request = this . buildRequest < services . AdGroupCriterionOperation , services . IMutateAdGroupCriteriaRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "AdGroupCriterionService.mutateAdGroupCriteria" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateAdGroupCriteria ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns update : async ( adGroupCriteria , options ? ) : Promise < services . MutateAdGroupCriteriaResponse > => { const ops = this . buildOperations < services . AdGroupCriterionOperation , resources . IAdGroupCriterion > ( "update" , adGroupCriteria , resources . AdGroupCriterion ) ; const request = this . buildRequest < services . AdGroupCriterionOperation , services . IMutateAdGroupCriteriaRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "AdGroupCriterionService.mutateAdGroupCriteria" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateAdGroupCriteria ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns remove : async ( adGroupCriteria , options ? ) : Promise < services . MutateAdGroupCriteriaResponse > => { const ops = this . buildOperations < services . AdGroupCriterionOperation , string > ( "remove" , adGroupCriteria ) ; const request = this . buildRequest < services . AdGroupCriterionOperation , services . IMutateAdGroupCriteriaRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "AdGroupCriterionService.mutateAdGroupCriteria" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateAdGroupCriteria ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get adGroupCriterionSimulations ( ) { const service = this . loadService < services . AdGroupCriterionSimulationService > ( "AdGroupCriterionSimulationServiceClient" ) ; return { description warning returns get : async ( resourceName ) : Promise < resources . AdGroupCriterionSimulation > => { const request = new services . GetAdGroupCriterionSimulationRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getAdGroupCriterionSimulation ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get adGroupCustomizers ( ) { const service = this . loadService < services . AdGroupCustomizerService > ( "AdGroupCustomizerServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateAdGroupCustomizersRequest , "partial_failure" | "validate_only" | "response_content_type" > > ; return { description returns create : async ( adGroupCustomizers , options ? ) : Promise < services . MutateAdGroupCustomizersResponse > => { const ops = this . buildOperations < services . AdGroupCustomizerOperation , resources . IAdGroupCustomizer > ( "create" , adGroupCustomizers ) ; const request = this . buildRequest < services . AdGroupCustomizerOperation , services . IMutateAdGroupCustomizersRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "AdGroupCustomizerService.mutateAdGroupCustomizers" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateAdGroupCustomizers ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns remove : async ( adGroupCustomizers , options ? ) : Promise < services . MutateAdGroupCustomizersResponse > => { const ops = this . buildOperations < services . AdGroupCustomizerOperation , string > ( "remove" , adGroupCustomizers ) ; const request = this . buildRequest < services . AdGroupCustomizerOperation , services . IMutateAdGroupCustomizersRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "AdGroupCustomizerService.mutateAdGroupCustomizers" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateAdGroupCustomizers ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get adGroupExtensionSettings ( ) { const service = this . loadService < services . AdGroupExtensionSettingService > ( "AdGroupExtensionSettingServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateAdGroupExtensionSettingsRequest , "partial_failure" | "validate_only" > > ; return { description warning returns get : async ( resourceName ) : Promise < resources . AdGroupExtensionSetting > => { const request = new services . GetAdGroupExtensionSettingRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getAdGroupExtensionSetting ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , description returns create : async ( adGroupExtensionSettings , options ? ) : Promise < services . MutateAdGroupExtensionSettingsResponse > => { const ops = this . buildOperations < services . AdGroupExtensionSettingOperation , resources . IAdGroupExtensionSetting > ( "create" , adGroupExtensionSettings ) ; const request = this . buildRequest < services . AdGroupExtensionSettingOperation , services . IMutateAdGroupExtensionSettingsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "AdGroupExtensionSettingService.mutateAdGroupExtensionSettings" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateAdGroupExtensionSettings ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns update : async ( adGroupExtensionSettings , options ? ) : Promise < services . MutateAdGroupExtensionSettingsResponse > => { const ops = this . buildOperations < services . AdGroupExtensionSettingOperation , resources . IAdGroupExtensionSetting > ( "update" , adGroupExtensionSettings , resources . AdGroupExtensionSetting ) ; const request = this . buildRequest < services . AdGroupExtensionSettingOperation , services . IMutateAdGroupExtensionSettingsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "AdGroupExtensionSettingService.mutateAdGroupExtensionSettings" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateAdGroupExtensionSettings ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns remove : async ( adGroupExtensionSettings , options ? ) : Promise < services . MutateAdGroupExtensionSettingsResponse > => { const ops = this . buildOperations < services . AdGroupExtensionSettingOperation , string > ( "remove" , adGroupExtensionSettings ) ; const request = this . buildRequest < services . AdGroupExtensionSettingOperation , services . IMutateAdGroupExtensionSettingsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "AdGroupExtensionSettingService.mutateAdGroupExtensionSettings" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateAdGroupExtensionSettings ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get adGroupFeeds ( ) { const service = this . loadService < services . AdGroupFeedService > ( "AdGroupFeedServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateAdGroupFeedsRequest , "partial_failure" | "validate_only" | "response_content_type" > > ; return { description warning returns get : async ( resourceName ) : Promise < resources . AdGroupFeed > => { const request = new services . GetAdGroupFeedRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getAdGroupFeed ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , description returns create : async ( adGroupFeeds , options ? ) : Promise < services . MutateAdGroupFeedsResponse > => { const ops = this . buildOperations < services . AdGroupFeedOperation , resources . IAdGroupFeed > ( "create" , adGroupFeeds ) ; const request = this . buildRequest < services . AdGroupFeedOperation , services . IMutateAdGroupFeedsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "AdGroupFeedService.mutateAdGroupFeeds" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateAdGroupFeeds ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns update : async ( adGroupFeeds , options ? ) : Promise < services . MutateAdGroupFeedsResponse > => { const ops = this . buildOperations < services . AdGroupFeedOperation , resources . IAdGroupFeed > ( "update" , adGroupFeeds , resources . AdGroupFeed ) ; const request = this . buildRequest < services . AdGroupFeedOperation , services . IMutateAdGroupFeedsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "AdGroupFeedService.mutateAdGroupFeeds" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateAdGroupFeeds ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns remove : async ( adGroupFeeds , options ? ) : Promise < services . MutateAdGroupFeedsResponse > => { const ops = this . buildOperations < services . AdGroupFeedOperation , string > ( "remove" , adGroupFeeds ) ; const request = this . buildRequest < services . AdGroupFeedOperation , services . IMutateAdGroupFeedsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "AdGroupFeedService.mutateAdGroupFeeds" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateAdGroupFeeds ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get adGroupLabels ( ) { const service = this . loadService < services . AdGroupLabelService > ( "AdGroupLabelServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateAdGroupLabelsRequest , "partial_failure" | "validate_only" > > ; return { description warning returns get : async ( resourceName ) : Promise < resources . AdGroupLabel > => { const request = new services . GetAdGroupLabelRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getAdGroupLabel ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , description returns create : async ( adGroupLabels , options ? ) : Promise < services . MutateAdGroupLabelsResponse > => { const ops = this . buildOperations < services . AdGroupLabelOperation , resources . IAdGroupLabel > ( "create" , adGroupLabels ) ; const request = this . buildRequest < services . AdGroupLabelOperation , services . IMutateAdGroupLabelsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "AdGroupLabelService.mutateAdGroupLabels" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateAdGroupLabels ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns remove : async ( adGroupLabels , options ? ) : Promise < services . MutateAdGroupLabelsResponse > => { const ops = this . buildOperations < services . AdGroupLabelOperation , string > ( "remove" , adGroupLabels ) ; const request = this . buildRequest < services . AdGroupLabelOperation , services . IMutateAdGroupLabelsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "AdGroupLabelService.mutateAdGroupLabels" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateAdGroupLabels ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get adGroups ( ) { const service = this . loadService < services . AdGroupService > ( "AdGroupServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateAdGroupsRequest , "partial_failure" | "validate_only" | "response_content_type" > > ; return { description warning returns get : async ( resourceName ) : Promise < resources . AdGroup > => { const request = new services . GetAdGroupRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getAdGroup ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , description returns create : async ( adGroups , options ? ) : Promise < services . MutateAdGroupsResponse > => { const ops = this . buildOperations < services . AdGroupOperation , resources . IAdGroup > ( "create" , adGroups ) ; const request = this . buildRequest < services . AdGroupOperation , services . IMutateAdGroupsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "AdGroupService.mutateAdGroups" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateAdGroups ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns update : async ( adGroups , options ? ) : Promise < services . MutateAdGroupsResponse > => { const ops = this . buildOperations < services . AdGroupOperation , resources . IAdGroup > ( "update" , adGroups , resources . AdGroup ) ; const request = this . buildRequest < services . AdGroupOperation , services . IMutateAdGroupsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "AdGroupService.mutateAdGroups" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateAdGroups ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns remove : async ( adGroups , options ? ) : Promise < services . MutateAdGroupsResponse > => { const ops = this . buildOperations < services . AdGroupOperation , string > ( "remove" , adGroups ) ; const request = this . buildRequest < services . AdGroupOperation , services . IMutateAdGroupsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "AdGroupService.mutateAdGroups" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateAdGroups ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get adGroupSimulations ( ) { const service = this . loadService < services . AdGroupSimulationService > ( "AdGroupSimulationServiceClient" ) ; return { description warning returns get : async ( resourceName ) : Promise < resources . AdGroupSimulation > => { const request = new services . GetAdGroupSimulationRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getAdGroupSimulation ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get adParameters ( ) { const service = this . loadService < services . AdParameterService > ( "AdParameterServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateAdParametersRequest , "partial_failure" | "validate_only" | "response_content_type" > > ; return { description warning returns get : async ( resourceName ) : Promise < resources . AdParameter > => { const request = new services . GetAdParameterRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getAdParameter ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , description returns create : async ( adParameters , options ? ) : Promise < services . MutateAdParametersResponse > => { const ops = this . buildOperations < services . AdParameterOperation , resources . IAdParameter > ( "create" , adParameters ) ; const request = this . buildRequest < services . AdParameterOperation , services . IMutateAdParametersRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "AdParameterService.mutateAdParameters" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateAdParameters ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns update : async ( adParameters , options ? ) : Promise < services . MutateAdParametersResponse > => { const ops = this . buildOperations < services . AdParameterOperation , resources . IAdParameter > ( "update" , adParameters , resources . AdParameter ) ; const request = this . buildRequest < services . AdParameterOperation , services . IMutateAdParametersRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "AdParameterService.mutateAdParameters" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateAdParameters ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns remove : async ( adParameters , options ? ) : Promise < services . MutateAdParametersResponse > => { const ops = this . buildOperations < services . AdParameterOperation , string > ( "remove" , adParameters ) ; const request = this . buildRequest < services . AdParameterOperation , services . IMutateAdParametersRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "AdParameterService.mutateAdParameters" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateAdParameters ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get adScheduleViews ( ) { const service = this . loadService < services . AdScheduleViewService > ( "AdScheduleViewServiceClient" ) ; return { description warning returns get : async ( resourceName ) : Promise < resources . AdScheduleView > => { const request = new services . GetAdScheduleViewRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getAdScheduleView ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get ads ( ) { const service = this . loadService < services . AdService > ( "AdServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateAdsRequest , "partial_failure" | "response_content_type" | "validate_only" > > ; return { description warning returns get : async ( resourceName ) : Promise < resources . Ad > => { const request = new services . GetAdRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getAd ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , description returns update : async ( ads , options ? ) : Promise < services . MutateAdsResponse > => { const ops = this . buildOperations < services . AdOperation , resources . IAd > ( "update" , ads , resources . Ad ) ; const request = this . buildRequest < services . AdOperation , services . IMutateAdsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "AdService.mutateAds" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateAds ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get ageRangeViews ( ) { const service = this . loadService < services . AgeRangeViewService > ( "AgeRangeViewServiceClient" ) ; return { description warning returns get : async ( resourceName ) : Promise < resources . AgeRangeView > => { const request = new services . GetAgeRangeViewRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getAgeRangeView ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get assetFieldTypeViews ( ) { const service = this . loadService < services . AssetFieldTypeViewService > ( "AssetFieldTypeViewServiceClient" ) ; return { description warning returns get : async ( resourceName ) : Promise < resources . AssetFieldTypeView > => { const request = new services . GetAssetFieldTypeViewRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getAssetFieldTypeView ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get assetGroupAssets ( ) { const service = this . loadService < services . AssetGroupAssetService > ( "AssetGroupAssetServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateAssetGroupAssetsRequest , "partial_failure" | "validate_only" > > ; return { description warning returns get : async ( resourceName ) : Promise < resources . AssetGroupAsset > => { const request = new services . GetAssetGroupAssetRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getAssetGroupAsset ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , description returns create : async ( assetGroupAssets , options ? ) : Promise < services . MutateAssetGroupAssetsResponse > => { const ops = this . buildOperations < services . AssetGroupAssetOperation , resources . IAssetGroupAsset > ( "create" , assetGroupAssets ) ; const request = this . buildRequest < services . AssetGroupAssetOperation , services . IMutateAssetGroupAssetsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "AssetGroupAssetService.mutateAssetGroupAssets" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateAssetGroupAssets ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns update : async ( assetGroupAssets , options ? ) : Promise < services . MutateAssetGroupAssetsResponse > => { const ops = this . buildOperations < services . AssetGroupAssetOperation , resources . IAssetGroupAsset > ( "update" , assetGroupAssets , resources . AssetGroupAsset ) ; const request = this . buildRequest < services . AssetGroupAssetOperation , services . IMutateAssetGroupAssetsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "AssetGroupAssetService.mutateAssetGroupAssets" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateAssetGroupAssets ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns remove : async ( assetGroupAssets , options ? ) : Promise < services . MutateAssetGroupAssetsResponse > => { const ops = this . buildOperations < services . AssetGroupAssetOperation , string > ( "remove" , assetGroupAssets ) ; const request = this . buildRequest < services . AssetGroupAssetOperation , services . IMutateAssetGroupAssetsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "AssetGroupAssetService.mutateAssetGroupAssets" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateAssetGroupAssets ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get assetGroupListingGroupFilters ( ) { const service = this . loadService < services . AssetGroupListingGroupFilterService > ( "AssetGroupListingGroupFilterServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateAssetGroupListingGroupFiltersRequest , "validate_only" | "response_content_type" > > ; return { description returns create : async ( assetGroupListingGroupFilters , options ? ) : Promise < services . MutateAssetGroupListingGroupFiltersResponse > => { const ops = this . buildOperations < services . AssetGroupListingGroupFilterOperation , resources . IAssetGroupListingGroupFilter > ( "create" , assetGroupListingGroupFilters ) ; const request = this . buildRequest < services . AssetGroupListingGroupFilterOperation , services . IMutateAssetGroupListingGroupFiltersRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "AssetGroupListingGroupFilterService.mutateAssetGroupListingGroupFilters" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateAssetGroupListingGroupFilters ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return response ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns update : async ( assetGroupListingGroupFilters , options ? ) : Promise < services . MutateAssetGroupListingGroupFiltersResponse > => { const ops = this . buildOperations < services . AssetGroupListingGroupFilterOperation , resources . IAssetGroupListingGroupFilter > ( "update" , assetGroupListingGroupFilters , resources . AssetGroupListingGroupFilter ) ; const request = this . buildRequest < services . AssetGroupListingGroupFilterOperation , services . IMutateAssetGroupListingGroupFiltersRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "AssetGroupListingGroupFilterService.mutateAssetGroupListingGroupFilters" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateAssetGroupListingGroupFilters ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return response ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns remove : async ( assetGroupListingGroupFilters , options ? ) : Promise < services . MutateAssetGroupListingGroupFiltersResponse > => { const ops = this . buildOperations < services . AssetGroupListingGroupFilterOperation , string > ( "remove" , assetGroupListingGroupFilters ) ; const request = this . buildRequest < services . AssetGroupListingGroupFilterOperation , services . IMutateAssetGroupListingGroupFiltersRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "AssetGroupListingGroupFilterService.mutateAssetGroupListingGroupFilters" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateAssetGroupListingGroupFilters ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return response ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get assetGroups ( ) { const service = this . loadService < services . AssetGroupService > ( "AssetGroupServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateAssetGroupsRequest , "validate_only" > > ; return { description warning returns get : async ( resourceName ) : Promise < resources . AssetGroup > => { const request = new services . GetAssetGroupRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getAssetGroup ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , description returns create : async ( assetGroups , options ? ) : Promise < services . MutateAssetGroupsResponse > => { const ops = this . buildOperations < services . AssetGroupOperation , resources . IAssetGroup > ( "create" , assetGroups ) ; const request = this . buildRequest < services . AssetGroupOperation , services . IMutateAssetGroupsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "AssetGroupService.mutateAssetGroups" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateAssetGroups ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return response ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns update : async ( assetGroups , options ? ) : Promise < services . MutateAssetGroupsResponse > => { const ops = this . buildOperations < services . AssetGroupOperation , resources . IAssetGroup > ( "update" , assetGroups , resources . AssetGroup ) ; const request = this . buildRequest < services . AssetGroupOperation , services . IMutateAssetGroupsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "AssetGroupService.mutateAssetGroups" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateAssetGroups ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return response ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns remove : async ( assetGroups , options ? ) : Promise < services . MutateAssetGroupsResponse > => { const ops = this . buildOperations < services . AssetGroupOperation , string > ( "remove" , assetGroups ) ; const request = this . buildRequest < services . AssetGroupOperation , services . IMutateAssetGroupsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "AssetGroupService.mutateAssetGroups" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateAssetGroups ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return response ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get assets ( ) { const service = this . loadService < services . AssetService > ( "AssetServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateAssetsRequest , "partial_failure" | "response_content_type" | "validate_only" > > ; return { description warning returns get : async ( resourceName ) : Promise < resources . Asset > => { const request = new services . GetAssetRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getAsset ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , description returns create : async ( assets , options ? ) : Promise < services . MutateAssetsResponse > => { const ops = this . buildOperations < services . AssetOperation , resources . IAsset > ( "create" , assets ) ; const request = this . buildRequest < services . AssetOperation , services . IMutateAssetsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "AssetService.mutateAssets" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateAssets ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns update : async ( assets , options ? ) : Promise < services . MutateAssetsResponse > => { const ops = this . buildOperations < services . AssetOperation , resources . IAsset > ( "update" , assets , resources . Asset ) ; const request = this . buildRequest < services . AssetOperation , services . IMutateAssetsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "AssetService.mutateAssets" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateAssets ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get assetSetAssets ( ) { const service = this . loadService < services . AssetSetAssetService > ( "AssetSetAssetServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateAssetSetAssetsRequest , "partial_failure" | "validate_only" | "response_content_type" > > ; return { description returns create : async ( assetSetAssets , options ? ) : Promise < services . MutateAssetSetAssetsResponse > => { const ops = this . buildOperations < services . AssetSetAssetOperation , resources . IAssetSetAsset > ( "create" , assetSetAssets ) ; const request = this . buildRequest < services . AssetSetAssetOperation , services . IMutateAssetSetAssetsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "AssetSetAssetService.mutateAssetSetAssets" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateAssetSetAssets ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns remove : async ( assetSetAssets , options ? ) : Promise < services . MutateAssetSetAssetsResponse > => { const ops = this . buildOperations < services . AssetSetAssetOperation , string > ( "remove" , assetSetAssets ) ; const request = this . buildRequest < services . AssetSetAssetOperation , services . IMutateAssetSetAssetsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "AssetSetAssetService.mutateAssetSetAssets" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateAssetSetAssets ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get assetSets ( ) { const service = this . loadService < services . AssetSetService > ( "AssetSetServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateAssetSetsRequest , "partial_failure" | "validate_only" | "response_content_type" > > ; return { description returns create : async ( assetSets , options ? ) : Promise < services . MutateAssetSetsResponse > => { const ops = this . buildOperations < services . AssetSetOperation , resources . IAssetSet > ( "create" , assetSets ) ; const request = this . buildRequest < services . AssetSetOperation , services . IMutateAssetSetsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "AssetSetService.mutateAssetSets" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateAssetSets ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns update : async ( assetSets , options ? ) : Promise < services . MutateAssetSetsResponse > => { const ops = this . buildOperations < services . AssetSetOperation , resources . IAssetSet > ( "update" , assetSets , resources . AssetSet ) ; const request = this . buildRequest < services . AssetSetOperation , services . IMutateAssetSetsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "AssetSetService.mutateAssetSets" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateAssetSets ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns remove : async ( assetSets , options ? ) : Promise < services . MutateAssetSetsResponse > => { const ops = this . buildOperations < services . AssetSetOperation , string > ( "remove" , assetSets ) ; const request = this . buildRequest < services . AssetSetOperation , services . IMutateAssetSetsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "AssetSetService.mutateAssetSets" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateAssetSets ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get batchJobs ( ) { const service = this . loadService < services . BatchJobService > ( "BatchJobServiceClient" ) ; type MutateOptions = never ; return { description returns create : async ( batchJobs , options ? ) : Promise < services . MutateBatchJobResponse > => { const ops = this . buildOperations < services . BatchJobOperation , resources . IBatchJob > ( "create" , batchJobs ) ; const request = this . buildRequest < services . BatchJobOperation , services . IMutateBatchJobRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "BatchJobService.mutateBatchJob" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateBatchJob ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return response ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description warning returns get : async ( resourceName ) : Promise < resources . BatchJob > => { const request = new services . GetBatchJobRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getBatchJob ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , link listBatchJobResults : async ( request ) : Promise < services . ListBatchJobResultsResponse > => { try { const [ response ] = await service . listBatchJobResults ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , link runBatchJob : async ( request ) : Promise < longrunning . Operation > => { try { const [ response ] = await service . runBatchJob ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , link addBatchJobOperations : async ( request ) : Promise < services . AddBatchJobOperationsResponse > => { try { const [ response ] = await service . addBatchJobOperations ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get biddingDataExclusions ( ) { const service = this . loadService < services . BiddingDataExclusionService > ( "BiddingDataExclusionServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateBiddingDataExclusionsRequest , "partial_failure" | "validate_only" | "response_content_type" > > ; return { description warning returns get : async ( resourceName ) : Promise < resources . BiddingDataExclusion > => { const request = new services . GetBiddingDataExclusionRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getBiddingDataExclusion ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , description returns create : async ( biddingDataExclusions , options ? ) : Promise < services . MutateBiddingDataExclusionsResponse > => { const ops = this . buildOperations < services . BiddingDataExclusionOperation , resources . IBiddingDataExclusion > ( "create" , biddingDataExclusions ) ; const request = this . buildRequest < services . BiddingDataExclusionOperation , services . IMutateBiddingDataExclusionsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "BiddingDataExclusionService.mutateBiddingDataExclusions" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateBiddingDataExclusions ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns update : async ( biddingDataExclusions , options ? ) : Promise < services . MutateBiddingDataExclusionsResponse > => { const ops = this . buildOperations < services . BiddingDataExclusionOperation , resources . IBiddingDataExclusion > ( "update" , biddingDataExclusions , resources . BiddingDataExclusion ) ; const request = this . buildRequest < services . BiddingDataExclusionOperation , services . IMutateBiddingDataExclusionsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "BiddingDataExclusionService.mutateBiddingDataExclusions" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateBiddingDataExclusions ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns remove : async ( biddingDataExclusions , options ? ) : Promise < services . MutateBiddingDataExclusionsResponse > => { const ops = this . buildOperations < services . BiddingDataExclusionOperation , string > ( "remove" , biddingDataExclusions ) ; const request = this . buildRequest < services . BiddingDataExclusionOperation , services . IMutateBiddingDataExclusionsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "BiddingDataExclusionService.mutateBiddingDataExclusions" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateBiddingDataExclusions ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get biddingSeasonalityAdjustments ( ) { const service = this . loadService < services . BiddingSeasonalityAdjustmentService > ( "BiddingSeasonalityAdjustmentServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateBiddingSeasonalityAdjustmentsRequest , "partial_failure" | "validate_only" | "response_content_type" > > ; return { description warning returns get : async ( resourceName ) : Promise < resources . BiddingSeasonalityAdjustment > => { const request = new services . GetBiddingSeasonalityAdjustmentRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getBiddingSeasonalityAdjustment ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , description returns create : async ( biddingSeasonalityAdjustments , options ? ) : Promise < services . MutateBiddingSeasonalityAdjustmentsResponse > => { const ops = this . buildOperations < services . BiddingSeasonalityAdjustmentOperation , resources . IBiddingSeasonalityAdjustment > ( "create" , biddingSeasonalityAdjustments ) ; const request = this . buildRequest < services . BiddingSeasonalityAdjustmentOperation , services . IMutateBiddingSeasonalityAdjustmentsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "BiddingSeasonalityAdjustmentService.mutateBiddingSeasonalityAdjustments" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateBiddingSeasonalityAdjustments ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns update : async ( biddingSeasonalityAdjustments , options ? ) : Promise < services . MutateBiddingSeasonalityAdjustmentsResponse > => { const ops = this . buildOperations < services . BiddingSeasonalityAdjustmentOperation , resources . IBiddingSeasonalityAdjustment > ( "update" , biddingSeasonalityAdjustments , resources . BiddingSeasonalityAdjustment ) ; const request = this . buildRequest < services . BiddingSeasonalityAdjustmentOperation , services . IMutateBiddingSeasonalityAdjustmentsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "BiddingSeasonalityAdjustmentService.mutateBiddingSeasonalityAdjustments" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateBiddingSeasonalityAdjustments ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns remove : async ( biddingSeasonalityAdjustments , options ? ) : Promise < services . MutateBiddingSeasonalityAdjustmentsResponse > => { const ops = this . buildOperations < services . BiddingSeasonalityAdjustmentOperation , string > ( "remove" , biddingSeasonalityAdjustments ) ; const request = this . buildRequest < services . BiddingSeasonalityAdjustmentOperation , services . IMutateBiddingSeasonalityAdjustmentsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "BiddingSeasonalityAdjustmentService.mutateBiddingSeasonalityAdjustments" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateBiddingSeasonalityAdjustments ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get biddingStrategies ( ) { const service = this . loadService < services . BiddingStrategyService > ( "BiddingStrategyServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateBiddingStrategiesRequest , "partial_failure" | "validate_only" | "response_content_type" > > ; return { description warning returns get : async ( resourceName ) : Promise < resources . BiddingStrategy > => { const request = new services . GetBiddingStrategyRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getBiddingStrategy ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , description returns create : async ( biddingStrategies , options ? ) : Promise < services . MutateBiddingStrategiesResponse > => { const ops = this . buildOperations < services . BiddingStrategyOperation , resources . IBiddingStrategy > ( "create" , biddingStrategies ) ; const request = this . buildRequest < services . BiddingStrategyOperation , services . IMutateBiddingStrategiesRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "BiddingStrategyService.mutateBiddingStrategies" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateBiddingStrategies ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns update : async ( biddingStrategies , options ? ) : Promise < services . MutateBiddingStrategiesResponse > => { const ops = this . buildOperations < services . BiddingStrategyOperation , resources . IBiddingStrategy > ( "update" , biddingStrategies , resources . BiddingStrategy ) ; const request = this . buildRequest < services . BiddingStrategyOperation , services . IMutateBiddingStrategiesRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "BiddingStrategyService.mutateBiddingStrategies" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateBiddingStrategies ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns remove : async ( biddingStrategies , options ? ) : Promise < services . MutateBiddingStrategiesResponse > => { const ops = this . buildOperations < services . BiddingStrategyOperation , string > ( "remove" , biddingStrategies ) ; const request = this . buildRequest < services . BiddingStrategyOperation , services . IMutateBiddingStrategiesRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "BiddingStrategyService.mutateBiddingStrategies" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateBiddingStrategies ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get campaignAssets ( ) { const service = this . loadService < services . CampaignAssetService > ( "CampaignAssetServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateCampaignAssetsRequest , "partial_failure" | "validate_only" | "response_content_type" > > ; return { description warning returns get : async ( resourceName ) : Promise < resources . CampaignAsset > => { const request = new services . GetCampaignAssetRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getCampaignAsset ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , description returns create : async ( campaignAssets , options ? ) : Promise < services . MutateCampaignAssetsResponse > => { const ops = this . buildOperations < services . CampaignAssetOperation , resources . ICampaignAsset > ( "create" , campaignAssets ) ; const request = this . buildRequest < services . CampaignAssetOperation , services . IMutateCampaignAssetsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "CampaignAssetService.mutateCampaignAssets" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateCampaignAssets ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns update : async ( campaignAssets , options ? ) : Promise < services . MutateCampaignAssetsResponse > => { const ops = this . buildOperations < services . CampaignAssetOperation , resources . ICampaignAsset > ( "update" , campaignAssets , resources . CampaignAsset ) ; const request = this . buildRequest < services . CampaignAssetOperation , services . IMutateCampaignAssetsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "CampaignAssetService.mutateCampaignAssets" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateCampaignAssets ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns remove : async ( campaignAssets , options ? ) : Promise < services . MutateCampaignAssetsResponse > => { const ops = this . buildOperations < services . CampaignAssetOperation , string > ( "remove" , campaignAssets ) ; const request = this . buildRequest < services . CampaignAssetOperation , services . IMutateCampaignAssetsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "CampaignAssetService.mutateCampaignAssets" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateCampaignAssets ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get campaignAssetSets ( ) { const service = this . loadService < services . CampaignAssetSetService > ( "CampaignAssetSetServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateCampaignAssetSetsRequest , "partial_failure" | "validate_only" | "response_content_type" > > ; return { description returns create : async ( campaignAssetSets , options ? ) : Promise < services . MutateCampaignAssetSetsResponse > => { const ops = this . buildOperations < services . CampaignAssetSetOperation , resources . ICampaignAssetSet > ( "create" , campaignAssetSets ) ; const request = this . buildRequest < services . CampaignAssetSetOperation , services . IMutateCampaignAssetSetsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "CampaignAssetSetService.mutateCampaignAssetSets" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateCampaignAssetSets ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns remove : async ( campaignAssetSets , options ? ) : Promise < services . MutateCampaignAssetSetsResponse > => { const ops = this . buildOperations < services . CampaignAssetSetOperation , string > ( "remove" , campaignAssetSets ) ; const request = this . buildRequest < services . CampaignAssetSetOperation , services . IMutateCampaignAssetSetsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "CampaignAssetSetService.mutateCampaignAssetSets" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateCampaignAssetSets ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get campaignBidModifiers ( ) { const service = this . loadService < services . CampaignBidModifierService > ( "CampaignBidModifierServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateCampaignBidModifiersRequest , "partial_failure" | "validate_only" | "response_content_type" > > ; return { description warning returns get : async ( resourceName ) : Promise < resources . CampaignBidModifier > => { const request = new services . GetCampaignBidModifierRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getCampaignBidModifier ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , description returns create : async ( campaignBidModifiers , options ? ) : Promise < services . MutateCampaignBidModifiersResponse > => { const ops = this . buildOperations < services . CampaignBidModifierOperation , resources . ICampaignBidModifier > ( "create" , campaignBidModifiers ) ; const request = this . buildRequest < services . CampaignBidModifierOperation , services . IMutateCampaignBidModifiersRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "CampaignBidModifierService.mutateCampaignBidModifiers" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateCampaignBidModifiers ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns update : async ( campaignBidModifiers , options ? ) : Promise < services . MutateCampaignBidModifiersResponse > => { const ops = this . buildOperations < services . CampaignBidModifierOperation , resources . ICampaignBidModifier > ( "update" , campaignBidModifiers , resources . CampaignBidModifier ) ; const request = this . buildRequest < services . CampaignBidModifierOperation , services . IMutateCampaignBidModifiersRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "CampaignBidModifierService.mutateCampaignBidModifiers" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateCampaignBidModifiers ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns remove : async ( campaignBidModifiers , options ? ) : Promise < services . MutateCampaignBidModifiersResponse > => { const ops = this . buildOperations < services . CampaignBidModifierOperation , string > ( "remove" , campaignBidModifiers ) ; const request = this . buildRequest < services . CampaignBidModifierOperation , services . IMutateCampaignBidModifiersRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "CampaignBidModifierService.mutateCampaignBidModifiers" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateCampaignBidModifiers ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get campaignBudgets ( ) { const service = this . loadService < services . CampaignBudgetService > ( "CampaignBudgetServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateCampaignBudgetsRequest , "partial_failure" | "validate_only" | "response_content_type" > > ; return { description warning returns get : async ( resourceName ) : Promise < resources . CampaignBudget > => { const request = new services . GetCampaignBudgetRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getCampaignBudget ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , description returns create : async ( campaignBudgets , options ? ) : Promise < services . MutateCampaignBudgetsResponse > => { const ops = this . buildOperations < services . CampaignBudgetOperation , resources . ICampaignBudget > ( "create" , campaignBudgets ) ; const request = this . buildRequest < services . CampaignBudgetOperation , services . IMutateCampaignBudgetsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "CampaignBudgetService.mutateCampaignBudgets" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateCampaignBudgets ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns update : async ( campaignBudgets , options ? ) : Promise < services . MutateCampaignBudgetsResponse > => { const ops = this . buildOperations < services . CampaignBudgetOperation , resources . ICampaignBudget > ( "update" , campaignBudgets , resources . CampaignBudget ) ; const request = this . buildRequest < services . CampaignBudgetOperation , services . IMutateCampaignBudgetsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "CampaignBudgetService.mutateCampaignBudgets" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateCampaignBudgets ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns remove : async ( campaignBudgets , options ? ) : Promise < services . MutateCampaignBudgetsResponse > => { const ops = this . buildOperations < services . CampaignBudgetOperation , string > ( "remove" , campaignBudgets ) ; const request = this . buildRequest < services . CampaignBudgetOperation , services . IMutateCampaignBudgetsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "CampaignBudgetService.mutateCampaignBudgets" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateCampaignBudgets ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get campaignConversionGoals ( ) { const service = this . loadService < services . CampaignConversionGoalService > ( "CampaignConversionGoalServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateCampaignConversionGoalsRequest , "validate_only" > > ; return { description returns update : async ( campaignConversionGoals , options ? ) : Promise < services . MutateCampaignConversionGoalsResponse > => { const ops = this . buildOperations < services . CampaignConversionGoalOperation , resources . ICampaignConversionGoal > ( "update" , campaignConversionGoals , resources . CampaignConversionGoal ) ; const request = this . buildRequest < services . CampaignConversionGoalOperation , services . IMutateCampaignConversionGoalsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "CampaignConversionGoalService.mutateCampaignConversionGoals" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateCampaignConversionGoals ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return response ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get campaignCriteria ( ) { const service = this . loadService < services . CampaignCriterionService > ( "CampaignCriterionServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateCampaignCriteriaRequest , "partial_failure" | "validate_only" | "response_content_type" > > ; return { description warning returns get : async ( resourceName ) : Promise < resources . CampaignCriterion > => { const request = new services . GetCampaignCriterionRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getCampaignCriterion ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , description returns create : async ( campaignCriteria , options ? ) : Promise < services . MutateCampaignCriteriaResponse > => { const ops = this . buildOperations < services . CampaignCriterionOperation , resources . ICampaignCriterion > ( "create" , campaignCriteria ) ; const request = this . buildRequest < services . CampaignCriterionOperation , services . IMutateCampaignCriteriaRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "CampaignCriterionService.mutateCampaignCriteria" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateCampaignCriteria ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns update : async ( campaignCriteria , options ? ) : Promise < services . MutateCampaignCriteriaResponse > => { const ops = this . buildOperations < services . CampaignCriterionOperation , resources . ICampaignCriterion > ( "update" , campaignCriteria , resources . CampaignCriterion ) ; const request = this . buildRequest < services . CampaignCriterionOperation , services . IMutateCampaignCriteriaRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "CampaignCriterionService.mutateCampaignCriteria" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateCampaignCriteria ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns remove : async ( campaignCriteria , options ? ) : Promise < services . MutateCampaignCriteriaResponse > => { const ops = this . buildOperations < services . CampaignCriterionOperation , string > ( "remove" , campaignCriteria ) ; const request = this . buildRequest < services . CampaignCriterionOperation , services . IMutateCampaignCriteriaRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "CampaignCriterionService.mutateCampaignCriteria" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateCampaignCriteria ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get campaignCustomizers ( ) { const service = this . loadService < services . CampaignCustomizerService > ( "CampaignCustomizerServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateCampaignCustomizersRequest , "partial_failure" | "validate_only" | "response_content_type" > > ; return { description returns create : async ( campaignCustomizers , options ? ) : Promise < services . MutateCampaignCustomizersResponse > => { const ops = this . buildOperations < services . CampaignCustomizerOperation , resources . ICampaignCustomizer > ( "create" , campaignCustomizers ) ; const request = this . buildRequest < services . CampaignCustomizerOperation , services . IMutateCampaignCustomizersRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "CampaignCustomizerService.mutateCampaignCustomizers" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateCampaignCustomizers ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns remove : async ( campaignCustomizers , options ? ) : Promise < services . MutateCampaignCustomizersResponse > => { const ops = this . buildOperations < services . CampaignCustomizerOperation , string > ( "remove" , campaignCustomizers ) ; const request = this . buildRequest < services . CampaignCustomizerOperation , services . IMutateCampaignCustomizersRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "CampaignCustomizerService.mutateCampaignCustomizers" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateCampaignCustomizers ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get campaignDrafts ( ) { const service = this . loadService < services . CampaignDraftService > ( "CampaignDraftServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateCampaignDraftsRequest , "partial_failure" | "validate_only" | "response_content_type" > > ; return { description warning returns get : async ( resourceName ) : Promise < resources . CampaignDraft > => { const request = new services . GetCampaignDraftRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getCampaignDraft ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , description returns create : async ( campaignDrafts , options ? ) : Promise < services . MutateCampaignDraftsResponse > => { const ops = this . buildOperations < services . CampaignDraftOperation , resources . ICampaignDraft > ( "create" , campaignDrafts ) ; const request = this . buildRequest < services . CampaignDraftOperation , services . IMutateCampaignDraftsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "CampaignDraftService.mutateCampaignDrafts" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateCampaignDrafts ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns update : async ( campaignDrafts , options ? ) : Promise < services . MutateCampaignDraftsResponse > => { const ops = this . buildOperations < services . CampaignDraftOperation , resources . ICampaignDraft > ( "update" , campaignDrafts , resources . CampaignDraft ) ; const request = this . buildRequest < services . CampaignDraftOperation , services . IMutateCampaignDraftsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "CampaignDraftService.mutateCampaignDrafts" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateCampaignDrafts ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns remove : async ( campaignDrafts , options ? ) : Promise < services . MutateCampaignDraftsResponse > => { const ops = this . buildOperations < services . CampaignDraftOperation , string > ( "remove" , campaignDrafts ) ; const request = this . buildRequest < services . CampaignDraftOperation , services . IMutateCampaignDraftsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "CampaignDraftService.mutateCampaignDrafts" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateCampaignDrafts ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , link promoteCampaignDraft : async ( request ) : Promise < longrunning . Operation > => { try { const [ response ] = await service . promoteCampaignDraft ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , link listCampaignDraftAsyncErrors : async ( request ) : Promise < services . ListCampaignDraftAsyncErrorsResponse > => { try { const [ response ] = await service . listCampaignDraftAsyncErrors ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get campaignExperiments ( ) { const service = this . loadService < services . CampaignExperimentService > ( "CampaignExperimentServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateCampaignExperimentsRequest , "partial_failure" | "validate_only" | "response_content_type" > > ; return { description warning returns get : async ( resourceName ) : Promise < resources . CampaignExperiment > => { const request = new services . GetCampaignExperimentRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getCampaignExperiment ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , link createCampaignExperiment : async ( request ) : Promise < longrunning . Operation > => { try { const [ response ] = await service . createCampaignExperiment ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , description returns update : async ( campaignExperiments , options ? ) : Promise < services . MutateCampaignExperimentsResponse > => { const ops = this . buildOperations < services . CampaignExperimentOperation , resources . ICampaignExperiment > ( "update" , campaignExperiments , resources . CampaignExperiment ) ; const request = this . buildRequest < services . CampaignExperimentOperation , services . IMutateCampaignExperimentsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "CampaignExperimentService.mutateCampaignExperiments" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateCampaignExperiments ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns remove : async ( campaignExperiments , options ? ) : Promise < services . MutateCampaignExperimentsResponse > => { const ops = this . buildOperations < services . CampaignExperimentOperation , string > ( "remove" , campaignExperiments ) ; const request = this . buildRequest < services . CampaignExperimentOperation , services . IMutateCampaignExperimentsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "CampaignExperimentService.mutateCampaignExperiments" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateCampaignExperiments ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , link graduateCampaignExperiment : async ( request ) : Promise < services . GraduateCampaignExperimentResponse > => { try { const [ response ] = await service . graduateCampaignExperiment ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , link promoteCampaignExperiment : async ( request ) : Promise < longrunning . Operation > => { try { const [ response ] = await service . promoteCampaignExperiment ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , link endCampaignExperiment : async ( request ) : Promise < protobuf . Empty > => { try { const [ response ] = await service . endCampaignExperiment ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , link listCampaignExperimentAsyncErrors : async ( request ) : Promise < services . ListCampaignExperimentAsyncErrorsResponse > => { try { const [ response ] = await service . listCampaignExperimentAsyncErrors ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get campaignExtensionSettings ( ) { const service = this . loadService < services . CampaignExtensionSettingService > ( "CampaignExtensionSettingServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateCampaignExtensionSettingsRequest , "partial_failure" | "validate_only" | "response_content_type" > > ; return { description warning returns get : async ( resourceName ) : Promise < resources . CampaignExtensionSetting > => { const request = new services . GetCampaignExtensionSettingRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getCampaignExtensionSetting ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , description returns create : async ( campaignExtensionSettings , options ? ) : Promise < services . MutateCampaignExtensionSettingsResponse > => { const ops = this . buildOperations < services . CampaignExtensionSettingOperation , resources . ICampaignExtensionSetting > ( "create" , campaignExtensionSettings ) ; const request = this . buildRequest < services . CampaignExtensionSettingOperation , services . IMutateCampaignExtensionSettingsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "CampaignExtensionSettingService.mutateCampaignExtensionSettings" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateCampaignExtensionSettings ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns update : async ( campaignExtensionSettings , options ? ) : Promise < services . MutateCampaignExtensionSettingsResponse > => { const ops = this . buildOperations < services . CampaignExtensionSettingOperation , resources . ICampaignExtensionSetting > ( "update" , campaignExtensionSettings , resources . CampaignExtensionSetting ) ; const request = this . buildRequest < services . CampaignExtensionSettingOperation , services . IMutateCampaignExtensionSettingsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "CampaignExtensionSettingService.mutateCampaignExtensionSettings" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateCampaignExtensionSettings ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns remove : async ( campaignExtensionSettings , options ? ) : Promise < services . MutateCampaignExtensionSettingsResponse > => { const ops = this . buildOperations < services . CampaignExtensionSettingOperation , string > ( "remove" , campaignExtensionSettings ) ; const request = this . buildRequest < services . CampaignExtensionSettingOperation , services . IMutateCampaignExtensionSettingsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "CampaignExtensionSettingService.mutateCampaignExtensionSettings" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateCampaignExtensionSettings ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get campaignFeeds ( ) { const service = this . loadService < services . CampaignFeedService > ( "CampaignFeedServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateCampaignFeedsRequest , "partial_failure" | "validate_only" | "response_content_type" > > ; return { description warning returns get : async ( resourceName ) : Promise < resources . CampaignFeed > => { const request = new services . GetCampaignFeedRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getCampaignFeed ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , description returns create : async ( campaignFeeds , options ? ) : Promise < services . MutateCampaignFeedsResponse > => { const ops = this . buildOperations < services . CampaignFeedOperation , resources . ICampaignFeed > ( "create" , campaignFeeds ) ; const request = this . buildRequest < services . CampaignFeedOperation , services . IMutateCampaignFeedsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "CampaignFeedService.mutateCampaignFeeds" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateCampaignFeeds ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns update : async ( campaignFeeds , options ? ) : Promise < services . MutateCampaignFeedsResponse > => { const ops = this . buildOperations < services . CampaignFeedOperation , resources . ICampaignFeed > ( "update" , campaignFeeds , resources . CampaignFeed ) ; const request = this . buildRequest < services . CampaignFeedOperation , services . IMutateCampaignFeedsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "CampaignFeedService.mutateCampaignFeeds" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateCampaignFeeds ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns remove : async ( campaignFeeds , options ? ) : Promise < services . MutateCampaignFeedsResponse > => { const ops = this . buildOperations < services . CampaignFeedOperation , string > ( "remove" , campaignFeeds ) ; const request = this . buildRequest < services . CampaignFeedOperation , services . IMutateCampaignFeedsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "CampaignFeedService.mutateCampaignFeeds" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateCampaignFeeds ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get campaignLabels ( ) { const service = this . loadService < services . CampaignLabelService > ( "CampaignLabelServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateCampaignLabelsRequest , "partial_failure" | "validate_only" > > ; return { description warning returns get : async ( resourceName ) : Promise < resources . CampaignLabel > => { const request = new services . GetCampaignLabelRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getCampaignLabel ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , description returns create : async ( campaignLabels , options ? ) : Promise < services . MutateCampaignLabelsResponse > => { const ops = this . buildOperations < services . CampaignLabelOperation , resources . ICampaignLabel > ( "create" , campaignLabels ) ; const request = this . buildRequest < services . CampaignLabelOperation , services . IMutateCampaignLabelsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "CampaignLabelService.mutateCampaignLabels" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateCampaignLabels ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns remove : async ( campaignLabels , options ? ) : Promise < services . MutateCampaignLabelsResponse > => { const ops = this . buildOperations < services . CampaignLabelOperation , string > ( "remove" , campaignLabels ) ; const request = this . buildRequest < services . CampaignLabelOperation , services . IMutateCampaignLabelsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "CampaignLabelService.mutateCampaignLabels" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateCampaignLabels ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get campaigns ( ) { const service = this . loadService < services . CampaignService > ( "CampaignServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateCampaignsRequest , "partial_failure" | "validate_only" | "response_content_type" > > ; return { description warning returns get : async ( resourceName ) : Promise < resources . Campaign > => { const request = new services . GetCampaignRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getCampaign ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , description returns create : async ( campaigns , options ? ) : Promise < services . MutateCampaignsResponse > => { const ops = this . buildOperations < services . CampaignOperation , resources . ICampaign > ( "create" , campaigns ) ; const request = this . buildRequest < services . CampaignOperation , services . IMutateCampaignsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "CampaignService.mutateCampaigns" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateCampaigns ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns update : async ( campaigns , options ? ) : Promise < services . MutateCampaignsResponse > => { const ops = this . buildOperations < services . CampaignOperation , resources . ICampaign > ( "update" , campaigns , resources . Campaign ) ; const request = this . buildRequest < services . CampaignOperation , services . IMutateCampaignsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "CampaignService.mutateCampaigns" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateCampaigns ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns remove : async ( campaigns , options ? ) : Promise < services . MutateCampaignsResponse > => { const ops = this . buildOperations < services . CampaignOperation , string > ( "remove" , campaigns ) ; const request = this . buildRequest < services . CampaignOperation , services . IMutateCampaignsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "CampaignService.mutateCampaigns" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateCampaigns ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get campaignSharedSets ( ) { const service = this . loadService < services . CampaignSharedSetService > ( "CampaignSharedSetServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateCampaignSharedSetsRequest , "partial_failure" | "validate_only" | "response_content_type" > > ; return { description warning returns get : async ( resourceName ) : Promise < resources . CampaignSharedSet > => { const request = new services . GetCampaignSharedSetRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getCampaignSharedSet ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , description returns create : async ( campaignSharedSets , options ? ) : Promise < services . MutateCampaignSharedSetsResponse > => { const ops = this . buildOperations < services . CampaignSharedSetOperation , resources . ICampaignSharedSet > ( "create" , campaignSharedSets ) ; const request = this . buildRequest < services . CampaignSharedSetOperation , services . IMutateCampaignSharedSetsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "CampaignSharedSetService.mutateCampaignSharedSets" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateCampaignSharedSets ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns remove : async ( campaignSharedSets , options ? ) : Promise < services . MutateCampaignSharedSetsResponse > => { const ops = this . buildOperations < services . CampaignSharedSetOperation , string > ( "remove" , campaignSharedSets ) ; const request = this . buildRequest < services . CampaignSharedSetOperation , services . IMutateCampaignSharedSetsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "CampaignSharedSetService.mutateCampaignSharedSets" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateCampaignSharedSets ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get conversionActions ( ) { const service = this . loadService < services . ConversionActionService > ( "ConversionActionServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateConversionActionsRequest , "partial_failure" | "validate_only" | "response_content_type" > > ; return { description warning returns get : async ( resourceName ) : Promise < resources . ConversionAction > => { const request = new services . GetConversionActionRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getConversionAction ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , description returns create : async ( conversionActions , options ? ) : Promise < services . MutateConversionActionsResponse > => { const ops = this . buildOperations < services . ConversionActionOperation , resources . IConversionAction > ( "create" , conversionActions ) ; const request = this . buildRequest < services . ConversionActionOperation , services . IMutateConversionActionsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "ConversionActionService.mutateConversionActions" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateConversionActions ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns update : async ( conversionActions , options ? ) : Promise < services . MutateConversionActionsResponse > => { const ops = this . buildOperations < services . ConversionActionOperation , resources . IConversionAction > ( "update" , conversionActions , resources . ConversionAction ) ; const request = this . buildRequest < services . ConversionActionOperation , services . IMutateConversionActionsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "ConversionActionService.mutateConversionActions" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateConversionActions ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns remove : async ( conversionActions , options ? ) : Promise < services . MutateConversionActionsResponse > => { const ops = this . buildOperations < services . ConversionActionOperation , string > ( "remove" , conversionActions ) ; const request = this . buildRequest < services . ConversionActionOperation , services . IMutateConversionActionsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "ConversionActionService.mutateConversionActions" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateConversionActions ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get conversionCustomVariables ( ) { const service = this . loadService < services . ConversionCustomVariableService > ( "ConversionCustomVariableServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateConversionCustomVariablesRequest , "partial_failure" | "validate_only" | "response_content_type" > > ; return { description warning returns get : async ( resourceName ) : Promise < resources . ConversionCustomVariable > => { const request = new services . GetConversionCustomVariableRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getConversionCustomVariable ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , description returns create : async ( conversionCustomVariables , options ? ) : Promise < services . MutateConversionCustomVariablesResponse > => { const ops = this . buildOperations < services . ConversionCustomVariableOperation , resources . IConversionCustomVariable > ( "create" , conversionCustomVariables ) ; const request = this . buildRequest < services . ConversionCustomVariableOperation , services . IMutateConversionCustomVariablesRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "ConversionCustomVariableService.mutateConversionCustomVariables" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateConversionCustomVariables ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns update : async ( conversionCustomVariables , options ? ) : Promise < services . MutateConversionCustomVariablesResponse > => { const ops = this . buildOperations < services . ConversionCustomVariableOperation , resources . IConversionCustomVariable > ( "update" , conversionCustomVariables , resources . ConversionCustomVariable ) ; const request = this . buildRequest < services . ConversionCustomVariableOperation , services . IMutateConversionCustomVariablesRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "ConversionCustomVariableService.mutateConversionCustomVariables" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateConversionCustomVariables ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get conversionGoalCampaignConfigs ( ) { const service = this . loadService < services . ConversionGoalCampaignConfigService > ( "ConversionGoalCampaignConfigServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateConversionGoalCampaignConfigsRequest , "validate_only" | "response_content_type" > > ; return { description returns update : async ( conversionGoalCampaignConfigs , options ? ) : Promise < services . MutateConversionGoalCampaignConfigsResponse > => { const ops = this . buildOperations < services . ConversionGoalCampaignConfigOperation , resources . IConversionGoalCampaignConfig > ( "update" , conversionGoalCampaignConfigs , resources . ConversionGoalCampaignConfig ) ; const request = this . buildRequest < services . ConversionGoalCampaignConfigOperation , services . IMutateConversionGoalCampaignConfigsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "ConversionGoalCampaignConfigService.mutateConversionGoalCampaignConfigs" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateConversionGoalCampaignConfigs ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return response ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get conversionValueRules ( ) { const service = this . loadService < services . ConversionValueRuleService > ( "ConversionValueRuleServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateConversionValueRulesRequest , "partial_failure" | "validate_only" | "response_content_type" > > ; return { description warning returns get : async ( resourceName ) : Promise < resources . ConversionValueRule > => { const request = new services . GetConversionValueRuleRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getConversionValueRule ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , description returns create : async ( conversionValueRules , options ? ) : Promise < services . MutateConversionValueRulesResponse > => { const ops = this . buildOperations < services . ConversionValueRuleOperation , resources . IConversionValueRule > ( "create" , conversionValueRules ) ; const request = this . buildRequest < services . ConversionValueRuleOperation , services . IMutateConversionValueRulesRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "ConversionValueRuleService.mutateConversionValueRules" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateConversionValueRules ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns update : async ( conversionValueRules , options ? ) : Promise < services . MutateConversionValueRulesResponse > => { const ops = this . buildOperations < services . ConversionValueRuleOperation , resources . IConversionValueRule > ( "update" , conversionValueRules , resources . ConversionValueRule ) ; const request = this . buildRequest < services . ConversionValueRuleOperation , services . IMutateConversionValueRulesRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "ConversionValueRuleService.mutateConversionValueRules" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateConversionValueRules ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns remove : async ( conversionValueRules , options ? ) : Promise < services . MutateConversionValueRulesResponse > => { const ops = this . buildOperations < services . ConversionValueRuleOperation , string > ( "remove" , conversionValueRules ) ; const request = this . buildRequest < services . ConversionValueRuleOperation , services . IMutateConversionValueRulesRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "ConversionValueRuleService.mutateConversionValueRules" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateConversionValueRules ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get conversionValueRuleSets ( ) { const service = this . loadService < services . ConversionValueRuleSetService > ( "ConversionValueRuleSetServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateConversionValueRuleSetsRequest , "partial_failure" | "validate_only" | "response_content_type" > > ; return { description warning returns get : async ( resourceName ) : Promise < resources . ConversionValueRuleSet > => { const request = new services . GetConversionValueRuleSetRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getConversionValueRuleSet ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , description returns create : async ( conversionValueRuleSets , options ? ) : Promise < services . MutateConversionValueRuleSetsResponse > => { const ops = this . buildOperations < services . ConversionValueRuleSetOperation , resources . IConversionValueRuleSet > ( "create" , conversionValueRuleSets ) ; const request = this . buildRequest < services . ConversionValueRuleSetOperation , services . IMutateConversionValueRuleSetsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "ConversionValueRuleSetService.mutateConversionValueRuleSets" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateConversionValueRuleSets ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns update : async ( conversionValueRuleSets , options ? ) : Promise < services . MutateConversionValueRuleSetsResponse > => { const ops = this . buildOperations < services . ConversionValueRuleSetOperation , resources . IConversionValueRuleSet > ( "update" , conversionValueRuleSets , resources . ConversionValueRuleSet ) ; const request = this . buildRequest < services . ConversionValueRuleSetOperation , services . IMutateConversionValueRuleSetsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "ConversionValueRuleSetService.mutateConversionValueRuleSets" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateConversionValueRuleSets ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns remove : async ( conversionValueRuleSets , options ? ) : Promise < services . MutateConversionValueRuleSetsResponse > => { const ops = this . buildOperations < services . ConversionValueRuleSetOperation , string > ( "remove" , conversionValueRuleSets ) ; const request = this . buildRequest < services . ConversionValueRuleSetOperation , services . IMutateConversionValueRuleSetsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "ConversionValueRuleSetService.mutateConversionValueRuleSets" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateConversionValueRuleSets ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get customConversionGoals ( ) { const service = this . loadService < services . CustomConversionGoalService > ( "CustomConversionGoalServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateCustomConversionGoalsRequest , "validate_only" | "response_content_type" > > ; return { description returns create : async ( customConversionGoals , options ? ) : Promise < services . MutateCustomConversionGoalsResponse > => { const ops = this . buildOperations < services . CustomConversionGoalOperation , resources . ICustomConversionGoal > ( "create" , customConversionGoals ) ; const request = this . buildRequest < services . CustomConversionGoalOperation , services . IMutateCustomConversionGoalsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "CustomConversionGoalService.mutateCustomConversionGoals" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateCustomConversionGoals ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return response ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns update : async ( customConversionGoals , options ? ) : Promise < services . MutateCustomConversionGoalsResponse > => { const ops = this . buildOperations < services . CustomConversionGoalOperation , resources . ICustomConversionGoal > ( "update" , customConversionGoals , resources . CustomConversionGoal ) ; const request = this . buildRequest < services . CustomConversionGoalOperation , services . IMutateCustomConversionGoalsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "CustomConversionGoalService.mutateCustomConversionGoals" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateCustomConversionGoals ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return response ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns remove : async ( customConversionGoals , options ? ) : Promise < services . MutateCustomConversionGoalsResponse > => { const ops = this . buildOperations < services . CustomConversionGoalOperation , string > ( "remove" , customConversionGoals ) ; const request = this . buildRequest < services . CustomConversionGoalOperation , services . IMutateCustomConversionGoalsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "CustomConversionGoalService.mutateCustomConversionGoals" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateCustomConversionGoals ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return response ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get customerAssets ( ) { const service = this . loadService < services . CustomerAssetService > ( "CustomerAssetServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateCustomerAssetsRequest , "partial_failure" | "validate_only" | "response_content_type" > > ; return { description warning returns get : async ( resourceName ) : Promise < resources . CustomerAsset > => { const request = new services . GetCustomerAssetRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getCustomerAsset ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , description returns create : async ( customerAssets , options ? ) : Promise < services . MutateCustomerAssetsResponse > => { const ops = this . buildOperations < services . CustomerAssetOperation , resources . ICustomerAsset > ( "create" , customerAssets ) ; const request = this . buildRequest < services . CustomerAssetOperation , services . IMutateCustomerAssetsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "CustomerAssetService.mutateCustomerAssets" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateCustomerAssets ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns update : async ( customerAssets , options ? ) : Promise < services . MutateCustomerAssetsResponse > => { const ops = this . buildOperations < services . CustomerAssetOperation , resources . ICustomerAsset > ( "update" , customerAssets , resources . CustomerAsset ) ; const request = this . buildRequest < services . CustomerAssetOperation , services . IMutateCustomerAssetsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "CustomerAssetService.mutateCustomerAssets" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateCustomerAssets ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns remove : async ( customerAssets , options ? ) : Promise < services . MutateCustomerAssetsResponse > => { const ops = this . buildOperations < services . CustomerAssetOperation , string > ( "remove" , customerAssets ) ; const request = this . buildRequest < services . CustomerAssetOperation , services . IMutateCustomerAssetsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "CustomerAssetService.mutateCustomerAssets" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateCustomerAssets ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get customerConversionGoals ( ) { const service = this . loadService < services . CustomerConversionGoalService > ( "CustomerConversionGoalServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateCustomerConversionGoalsRequest , "validate_only" > > ; return { description returns update : async ( customerConversionGoals , options ? ) : Promise < services . MutateCustomerConversionGoalsResponse > => { const ops = this . buildOperations < services . CustomerConversionGoalOperation , resources . ICustomerConversionGoal > ( "update" , customerConversionGoals , resources . CustomerConversionGoal ) ; const request = this . buildRequest < services . CustomerConversionGoalOperation , services . IMutateCustomerConversionGoalsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "CustomerConversionGoalService.mutateCustomerConversionGoals" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateCustomerConversionGoals ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return response ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get customerCustomizers ( ) { const service = this . loadService < services . CustomerCustomizerService > ( "CustomerCustomizerServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateCustomerCustomizersRequest , "partial_failure" | "validate_only" | "response_content_type" > > ; return { description returns create : async ( customerCustomizers , options ? ) : Promise < services . MutateCustomerCustomizersResponse > => { const ops = this . buildOperations < services . CustomerCustomizerOperation , resources . ICustomerCustomizer > ( "create" , customerCustomizers ) ; const request = this . buildRequest < services . CustomerCustomizerOperation , services . IMutateCustomerCustomizersRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "CustomerCustomizerService.mutateCustomerCustomizers" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateCustomerCustomizers ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns remove : async ( customerCustomizers , options ? ) : Promise < services . MutateCustomerCustomizersResponse > => { const ops = this . buildOperations < services . CustomerCustomizerOperation , string > ( "remove" , customerCustomizers ) ; const request = this . buildRequest < services . CustomerCustomizerOperation , services . IMutateCustomerCustomizersRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "CustomerCustomizerService.mutateCustomerCustomizers" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateCustomerCustomizers ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get customerExtensionSettings ( ) { const service = this . loadService < services . CustomerExtensionSettingService > ( "CustomerExtensionSettingServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateCustomerExtensionSettingsRequest , "partial_failure" | "validate_only" | "response_content_type" > > ; return { description warning returns get : async ( resourceName ) : Promise < resources . CustomerExtensionSetting > => { const request = new services . GetCustomerExtensionSettingRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getCustomerExtensionSetting ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , description returns create : async ( customerExtensionSettings , options ? ) : Promise < services . MutateCustomerExtensionSettingsResponse > => { const ops = this . buildOperations < services . CustomerExtensionSettingOperation , resources . ICustomerExtensionSetting > ( "create" , customerExtensionSettings ) ; const request = this . buildRequest < services . CustomerExtensionSettingOperation , services . IMutateCustomerExtensionSettingsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "CustomerExtensionSettingService.mutateCustomerExtensionSettings" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateCustomerExtensionSettings ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns update : async ( customerExtensionSettings , options ? ) : Promise < services . MutateCustomerExtensionSettingsResponse > => { const ops = this . buildOperations < services . CustomerExtensionSettingOperation , resources . ICustomerExtensionSetting > ( "update" , customerExtensionSettings , resources . CustomerExtensionSetting ) ; const request = this . buildRequest < services . CustomerExtensionSettingOperation , services . IMutateCustomerExtensionSettingsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "CustomerExtensionSettingService.mutateCustomerExtensionSettings" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateCustomerExtensionSettings ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns remove : async ( customerExtensionSettings , options ? ) : Promise < services . MutateCustomerExtensionSettingsResponse > => { const ops = this . buildOperations < services . CustomerExtensionSettingOperation , string > ( "remove" , customerExtensionSettings ) ; const request = this . buildRequest < services . CustomerExtensionSettingOperation , services . IMutateCustomerExtensionSettingsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "CustomerExtensionSettingService.mutateCustomerExtensionSettings" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateCustomerExtensionSettings ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get customerFeeds ( ) { const service = this . loadService < services . CustomerFeedService > ( "CustomerFeedServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateCustomerFeedsRequest , "partial_failure" | "validate_only" | "response_content_type" > > ; return { description warning returns get : async ( resourceName ) : Promise < resources . CustomerFeed > => { const request = new services . GetCustomerFeedRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getCustomerFeed ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , description returns create : async ( customerFeeds , options ? ) : Promise < services . MutateCustomerFeedsResponse > => { const ops = this . buildOperations < services . CustomerFeedOperation , resources . ICustomerFeed > ( "create" , customerFeeds ) ; const request = this . buildRequest < services . CustomerFeedOperation , services . IMutateCustomerFeedsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "CustomerFeedService.mutateCustomerFeeds" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateCustomerFeeds ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns update : async ( customerFeeds , options ? ) : Promise < services . MutateCustomerFeedsResponse > => { const ops = this . buildOperations < services . CustomerFeedOperation , resources . ICustomerFeed > ( "update" , customerFeeds , resources . CustomerFeed ) ; const request = this . buildRequest < services . CustomerFeedOperation , services . IMutateCustomerFeedsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "CustomerFeedService.mutateCustomerFeeds" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateCustomerFeeds ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns remove : async ( customerFeeds , options ? ) : Promise < services . MutateCustomerFeedsResponse > => { const ops = this . buildOperations < services . CustomerFeedOperation , string > ( "remove" , customerFeeds ) ; const request = this . buildRequest < services . CustomerFeedOperation , services . IMutateCustomerFeedsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "CustomerFeedService.mutateCustomerFeeds" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateCustomerFeeds ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get customerLabels ( ) { const service = this . loadService < services . CustomerLabelService > ( "CustomerLabelServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateCustomerLabelsRequest , "partial_failure" | "validate_only" > > ; return { description warning returns get : async ( resourceName ) : Promise < resources . CustomerLabel > => { const request = new services . GetCustomerLabelRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getCustomerLabel ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , description returns create : async ( customerLabels , options ? ) : Promise < services . MutateCustomerLabelsResponse > => { const ops = this . buildOperations < services . CustomerLabelOperation , resources . ICustomerLabel > ( "create" , customerLabels ) ; const request = this . buildRequest < services . CustomerLabelOperation , services . IMutateCustomerLabelsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "CustomerLabelService.mutateCustomerLabels" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateCustomerLabels ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns remove : async ( customerLabels , options ? ) : Promise < services . MutateCustomerLabelsResponse > => { const ops = this . buildOperations < services . CustomerLabelOperation , string > ( "remove" , customerLabels ) ; const request = this . buildRequest < services . CustomerLabelOperation , services . IMutateCustomerLabelsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "CustomerLabelService.mutateCustomerLabels" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateCustomerLabels ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get customerNegativeCriteria ( ) { const service = this . loadService < services . CustomerNegativeCriterionService > ( "CustomerNegativeCriterionServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateCustomerNegativeCriteriaRequest , "partial_failure" | "validate_only" | "response_content_type" > > ; return { description warning returns get : async ( resourceName ) : Promise < resources . CustomerNegativeCriterion > => { const request = new services . GetCustomerNegativeCriterionRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getCustomerNegativeCriterion ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , description returns create : async ( customerNegativeCriteria , options ? ) : Promise < services . MutateCustomerNegativeCriteriaResponse > => { const ops = this . buildOperations < services . CustomerNegativeCriterionOperation , resources . ICustomerNegativeCriterion > ( "create" , customerNegativeCriteria ) ; const request = this . buildRequest < services . CustomerNegativeCriterionOperation , services . IMutateCustomerNegativeCriteriaRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "CustomerNegativeCriterionService.mutateCustomerNegativeCriteria" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateCustomerNegativeCriteria ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns remove : async ( customerNegativeCriteria , options ? ) : Promise < services . MutateCustomerNegativeCriteriaResponse > => { const ops = this . buildOperations < services . CustomerNegativeCriterionOperation , string > ( "remove" , customerNegativeCriteria ) ; const request = this . buildRequest < services . CustomerNegativeCriterionOperation , services . IMutateCustomerNegativeCriteriaRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "CustomerNegativeCriterionService.mutateCustomerNegativeCriteria" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateCustomerNegativeCriteria ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get customers ( ) { const service = this . loadService < services . CustomerService > ( "CustomerServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateCustomerRequest , "validate_only" | "response_content_type" > > ; return { description warning returns get : async ( resourceName ) : Promise < resources . Customer > => { const request = new services . GetCustomerRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getCustomer ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , description returns update : async ( customers , options ? ) : Promise < services . MutateCustomerResponse > => { const ops = this . buildOperations < services . CustomerOperation , resources . ICustomer > ( "update" , customers , resources . Customer ) ; const request = this . buildRequest < services . CustomerOperation , services . IMutateCustomerRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "CustomerService.mutateCustomer" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateCustomer ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return response ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , link listAccessibleCustomers : async ( request ) : Promise < services . ListAccessibleCustomersResponse > => { try { const [ response ] = await service . listAccessibleCustomers ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , link createCustomerClient : async ( request ) : Promise < services . CreateCustomerClientResponse > => { try { const [ response ] = await service . createCustomerClient ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get customizerAttributes ( ) { const service = this . loadService < services . CustomizerAttributeService > ( "CustomizerAttributeServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateCustomizerAttributesRequest , "partial_failure" | "validate_only" | "response_content_type" > > ; return { description returns create : async ( customizerAttributes , options ? ) : Promise < services . MutateCustomizerAttributesResponse > => { const ops = this . buildOperations < services . CustomizerAttributeOperation , resources . ICustomizerAttribute > ( "create" , customizerAttributes ) ; const request = this . buildRequest < services . CustomizerAttributeOperation , services . IMutateCustomizerAttributesRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "CustomizerAttributeService.mutateCustomizerAttributes" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateCustomizerAttributes ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns remove : async ( customizerAttributes , options ? ) : Promise < services . MutateCustomizerAttributesResponse > => { const ops = this . buildOperations < services . CustomizerAttributeOperation , string > ( "remove" , customizerAttributes ) ; const request = this . buildRequest < services . CustomizerAttributeOperation , services . IMutateCustomizerAttributesRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "CustomizerAttributeService.mutateCustomizerAttributes" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateCustomizerAttributes ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get extensionFeedItems ( ) { const service = this . loadService < services . ExtensionFeedItemService > ( "ExtensionFeedItemServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateExtensionFeedItemsRequest , "partial_failure" | "validate_only" | "response_content_type" > > ; return { description warning returns get : async ( resourceName ) : Promise < resources . ExtensionFeedItem > => { const request = new services . GetExtensionFeedItemRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getExtensionFeedItem ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , description returns create : async ( extensionFeedItems , options ? ) : Promise < services . MutateExtensionFeedItemsResponse > => { const ops = this . buildOperations < services . ExtensionFeedItemOperation , resources . IExtensionFeedItem > ( "create" , extensionFeedItems ) ; const request = this . buildRequest < services . ExtensionFeedItemOperation , services . IMutateExtensionFeedItemsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "ExtensionFeedItemService.mutateExtensionFeedItems" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateExtensionFeedItems ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns update : async ( extensionFeedItems , options ? ) : Promise < services . MutateExtensionFeedItemsResponse > => { const ops = this . buildOperations < services . ExtensionFeedItemOperation , resources . IExtensionFeedItem > ( "update" , extensionFeedItems , resources . ExtensionFeedItem ) ; const request = this . buildRequest < services . ExtensionFeedItemOperation , services . IMutateExtensionFeedItemsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "ExtensionFeedItemService.mutateExtensionFeedItems" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateExtensionFeedItems ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns remove : async ( extensionFeedItems , options ? ) : Promise < services . MutateExtensionFeedItemsResponse > => { const ops = this . buildOperations < services . ExtensionFeedItemOperation , string > ( "remove" , extensionFeedItems ) ; const request = this . buildRequest < services . ExtensionFeedItemOperation , services . IMutateExtensionFeedItemsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "ExtensionFeedItemService.mutateExtensionFeedItems" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateExtensionFeedItems ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get feedItems ( ) { const service = this . loadService < services . FeedItemService > ( "FeedItemServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateFeedItemsRequest , "partial_failure" | "validate_only" | "response_content_type" > > ; return { description warning returns get : async ( resourceName ) : Promise < resources . FeedItem > => { const request = new services . GetFeedItemRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getFeedItem ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , description returns create : async ( feedItems , options ? ) : Promise < services . MutateFeedItemsResponse > => { const ops = this . buildOperations < services . FeedItemOperation , resources . IFeedItem > ( "create" , feedItems ) ; const request = this . buildRequest < services . FeedItemOperation , services . IMutateFeedItemsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "FeedItemService.mutateFeedItems" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateFeedItems ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns update : async ( feedItems , options ? ) : Promise < services . MutateFeedItemsResponse > => { const ops = this . buildOperations < services . FeedItemOperation , resources . IFeedItem > ( "update" , feedItems , resources . FeedItem ) ; const request = this . buildRequest < services . FeedItemOperation , services . IMutateFeedItemsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "FeedItemService.mutateFeedItems" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateFeedItems ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns remove : async ( feedItems , options ? ) : Promise < services . MutateFeedItemsResponse > => { const ops = this . buildOperations < services . FeedItemOperation , string > ( "remove" , feedItems ) ; const request = this . buildRequest < services . FeedItemOperation , services . IMutateFeedItemsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "FeedItemService.mutateFeedItems" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateFeedItems ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get feedItemSetLinks ( ) { const service = this . loadService < services . FeedItemSetLinkService > ( "FeedItemSetLinkServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateFeedItemSetLinksRequest , "partial_failure" | "validate_only" > > ; return { description warning returns get : async ( resourceName ) : Promise < resources . FeedItemSetLink > => { const request = new services . GetFeedItemSetLinkRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getFeedItemSetLink ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , description returns create : async ( feedItemSetLinks , options ? ) : Promise < services . MutateFeedItemSetLinksResponse > => { const ops = this . buildOperations < services . FeedItemSetLinkOperation , resources . IFeedItemSetLink > ( "create" , feedItemSetLinks ) ; const request = this . buildRequest < services . FeedItemSetLinkOperation , services . IMutateFeedItemSetLinksRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "FeedItemSetLinkService.mutateFeedItemSetLinks" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateFeedItemSetLinks ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns remove : async ( feedItemSetLinks , options ? ) : Promise < services . MutateFeedItemSetLinksResponse > => { const ops = this . buildOperations < services . FeedItemSetLinkOperation , string > ( "remove" , feedItemSetLinks ) ; const request = this . buildRequest < services . FeedItemSetLinkOperation , services . IMutateFeedItemSetLinksRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "FeedItemSetLinkService.mutateFeedItemSetLinks" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateFeedItemSetLinks ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get feedItemSets ( ) { const service = this . loadService < services . FeedItemSetService > ( "FeedItemSetServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateFeedItemSetsRequest , "partial_failure" | "validate_only" > > ; return { description warning returns get : async ( resourceName ) : Promise < resources . FeedItemSet > => { const request = new services . GetFeedItemSetRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getFeedItemSet ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , description returns create : async ( feedItemSets , options ? ) : Promise < services . MutateFeedItemSetsResponse > => { const ops = this . buildOperations < services . FeedItemSetOperation , resources . IFeedItemSet > ( "create" , feedItemSets ) ; const request = this . buildRequest < services . FeedItemSetOperation , services . IMutateFeedItemSetsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "FeedItemSetService.mutateFeedItemSets" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateFeedItemSets ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns update : async ( feedItemSets , options ? ) : Promise < services . MutateFeedItemSetsResponse > => { const ops = this . buildOperations < services . FeedItemSetOperation , resources . IFeedItemSet > ( "update" , feedItemSets , resources . FeedItemSet ) ; const request = this . buildRequest < services . FeedItemSetOperation , services . IMutateFeedItemSetsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "FeedItemSetService.mutateFeedItemSets" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateFeedItemSets ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns remove : async ( feedItemSets , options ? ) : Promise < services . MutateFeedItemSetsResponse > => { const ops = this . buildOperations < services . FeedItemSetOperation , string > ( "remove" , feedItemSets ) ; const request = this . buildRequest < services . FeedItemSetOperation , services . IMutateFeedItemSetsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "FeedItemSetService.mutateFeedItemSets" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateFeedItemSets ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get feedItemTargets ( ) { const service = this . loadService < services . FeedItemTargetService > ( "FeedItemTargetServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateFeedItemTargetsRequest , "partial_failure" | "response_content_type" | "validate_only" > > ; return { description warning returns get : async ( resourceName ) : Promise < resources . FeedItemTarget > => { const request = new services . GetFeedItemTargetRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getFeedItemTarget ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , description returns create : async ( feedItemTargets , options ? ) : Promise < services . MutateFeedItemTargetsResponse > => { const ops = this . buildOperations < services . FeedItemTargetOperation , resources . IFeedItemTarget > ( "create" , feedItemTargets ) ; const request = this . buildRequest < services . FeedItemTargetOperation , services . IMutateFeedItemTargetsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "FeedItemTargetService.mutateFeedItemTargets" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateFeedItemTargets ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns remove : async ( feedItemTargets , options ? ) : Promise < services . MutateFeedItemTargetsResponse > => { const ops = this . buildOperations < services . FeedItemTargetOperation , string > ( "remove" , feedItemTargets ) ; const request = this . buildRequest < services . FeedItemTargetOperation , services . IMutateFeedItemTargetsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "FeedItemTargetService.mutateFeedItemTargets" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateFeedItemTargets ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get feedMappings ( ) { const service = this . loadService < services . FeedMappingService > ( "FeedMappingServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateFeedMappingsRequest , "partial_failure" | "validate_only" | "response_content_type" > > ; return { description warning returns get : async ( resourceName ) : Promise < resources . FeedMapping > => { const request = new services . GetFeedMappingRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getFeedMapping ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , description returns create : async ( feedMappings , options ? ) : Promise < services . MutateFeedMappingsResponse > => { const ops = this . buildOperations < services . FeedMappingOperation , resources . IFeedMapping > ( "create" , feedMappings ) ; const request = this . buildRequest < services . FeedMappingOperation , services . IMutateFeedMappingsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "FeedMappingService.mutateFeedMappings" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateFeedMappings ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns remove : async ( feedMappings , options ? ) : Promise < services . MutateFeedMappingsResponse > => { const ops = this . buildOperations < services . FeedMappingOperation , string > ( "remove" , feedMappings ) ; const request = this . buildRequest < services . FeedMappingOperation , services . IMutateFeedMappingsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "FeedMappingService.mutateFeedMappings" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateFeedMappings ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get feeds ( ) { const service = this . loadService < services . FeedService > ( "FeedServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateFeedsRequest , "partial_failure" | "validate_only" | "response_content_type" > > ; return { description warning returns get : async ( resourceName ) : Promise < resources . Feed > => { const request = new services . GetFeedRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getFeed ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , description returns create : async ( feeds , options ? ) : Promise < services . MutateFeedsResponse > => { const ops = this . buildOperations < services . FeedOperation , resources . IFeed > ( "create" , feeds ) ; const request = this . buildRequest < services . FeedOperation , services . IMutateFeedsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "FeedService.mutateFeeds" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateFeeds ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns update : async ( feeds , options ? ) : Promise < services . MutateFeedsResponse > => { const ops = this . buildOperations < services . FeedOperation , resources . IFeed > ( "update" , feeds , resources . Feed ) ; const request = this . buildRequest < services . FeedOperation , services . IMutateFeedsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "FeedService.mutateFeeds" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateFeeds ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns remove : async ( feeds , options ? ) : Promise < services . MutateFeedsResponse > => { const ops = this . buildOperations < services . FeedOperation , string > ( "remove" , feeds ) ; const request = this . buildRequest < services . FeedOperation , services . IMutateFeedsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "FeedService.mutateFeeds" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateFeeds ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get keywordPlanAdGroupKeywords ( ) { const service = this . loadService < services . KeywordPlanAdGroupKeywordService > ( "KeywordPlanAdGroupKeywordServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateKeywordPlanAdGroupKeywordsRequest , "partial_failure" | "validate_only" > > ; return { description warning returns get : async ( resourceName ) : Promise < resources . KeywordPlanAdGroupKeyword > => { const request = new services . GetKeywordPlanAdGroupKeywordRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getKeywordPlanAdGroupKeyword ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , description returns create : async ( keywordPlanAdGroupKeywords , options ? ) : Promise < services . MutateKeywordPlanAdGroupKeywordsResponse > => { const ops = this . buildOperations < services . KeywordPlanAdGroupKeywordOperation , resources . IKeywordPlanAdGroupKeyword > ( "create" , keywordPlanAdGroupKeywords ) ; const request = this . buildRequest < services . KeywordPlanAdGroupKeywordOperation , services . IMutateKeywordPlanAdGroupKeywordsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "KeywordPlanAdGroupKeywordService.mutateKeywordPlanAdGroupKeywords" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateKeywordPlanAdGroupKeywords ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns update : async ( keywordPlanAdGroupKeywords , options ? ) : Promise < services . MutateKeywordPlanAdGroupKeywordsResponse > => { const ops = this . buildOperations < services . KeywordPlanAdGroupKeywordOperation , resources . IKeywordPlanAdGroupKeyword > ( "update" , keywordPlanAdGroupKeywords , resources . KeywordPlanAdGroupKeyword ) ; const request = this . buildRequest < services . KeywordPlanAdGroupKeywordOperation , services . IMutateKeywordPlanAdGroupKeywordsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "KeywordPlanAdGroupKeywordService.mutateKeywordPlanAdGroupKeywords" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateKeywordPlanAdGroupKeywords ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns remove : async ( keywordPlanAdGroupKeywords , options ? ) : Promise < services . MutateKeywordPlanAdGroupKeywordsResponse > => { const ops = this . buildOperations < services . KeywordPlanAdGroupKeywordOperation , string > ( "remove" , keywordPlanAdGroupKeywords ) ; const request = this . buildRequest < services . KeywordPlanAdGroupKeywordOperation , services . IMutateKeywordPlanAdGroupKeywordsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "KeywordPlanAdGroupKeywordService.mutateKeywordPlanAdGroupKeywords" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateKeywordPlanAdGroupKeywords ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get keywordPlanAdGroups ( ) { const service = this . loadService < services . KeywordPlanAdGroupService > ( "KeywordPlanAdGroupServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateKeywordPlanAdGroupsRequest , "partial_failure" | "validate_only" > > ; return { description warning returns get : async ( resourceName ) : Promise < resources . KeywordPlanAdGroup > => { const request = new services . GetKeywordPlanAdGroupRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getKeywordPlanAdGroup ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , description returns create : async ( keywordPlanAdGroups , options ? ) : Promise < services . MutateKeywordPlanAdGroupsResponse > => { const ops = this . buildOperations < services . KeywordPlanAdGroupOperation , resources . IKeywordPlanAdGroup > ( "create" , keywordPlanAdGroups ) ; const request = this . buildRequest < services . KeywordPlanAdGroupOperation , services . IMutateKeywordPlanAdGroupsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "KeywordPlanAdGroupService.mutateKeywordPlanAdGroups" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateKeywordPlanAdGroups ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns update : async ( keywordPlanAdGroups , options ? ) : Promise < services . MutateKeywordPlanAdGroupsResponse > => { const ops = this . buildOperations < services . KeywordPlanAdGroupOperation , resources . IKeywordPlanAdGroup > ( "update" , keywordPlanAdGroups , resources . KeywordPlanAdGroup ) ; const request = this . buildRequest < services . KeywordPlanAdGroupOperation , services . IMutateKeywordPlanAdGroupsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "KeywordPlanAdGroupService.mutateKeywordPlanAdGroups" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateKeywordPlanAdGroups ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns remove : async ( keywordPlanAdGroups , options ? ) : Promise < services . MutateKeywordPlanAdGroupsResponse > => { const ops = this . buildOperations < services . KeywordPlanAdGroupOperation , string > ( "remove" , keywordPlanAdGroups ) ; const request = this . buildRequest < services . KeywordPlanAdGroupOperation , services . IMutateKeywordPlanAdGroupsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "KeywordPlanAdGroupService.mutateKeywordPlanAdGroups" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateKeywordPlanAdGroups ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get keywordPlanCampaignKeywords ( ) { const service = this . loadService < services . KeywordPlanCampaignKeywordService > ( "KeywordPlanCampaignKeywordServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateKeywordPlanCampaignKeywordsRequest , "partial_failure" | "validate_only" > > ; return { description warning returns get : async ( resourceName ) : Promise < resources . KeywordPlanCampaignKeyword > => { const request = new services . GetKeywordPlanCampaignKeywordRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getKeywordPlanCampaignKeyword ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , description returns create : async ( keywordPlanCampaignKeywords , options ? ) : Promise < services . MutateKeywordPlanCampaignKeywordsResponse > => { const ops = this . buildOperations < services . KeywordPlanCampaignKeywordOperation , resources . IKeywordPlanCampaignKeyword > ( "create" , keywordPlanCampaignKeywords ) ; const request = this . buildRequest < services . KeywordPlanCampaignKeywordOperation , services . IMutateKeywordPlanCampaignKeywordsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "KeywordPlanCampaignKeywordService.mutateKeywordPlanCampaignKeywords" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateKeywordPlanCampaignKeywords ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns update : async ( keywordPlanCampaignKeywords , options ? ) : Promise < services . MutateKeywordPlanCampaignKeywordsResponse > => { const ops = this . buildOperations < services . KeywordPlanCampaignKeywordOperation , resources . IKeywordPlanCampaignKeyword > ( "update" , keywordPlanCampaignKeywords , resources . KeywordPlanCampaignKeyword ) ; const request = this . buildRequest < services . KeywordPlanCampaignKeywordOperation , services . IMutateKeywordPlanCampaignKeywordsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "KeywordPlanCampaignKeywordService.mutateKeywordPlanCampaignKeywords" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateKeywordPlanCampaignKeywords ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns remove : async ( keywordPlanCampaignKeywords , options ? ) : Promise < services . MutateKeywordPlanCampaignKeywordsResponse > => { const ops = this . buildOperations < services . KeywordPlanCampaignKeywordOperation , string > ( "remove" , keywordPlanCampaignKeywords ) ; const request = this . buildRequest < services . KeywordPlanCampaignKeywordOperation , services . IMutateKeywordPlanCampaignKeywordsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "KeywordPlanCampaignKeywordService.mutateKeywordPlanCampaignKeywords" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateKeywordPlanCampaignKeywords ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get keywordPlanCampaigns ( ) { const service = this . loadService < services . KeywordPlanCampaignService > ( "KeywordPlanCampaignServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateKeywordPlanCampaignsRequest , "partial_failure" | "validate_only" > > ; return { description warning returns get : async ( resourceName ) : Promise < resources . KeywordPlanCampaign > => { const request = new services . GetKeywordPlanCampaignRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getKeywordPlanCampaign ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , description returns create : async ( keywordPlanCampaigns , options ? ) : Promise < services . MutateKeywordPlanCampaignsResponse > => { const ops = this . buildOperations < services . KeywordPlanCampaignOperation , resources . IKeywordPlanCampaign > ( "create" , keywordPlanCampaigns ) ; const request = this . buildRequest < services . KeywordPlanCampaignOperation , services . IMutateKeywordPlanCampaignsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "KeywordPlanCampaignService.mutateKeywordPlanCampaigns" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateKeywordPlanCampaigns ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns update : async ( keywordPlanCampaigns , options ? ) : Promise < services . MutateKeywordPlanCampaignsResponse > => { const ops = this . buildOperations < services . KeywordPlanCampaignOperation , resources . IKeywordPlanCampaign > ( "update" , keywordPlanCampaigns , resources . KeywordPlanCampaign ) ; const request = this . buildRequest < services . KeywordPlanCampaignOperation , services . IMutateKeywordPlanCampaignsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "KeywordPlanCampaignService.mutateKeywordPlanCampaigns" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateKeywordPlanCampaigns ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns remove : async ( keywordPlanCampaigns , options ? ) : Promise < services . MutateKeywordPlanCampaignsResponse > => { const ops = this . buildOperations < services . KeywordPlanCampaignOperation , string > ( "remove" , keywordPlanCampaigns ) ; const request = this . buildRequest < services . KeywordPlanCampaignOperation , services . IMutateKeywordPlanCampaignsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "KeywordPlanCampaignService.mutateKeywordPlanCampaigns" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateKeywordPlanCampaigns ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get keywordPlans ( ) { const service = this . loadService < services . KeywordPlanService > ( "KeywordPlanServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateKeywordPlansRequest , "partial_failure" | "validate_only" > > ; return { description warning returns get : async ( resourceName ) : Promise < resources . KeywordPlan > => { const request = new services . GetKeywordPlanRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getKeywordPlan ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , description returns create : async ( keywordPlans , options ? ) : Promise < services . MutateKeywordPlansResponse > => { const ops = this . buildOperations < services . KeywordPlanOperation , resources . IKeywordPlan > ( "create" , keywordPlans ) ; const request = this . buildRequest < services . KeywordPlanOperation , services . IMutateKeywordPlansRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "KeywordPlanService.mutateKeywordPlans" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateKeywordPlans ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns update : async ( keywordPlans , options ? ) : Promise < services . MutateKeywordPlansResponse > => { const ops = this . buildOperations < services . KeywordPlanOperation , resources . IKeywordPlan > ( "update" , keywordPlans , resources . KeywordPlan ) ; const request = this . buildRequest < services . KeywordPlanOperation , services . IMutateKeywordPlansRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "KeywordPlanService.mutateKeywordPlans" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateKeywordPlans ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns remove : async ( keywordPlans , options ? ) : Promise < services . MutateKeywordPlansResponse > => { const ops = this . buildOperations < services . KeywordPlanOperation , string > ( "remove" , keywordPlans ) ; const request = this . buildRequest < services . KeywordPlanOperation , services . IMutateKeywordPlansRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "KeywordPlanService.mutateKeywordPlans" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateKeywordPlans ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , link generateForecastCurve : async ( request ) : Promise < services . GenerateForecastCurveResponse > => { try { const [ response ] = await service . generateForecastCurve ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , link generateForecastTimeSeries : async ( request ) : Promise < services . GenerateForecastTimeSeriesResponse > => { try { const [ response ] = await service . generateForecastTimeSeries ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , link generateForecastMetrics : async ( request ) : Promise < services . GenerateForecastMetricsResponse > => { try { const [ response ] = await service . generateForecastMetrics ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , link generateHistoricalMetrics : async ( request ) : Promise < services . GenerateHistoricalMetricsResponse > => { try { const [ response ] = await service . generateHistoricalMetrics ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get labels ( ) { const service = this . loadService < services . LabelService > ( "LabelServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateLabelsRequest , "partial_failure" | "validate_only" | "response_content_type" > > ; return { description warning returns get : async ( resourceName ) : Promise < resources . Label > => { const request = new services . GetLabelRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getLabel ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , description returns create : async ( labels , options ? ) : Promise < services . MutateLabelsResponse > => { const ops = this . buildOperations < services . LabelOperation , resources . ILabel > ( "create" , labels ) ; const request = this . buildRequest < services . LabelOperation , services . IMutateLabelsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "LabelService.mutateLabels" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateLabels ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns update : async ( labels , options ? ) : Promise < services . MutateLabelsResponse > => { const ops = this . buildOperations < services . LabelOperation , resources . ILabel > ( "update" , labels , resources . Label ) ; const request = this . buildRequest < services . LabelOperation , services . IMutateLabelsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "LabelService.mutateLabels" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateLabels ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns remove : async ( labels , options ? ) : Promise < services . MutateLabelsResponse > => { const ops = this . buildOperations < services . LabelOperation , string > ( "remove" , labels ) ; const request = this . buildRequest < services . LabelOperation , services . IMutateLabelsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "LabelService.mutateLabels" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateLabels ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get mediaFiles ( ) { const service = this . loadService < services . MediaFileService > ( "MediaFileServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateMediaFilesRequest , "partial_failure" | "validate_only" | "response_content_type" > > ; return { description warning returns get : async ( resourceName ) : Promise < resources . MediaFile > => { const request = new services . GetMediaFileRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getMediaFile ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , description returns create : async ( mediaFiles , options ? ) : Promise < services . MutateMediaFilesResponse > => { const ops = this . buildOperations < services . MediaFileOperation , resources . IMediaFile > ( "create" , mediaFiles ) ; const request = this . buildRequest < services . MediaFileOperation , services . IMutateMediaFilesRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "MediaFileService.mutateMediaFiles" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateMediaFiles ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get remarketingActions ( ) { const service = this . loadService < services . RemarketingActionService > ( "RemarketingActionServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateRemarketingActionsRequest , "partial_failure" | "validate_only" > > ; return { description warning returns get : async ( resourceName ) : Promise < resources . RemarketingAction > => { const request = new services . GetRemarketingActionRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getRemarketingAction ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , description returns create : async ( remarketingActions , options ? ) : Promise < services . MutateRemarketingActionsResponse > => { const ops = this . buildOperations < services . RemarketingActionOperation , resources . IRemarketingAction > ( "create" , remarketingActions ) ; const request = this . buildRequest < services . RemarketingActionOperation , services . IMutateRemarketingActionsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "RemarketingActionService.mutateRemarketingActions" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateRemarketingActions ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns update : async ( remarketingActions , options ? ) : Promise < services . MutateRemarketingActionsResponse > => { const ops = this . buildOperations < services . RemarketingActionOperation , resources . IRemarketingAction > ( "update" , remarketingActions , resources . RemarketingAction ) ; const request = this . buildRequest < services . RemarketingActionOperation , services . IMutateRemarketingActionsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "RemarketingActionService.mutateRemarketingActions" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateRemarketingActions ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get sharedCriteria ( ) { const service = this . loadService < services . SharedCriterionService > ( "SharedCriterionServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateSharedCriteriaRequest , "partial_failure" | "validate_only" | "response_content_type" > > ; return { description warning returns get : async ( resourceName ) : Promise < resources . SharedCriterion > => { const request = new services . GetSharedCriterionRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getSharedCriterion ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , description returns create : async ( sharedCriteria , options ? ) : Promise < services . MutateSharedCriteriaResponse > => { const ops = this . buildOperations < services . SharedCriterionOperation , resources . ISharedCriterion > ( "create" , sharedCriteria ) ; const request = this . buildRequest < services . SharedCriterionOperation , services . IMutateSharedCriteriaRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "SharedCriterionService.mutateSharedCriteria" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateSharedCriteria ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns remove : async ( sharedCriteria , options ? ) : Promise < services . MutateSharedCriteriaResponse > => { const ops = this . buildOperations < services . SharedCriterionOperation , string > ( "remove" , sharedCriteria ) ; const request = this . buildRequest < services . SharedCriterionOperation , services . IMutateSharedCriteriaRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "SharedCriterionService.mutateSharedCriteria" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateSharedCriteria ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get sharedSets ( ) { const service = this . loadService < services . SharedSetService > ( "SharedSetServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateSharedSetsRequest , "partial_failure" | "validate_only" | "response_content_type" > > ; return { description warning returns get : async ( resourceName ) : Promise < resources . SharedSet > => { const request = new services . GetSharedSetRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getSharedSet ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , description returns create : async ( sharedSets , options ? ) : Promise < services . MutateSharedSetsResponse > => { const ops = this . buildOperations < services . SharedSetOperation , resources . ISharedSet > ( "create" , sharedSets ) ; const request = this . buildRequest < services . SharedSetOperation , services . IMutateSharedSetsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "SharedSetService.mutateSharedSets" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateSharedSets ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns update : async ( sharedSets , options ? ) : Promise < services . MutateSharedSetsResponse > => { const ops = this . buildOperations < services . SharedSetOperation , resources . ISharedSet > ( "update" , sharedSets , resources . SharedSet ) ; const request = this . buildRequest < services . SharedSetOperation , services . IMutateSharedSetsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "SharedSetService.mutateSharedSets" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateSharedSets ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns remove : async ( sharedSets , options ? ) : Promise < services . MutateSharedSetsResponse > => { const ops = this . buildOperations < services . SharedSetOperation , string > ( "remove" , sharedSets ) ; const request = this . buildRequest < services . SharedSetOperation , services . IMutateSharedSetsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "SharedSetService.mutateSharedSets" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateSharedSets ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get smartCampaignSettings ( ) { const service = this . loadService < services . SmartCampaignSettingService > ( "SmartCampaignSettingServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateSmartCampaignSettingsRequest , "partial_failure" | "validate_only" | "response_content_type" > > ; return { description warning returns get : async ( resourceName ) : Promise < resources . SmartCampaignSetting > => { const request = new services . GetSmartCampaignSettingRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getSmartCampaignSetting ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , description returns update : async ( smartCampaignSettings , options ? ) : Promise < services . MutateSmartCampaignSettingsResponse > => { const ops = this . buildOperations < services . SmartCampaignSettingOperation , resources . ISmartCampaignSetting > ( "update" , smartCampaignSettings , resources . SmartCampaignSetting ) ; const request = this . buildRequest < services . SmartCampaignSettingOperation , services . IMutateSmartCampaignSettingsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "SmartCampaignSettingService.mutateSmartCampaignSettings" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateSmartCampaignSettings ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get userLists ( ) { const service = this . loadService < services . UserListService > ( "UserListServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateUserListsRequest , "partial_failure" | "validate_only" > > ; return { description warning returns get : async ( resourceName ) : Promise < resources . UserList > => { const request = new services . GetUserListRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getUserList ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , description returns create : async ( userLists , options ? ) : Promise < services . MutateUserListsResponse > => { const ops = this . buildOperations < services . UserListOperation , resources . IUserList > ( "create" , userLists ) ; const request = this . buildRequest < services . UserListOperation , services . IMutateUserListsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "UserListService.mutateUserLists" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateUserLists ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns update : async ( userLists , options ? ) : Promise < services . MutateUserListsResponse > => { const ops = this . buildOperations < services . UserListOperation , resources . IUserList > ( "update" , userLists , resources . UserList ) ; const request = this . buildRequest < services . UserListOperation , services . IMutateUserListsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "UserListService.mutateUserLists" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateUserLists ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns remove : async ( userLists , options ? ) : Promise < services . MutateUserListsResponse > => { const ops = this . buildOperations < services . UserListOperation , string > ( "remove" , userLists ) ; const request = this . buildRequest < services . UserListOperation , services . IMutateUserListsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "UserListService.mutateUserLists" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateUserLists ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response : this . decodePartialFailureError ( response ) , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return this . decodePartialFailureError ( response ) ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get biddingStrategySimulations ( ) { const service = this . loadService < services . BiddingStrategySimulationService > ( "BiddingStrategySimulationServiceClient" ) ; return { description warning returns get : async ( resourceName ) : Promise < resources . BiddingStrategySimulation > => { const request = new services . GetBiddingStrategySimulationRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getBiddingStrategySimulation ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get billingSetups ( ) { const service = this . loadService < services . BillingSetupService > ( "BillingSetupServiceClient" ) ; type MutateOptions = never ; return { description warning returns get : async ( resourceName ) : Promise < resources . BillingSetup > => { const request = new services . GetBillingSetupRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getBillingSetup ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , description returns create : async ( billingSetups , options ? ) : Promise < services . MutateBillingSetupResponse > => { const ops = this . buildOperations < services . BillingSetupOperation , resources . IBillingSetup > ( "create" , billingSetups ) ; const request = this . buildRequest < services . BillingSetupOperation , services . IMutateBillingSetupRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "BillingSetupService.mutateBillingSetup" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateBillingSetup ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return response ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns remove : async ( billingSetups , options ? ) : Promise < services . MutateBillingSetupResponse > => { const ops = this . buildOperations < services . BillingSetupOperation , string > ( "remove" , billingSetups ) ; const request = this . buildRequest < services . BillingSetupOperation , services . IMutateBillingSetupRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "BillingSetupService.mutateBillingSetup" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateBillingSetup ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return response ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get campaignAudienceViews ( ) { const service = this . loadService < services . CampaignAudienceViewService > ( "CampaignAudienceViewServiceClient" ) ; return { description warning returns get : async ( resourceName ) : Promise < resources . CampaignAudienceView > => { const request = new services . GetCampaignAudienceViewRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getCampaignAudienceView ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get campaignCriterionSimulations ( ) { const service = this . loadService < services . CampaignCriterionSimulationService > ( "CampaignCriterionSimulationServiceClient" ) ; return { description warning returns get : async ( resourceName ) : Promise < resources . CampaignCriterionSimulation > => { const request = new services . GetCampaignCriterionSimulationRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getCampaignCriterionSimulation ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get campaignSimulations ( ) { const service = this . loadService < services . CampaignSimulationService > ( "CampaignSimulationServiceClient" ) ; return { description warning returns get : async ( resourceName ) : Promise < resources . CampaignSimulation > => { const request = new services . GetCampaignSimulationRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getCampaignSimulation ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get carrierConstants ( ) { const service = this . loadService < services . CarrierConstantService > ( "CarrierConstantServiceClient" ) ; return { description warning returns get : async ( resourceName ) : Promise < resources . CarrierConstant > => { const request = new services . GetCarrierConstantRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getCarrierConstant ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get changeStatuses ( ) { const service = this . loadService < services . ChangeStatusService > ( "ChangeStatusServiceClient" ) ; return { description warning returns get : async ( resourceName ) : Promise < resources . ChangeStatus > => { const request = new services . GetChangeStatusRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getChangeStatus ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get clickViews ( ) { const service = this . loadService < services . ClickViewService > ( "ClickViewServiceClient" ) ; return { description warning returns get : async ( resourceName ) : Promise < resources . ClickView > => { const request = new services . GetClickViewRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getClickView ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get combinedAudiences ( ) { const service = this . loadService < services . CombinedAudienceService > ( "CombinedAudienceServiceClient" ) ; return { description warning returns get : async ( resourceName ) : Promise < resources . CombinedAudience > => { const request = new services . GetCombinedAudienceRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getCombinedAudience ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get conversionAdjustmentUploads ( ) { const service = this . loadService < services . ConversionAdjustmentUploadService > ( "ConversionAdjustmentUploadServiceClient" ) ; return { link uploadConversionAdjustments : async ( request ) : Promise < services . UploadConversionAdjustmentsResponse > => { try { const [ response ] = await service . uploadConversionAdjustments ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get conversionUploads ( ) { const service = this . loadService < services . ConversionUploadService > ( "ConversionUploadServiceClient" ) ; return { link uploadClickConversions : async ( request ) : Promise < services . UploadClickConversionsResponse > => { try { const [ response ] = await service . uploadClickConversions ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , link uploadCallConversions : async ( request ) : Promise < services . UploadCallConversionsResponse > => { try { const [ response ] = await service . uploadCallConversions ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get currencyConstants ( ) { const service = this . loadService < services . CurrencyConstantService > ( "CurrencyConstantServiceClient" ) ; return { description warning returns get : async ( resourceName ) : Promise < resources . CurrencyConstant > => { const request = new services . GetCurrencyConstantRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getCurrencyConstant ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get customAudiences ( ) { const service = this . loadService < services . CustomAudienceService > ( "CustomAudienceServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateCustomAudiencesRequest , "validate_only" > > ; return { description warning returns get : async ( resourceName ) : Promise < resources . CustomAudience > => { const request = new services . GetCustomAudienceRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getCustomAudience ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , description returns create : async ( customAudiences , options ? ) : Promise < services . MutateCustomAudiencesResponse > => { const ops = this . buildOperations < services . CustomAudienceOperation , resources . ICustomAudience > ( "create" , customAudiences ) ; const request = this . buildRequest < services . CustomAudienceOperation , services . IMutateCustomAudiencesRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "CustomAudienceService.mutateCustomAudiences" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateCustomAudiences ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return response ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns update : async ( customAudiences , options ? ) : Promise < services . MutateCustomAudiencesResponse > => { const ops = this . buildOperations < services . CustomAudienceOperation , resources . ICustomAudience > ( "update" , customAudiences , resources . CustomAudience ) ; const request = this . buildRequest < services . CustomAudienceOperation , services . IMutateCustomAudiencesRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "CustomAudienceService.mutateCustomAudiences" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateCustomAudiences ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return response ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns remove : async ( customAudiences , options ? ) : Promise < services . MutateCustomAudiencesResponse > => { const ops = this . buildOperations < services . CustomAudienceOperation , string > ( "remove" , customAudiences ) ; const request = this . buildRequest < services . CustomAudienceOperation , services . IMutateCustomAudiencesRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "CustomAudienceService.mutateCustomAudiences" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateCustomAudiences ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return response ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get customInterests ( ) { const service = this . loadService < services . CustomInterestService > ( "CustomInterestServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateCustomInterestsRequest , "validate_only" > > ; return { description warning returns get : async ( resourceName ) : Promise < resources . CustomInterest > => { const request = new services . GetCustomInterestRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getCustomInterest ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , description returns create : async ( customInterests , options ? ) : Promise < services . MutateCustomInterestsResponse > => { const ops = this . buildOperations < services . CustomInterestOperation , resources . ICustomInterest > ( "create" , customInterests ) ; const request = this . buildRequest < services . CustomInterestOperation , services . IMutateCustomInterestsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "CustomInterestService.mutateCustomInterests" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateCustomInterests ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return response ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns update : async ( customInterests , options ? ) : Promise < services . MutateCustomInterestsResponse > => { const ops = this . buildOperations < services . CustomInterestOperation , resources . ICustomInterest > ( "update" , customInterests , resources . CustomInterest ) ; const request = this . buildRequest < services . CustomInterestOperation , services . IMutateCustomInterestsRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "CustomInterestService.mutateCustomInterests" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateCustomInterests ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return response ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get customerClientLinks ( ) { const service = this . loadService < services . CustomerClientLinkService > ( "CustomerClientLinkServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateCustomerClientLinkRequest , "validate_only" > > ; return { description warning returns get : async ( resourceName ) : Promise < resources . CustomerClientLink > => { const request = new services . GetCustomerClientLinkRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getCustomerClientLink ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , description returns create : async ( customerClientLinks , options ? ) : Promise < services . MutateCustomerClientLinkResponse > => { const ops = this . buildOperations < services . CustomerClientLinkOperation , resources . ICustomerClientLink > ( "create" , customerClientLinks ) ; const request = this . buildRequest < services . CustomerClientLinkOperation , services . IMutateCustomerClientLinkRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "CustomerClientLinkService.mutateCustomerClientLink" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateCustomerClientLink ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return response ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns update : async ( customerClientLinks , options ? ) : Promise < services . MutateCustomerClientLinkResponse > => { const ops = this . buildOperations < services . CustomerClientLinkOperation , resources . ICustomerClientLink > ( "update" , customerClientLinks , resources . CustomerClientLink ) ; const request = this . buildRequest < services . CustomerClientLinkOperation , services . IMutateCustomerClientLinkRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "CustomerClientLinkService.mutateCustomerClientLink" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateCustomerClientLink ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return response ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get customerClients ( ) { const service = this . loadService < services . CustomerClientService > ( "CustomerClientServiceClient" ) ; return { description warning returns get : async ( resourceName ) : Promise < resources . CustomerClient > => { const request = new services . GetCustomerClientRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getCustomerClient ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get customerManagerLinks ( ) { const service = this . loadService < services . CustomerManagerLinkService > ( "CustomerManagerLinkServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateCustomerManagerLinkRequest , "validate_only" > > ; return { description warning returns get : async ( resourceName ) : Promise < resources . CustomerManagerLink > => { const request = new services . GetCustomerManagerLinkRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getCustomerManagerLink ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , description returns update : async ( customerManagerLinks , options ? ) : Promise < services . MutateCustomerManagerLinkResponse > => { const ops = this . buildOperations < services . CustomerManagerLinkOperation , resources . ICustomerManagerLink > ( "update" , customerManagerLinks , resources . CustomerManagerLink ) ; const request = this . buildRequest < services . CustomerManagerLinkOperation , services . IMutateCustomerManagerLinkRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "CustomerManagerLinkService.mutateCustomerManagerLink" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateCustomerManagerLink ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return response ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , link moveManagerLink : async ( request ) : Promise < services . MoveManagerLinkResponse > => { try { const [ response ] = await service . moveManagerLink ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get customerUserAccessInvitations ( ) { const service = this . loadService < services . CustomerUserAccessInvitationService > ( "CustomerUserAccessInvitationServiceClient" ) ; type MutateOptions = never ; return { description warning returns get : async ( resourceName ) : Promise < resources . CustomerUserAccessInvitation > => { const request = new services . GetCustomerUserAccessInvitationRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getCustomerUserAccessInvitation ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , description returns create : async ( customerUserAccessInvitations , options ? ) : Promise < services . MutateCustomerUserAccessInvitationResponse > => { const ops = this . buildOperations < services . CustomerUserAccessInvitationOperation , resources . ICustomerUserAccessInvitation > ( "create" , customerUserAccessInvitations ) ; const request = this . buildRequest < services . CustomerUserAccessInvitationOperation , services . IMutateCustomerUserAccessInvitationRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "CustomerUserAccessInvitationService.mutateCustomerUserAccessInvitation" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateCustomerUserAccessInvitation ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return response ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns remove : async ( customerUserAccessInvitations , options ? ) : Promise < services . MutateCustomerUserAccessInvitationResponse > => { const ops = this . buildOperations < services . CustomerUserAccessInvitationOperation , string > ( "remove" , customerUserAccessInvitations ) ; const request = this . buildRequest < services . CustomerUserAccessInvitationOperation , services . IMutateCustomerUserAccessInvitationRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "CustomerUserAccessInvitationService.mutateCustomerUserAccessInvitation" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateCustomerUserAccessInvitation ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return response ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get customerUserAccesses ( ) { const service = this . loadService < services . CustomerUserAccessService > ( "CustomerUserAccessServiceClient" ) ; type MutateOptions = never ; return { description warning returns get : async ( resourceName ) : Promise < resources . CustomerUserAccess > => { const request = new services . GetCustomerUserAccessRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getCustomerUserAccess ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , description returns update : async ( customerUserAccesses , options ? ) : Promise < services . MutateCustomerUserAccessResponse > => { const ops = this . buildOperations < services . CustomerUserAccessOperation , resources . ICustomerUserAccess > ( "update" , customerUserAccesses , resources . CustomerUserAccess ) ; const request = this . buildRequest < services . CustomerUserAccessOperation , services . IMutateCustomerUserAccessRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "CustomerUserAccessService.mutateCustomerUserAccess" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateCustomerUserAccess ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return response ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns remove : async ( customerUserAccesses , options ? ) : Promise < services . MutateCustomerUserAccessResponse > => { const ops = this . buildOperations < services . CustomerUserAccessOperation , string > ( "remove" , customerUserAccesses ) ; const request = this . buildRequest < services . CustomerUserAccessOperation , services . IMutateCustomerUserAccessRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "CustomerUserAccessService.mutateCustomerUserAccess" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateCustomerUserAccess ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return response ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get detailPlacementViews ( ) { const service = this . loadService < services . DetailPlacementViewService > ( "DetailPlacementViewServiceClient" ) ; return { description warning returns get : async ( resourceName ) : Promise < resources . DetailPlacementView > => { const request = new services . GetDetailPlacementViewRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getDetailPlacementView ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get detailedDemographics ( ) { const service = this . loadService < services . DetailedDemographicService > ( "DetailedDemographicServiceClient" ) ; return { description warning returns get : async ( resourceName ) : Promise < resources . DetailedDemographic > => { const request = new services . GetDetailedDemographicRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getDetailedDemographic ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get displayKeywordViews ( ) { const service = this . loadService < services . DisplayKeywordViewService > ( "DisplayKeywordViewServiceClient" ) ; return { description warning returns get : async ( resourceName ) : Promise < resources . DisplayKeywordView > => { const request = new services . GetDisplayKeywordViewRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getDisplayKeywordView ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get distanceViews ( ) { const service = this . loadService < services . DistanceViewService > ( "DistanceViewServiceClient" ) ; return { description warning returns get : async ( resourceName ) : Promise < resources . DistanceView > => { const request = new services . GetDistanceViewRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getDistanceView ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get domainCategories ( ) { const service = this . loadService < services . DomainCategoryService > ( "DomainCategoryServiceClient" ) ; return { description warning returns get : async ( resourceName ) : Promise < resources . DomainCategory > => { const request = new services . GetDomainCategoryRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getDomainCategory ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get dynamicSearchAdsSearchTermViews ( ) { const service = this . loadService < services . DynamicSearchAdsSearchTermViewService > ( "DynamicSearchAdsSearchTermViewServiceClient" ) ; return { description warning returns get : async ( resourceName ) : Promise < resources . DynamicSearchAdsSearchTermView > => { const request = new services . GetDynamicSearchAdsSearchTermViewRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getDynamicSearchAdsSearchTermView ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get expandedLandingPageViews ( ) { const service = this . loadService < services . ExpandedLandingPageViewService > ( "ExpandedLandingPageViewServiceClient" ) ; return { description warning returns get : async ( resourceName ) : Promise < resources . ExpandedLandingPageView > => { const request = new services . GetExpandedLandingPageViewRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getExpandedLandingPageView ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get feedPlaceholderViews ( ) { const service = this . loadService < services . FeedPlaceholderViewService > ( "FeedPlaceholderViewServiceClient" ) ; return { description warning returns get : async ( resourceName ) : Promise < resources . FeedPlaceholderView > => { const request = new services . GetFeedPlaceholderViewRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getFeedPlaceholderView ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get genderViews ( ) { const service = this . loadService < services . GenderViewService > ( "GenderViewServiceClient" ) ; return { description warning returns get : async ( resourceName ) : Promise < resources . GenderView > => { const request = new services . GetGenderViewRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getGenderView ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get geoTargetConstants ( ) { const service = this . loadService < services . GeoTargetConstantService > ( "GeoTargetConstantServiceClient" ) ; return { description warning returns get : async ( resourceName ) : Promise < resources . GeoTargetConstant > => { const request = new services . GetGeoTargetConstantRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getGeoTargetConstant ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , link suggestGeoTargetConstants : async ( request ) : Promise < services . SuggestGeoTargetConstantsResponse > => { try { const [ response ] = await service . suggestGeoTargetConstants ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get geographicViews ( ) { const service = this . loadService < services . GeographicViewService > ( "GeographicViewServiceClient" ) ; return { description warning returns get : async ( resourceName ) : Promise < resources . GeographicView > => { const request = new services . GetGeographicViewRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getGeographicView ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get groupPlacementViews ( ) { const service = this . loadService < services . GroupPlacementViewService > ( "GroupPlacementViewServiceClient" ) ; return { description warning returns get : async ( resourceName ) : Promise < resources . GroupPlacementView > => { const request = new services . GetGroupPlacementViewRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getGroupPlacementView ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get hotelGroupViews ( ) { const service = this . loadService < services . HotelGroupViewService > ( "HotelGroupViewServiceClient" ) ; return { description warning returns get : async ( resourceName ) : Promise < resources . HotelGroupView > => { const request = new services . GetHotelGroupViewRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getHotelGroupView ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get hotelPerformanceViews ( ) { const service = this . loadService < services . HotelPerformanceViewService > ( "HotelPerformanceViewServiceClient" ) ; return { description warning returns get : async ( resourceName ) : Promise < resources . HotelPerformanceView > => { const request = new services . GetHotelPerformanceViewRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getHotelPerformanceView ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get incomeRangeViews ( ) { const service = this . loadService < services . IncomeRangeViewService > ( "IncomeRangeViewServiceClient" ) ; return { description warning returns get : async ( resourceName ) : Promise < resources . IncomeRangeView > => { const request = new services . GetIncomeRangeViewRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getIncomeRangeView ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get invoices ( ) { const service = this . loadService < services . InvoiceService > ( "InvoiceServiceClient" ) ; return { link listInvoices : async ( request ) : Promise < services . ListInvoicesResponse > => { try { const [ response ] = await service . listInvoices ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get keywordPlanIdeas ( ) { const service = this . loadService < services . KeywordPlanIdeaService > ( "KeywordPlanIdeaServiceClient" ) ; return { link generateKeywordIdeas : async ( request ) : Promise < services . GenerateKeywordIdeaResponse > => { try { const [ response ] = await service . generateKeywordIdeas ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get keywordThemeConstants ( ) { const service = this . loadService < services . KeywordThemeConstantService > ( "KeywordThemeConstantServiceClient" ) ; return { description warning returns get : async ( resourceName ) : Promise < resources . KeywordThemeConstant > => { const request = new services . GetKeywordThemeConstantRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getKeywordThemeConstant ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , link suggestKeywordThemeConstants : async ( request ) : Promise < services . SuggestKeywordThemeConstantsResponse > => { try { const [ response ] = await service . suggestKeywordThemeConstants ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get keywordViews ( ) { const service = this . loadService < services . KeywordViewService > ( "KeywordViewServiceClient" ) ; return { description warning returns get : async ( resourceName ) : Promise < resources . KeywordView > => { const request = new services . GetKeywordViewRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getKeywordView ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get landingPageViews ( ) { const service = this . loadService < services . LandingPageViewService > ( "LandingPageViewServiceClient" ) ; return { description warning returns get : async ( resourceName ) : Promise < resources . LandingPageView > => { const request = new services . GetLandingPageViewRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getLandingPageView ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get languageConstants ( ) { const service = this . loadService < services . LanguageConstantService > ( "LanguageConstantServiceClient" ) ; return { description warning returns get : async ( resourceName ) : Promise < resources . LanguageConstant > => { const request = new services . GetLanguageConstantRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getLanguageConstant ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get lifeEvents ( ) { const service = this . loadService < services . LifeEventService > ( "LifeEventServiceClient" ) ; return { description warning returns get : async ( resourceName ) : Promise < resources . LifeEvent > => { const request = new services . GetLifeEventRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getLifeEvent ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get locationViews ( ) { const service = this . loadService < services . LocationViewService > ( "LocationViewServiceClient" ) ; return { description warning returns get : async ( resourceName ) : Promise < resources . LocationView > => { const request = new services . GetLocationViewRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getLocationView ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get managedPlacementViews ( ) { const service = this . loadService < services . ManagedPlacementViewService > ( "ManagedPlacementViewServiceClient" ) ; return { description warning returns get : async ( resourceName ) : Promise < resources . ManagedPlacementView > => { const request = new services . GetManagedPlacementViewRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getManagedPlacementView ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get merchantCenterLinks ( ) { const service = this . loadService < services . MerchantCenterLinkService > ( "MerchantCenterLinkServiceClient" ) ; type MutateOptions = Partial < Pick < services . IMutateMerchantCenterLinkRequest , "validate_only" > > ; return { link listMerchantCenterLinks : async ( request ) : Promise < services . ListMerchantCenterLinksResponse > => { try { const [ response ] = await service . listMerchantCenterLinks ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , description warning returns get : async ( resourceName ) : Promise < resources . MerchantCenterLink > => { const request = new services . GetMerchantCenterLinkRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getMerchantCenterLink ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , description returns update : async ( merchantCenterLinks , options ? ) : Promise < services . MutateMerchantCenterLinkResponse > => { const ops = this . buildOperations < services . MerchantCenterLinkOperation , resources . IMerchantCenterLink > ( "update" , merchantCenterLinks , resources . MerchantCenterLink ) ; const request = this . buildRequest < services . MerchantCenterLinkOperation , services . IMutateMerchantCenterLinkRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "MerchantCenterLinkService.mutateMerchantCenterLink" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateMerchantCenterLink ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return response ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } , description returns remove : async ( merchantCenterLinks , options ? ) : Promise < services . MutateMerchantCenterLinkResponse > => { const ops = this . buildOperations < services . MerchantCenterLinkOperation , string > ( "remove" , merchantCenterLinks ) ; const request = this . buildRequest < services . MerchantCenterLinkOperation , services . IMutateMerchantCenterLinkRequest , MutateOptions > ( ops , options ) ; const baseHookArguments = { credentials : this . credentials , method : "MerchantCenterLinkService.mutateMerchantCenterLink" , mutation : request , isServiceCall : true , } ; if ( this . hooks . onMutationStart ) { const mutationCancellation = { cancelled : false } ; await this . hooks . onMutationStart ( { ... baseHookArguments , cancel : ( res ) => { mutationCancellation . cancelled = true ; mutationCancellation . res = res ; } , editOptions : ( options ) => { Object . entries ( options ) . forEach ( ( [ key , val ] ) => { request [ key ] = val ; } ) ; } , } ) ; if ( mutationCancellation . cancelled ) { return mutationCancellation . res ; } } try { const [ response ] = await service . mutateMerchantCenterLink ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; if ( this . hooks . onMutationEnd ) { const mutationResolution = { resolved : false } ; await this . hooks . onMutationEnd ( { ... baseHookArguments , response , resolve : ( res ) => { mutationResolution . resolved = true ; mutationResolution . res = res ; } , } ) ; if ( mutationResolution . resolved ) { return mutationResolution . res ; } } return response ; } catch ( err ) { const googleAdsError = this . getGoogleAdsError ( err ) ; if ( this . hooks . onMutationError ) { await this . hooks . onMutationError ( { ... baseHookArguments , error : googleAdsError , } ) ; } throw googleAdsError ; } } } ; } link public get mobileAppCategoryConstants ( ) { const service = this . loadService < services . MobileAppCategoryConstantService > ( "MobileAppCategoryConstantServiceClient" ) ; return { description warning returns get : async ( resourceName ) : Promise < resources . MobileAppCategoryConstant > => { const request = new services . GetMobileAppCategoryConstantRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getMobileAppCategoryConstant ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get mobileDeviceConstants ( ) { const service = this . loadService < services . MobileDeviceConstantService > ( "MobileDeviceConstantServiceClient" ) ; return { description warning returns get : async ( resourceName ) : Promise < resources . MobileDeviceConstant > => { const request = new services . GetMobileDeviceConstantRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getMobileDeviceConstant ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get offlineUserDataJobs ( ) { const service = this . loadService < services . OfflineUserDataJobService > ( "OfflineUserDataJobServiceClient" ) ; return { link createOfflineUserDataJob : async ( request ) : Promise < services . CreateOfflineUserDataJobResponse > => { try { const [ response ] = await service . createOfflineUserDataJob ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , description warning returns get : async ( resourceName ) : Promise < resources . OfflineUserDataJob > => { const request = new services . GetOfflineUserDataJobRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getOfflineUserDataJob ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , link addOfflineUserDataJobOperations : async ( request ) : Promise < services . AddOfflineUserDataJobOperationsResponse > => { try { const [ response ] = await service . addOfflineUserDataJobOperations ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , link runOfflineUserDataJob : async ( request ) : Promise < longrunning . Operation > => { try { const [ response ] = await service . runOfflineUserDataJob ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get operatingSystemVersionConstants ( ) { const service = this . loadService < services . OperatingSystemVersionConstantService > ( "OperatingSystemVersionConstantServiceClient" ) ; return { description warning returns get : async ( resourceName ) : Promise < resources . OperatingSystemVersionConstant > => { const request = new services . GetOperatingSystemVersionConstantRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getOperatingSystemVersionConstant ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get paidOrganicSearchTermViews ( ) { const service = this . loadService < services . PaidOrganicSearchTermViewService > ( "PaidOrganicSearchTermViewServiceClient" ) ; return { description warning returns get : async ( resourceName ) : Promise < resources . PaidOrganicSearchTermView > => { const request = new services . GetPaidOrganicSearchTermViewRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getPaidOrganicSearchTermView ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get parentalStatusViews ( ) { const service = this . loadService < services . ParentalStatusViewService > ( "ParentalStatusViewServiceClient" ) ; return { description warning returns get : async ( resourceName ) : Promise < resources . ParentalStatusView > => { const request = new services . GetParentalStatusViewRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getParentalStatusView ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get paymentsAccounts ( ) { const service = this . loadService < services . PaymentsAccountService > ( "PaymentsAccountServiceClient" ) ; return { link listPaymentsAccounts : async ( request ) : Promise < services . ListPaymentsAccountsResponse > => { try { const [ response ] = await service . listPaymentsAccounts ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get productBiddingCategoryConstants ( ) { const service = this . loadService < services . ProductBiddingCategoryConstantService > ( "ProductBiddingCategoryConstantServiceClient" ) ; return { description warning returns get : async ( resourceName ) : Promise < resources . ProductBiddingCategoryConstant > => { const request = new services . GetProductBiddingCategoryConstantRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getProductBiddingCategoryConstant ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get productGroupViews ( ) { const service = this . loadService < services . ProductGroupViewService > ( "ProductGroupViewServiceClient" ) ; return { description warning returns get : async ( resourceName ) : Promise < resources . ProductGroupView > => { const request = new services . GetProductGroupViewRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getProductGroupView ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get reachPlans ( ) { const service = this . loadService < services . ReachPlanService > ( "ReachPlanServiceClient" ) ; return { link listPlannableLocations : async ( request ) : Promise < services . ListPlannableLocationsResponse > => { try { const [ response ] = await service . listPlannableLocations ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , link listPlannableProducts : async ( request ) : Promise < services . ListPlannableProductsResponse > => { try { const [ response ] = await service . listPlannableProducts ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , link generateProductMixIdeas : async ( request ) : Promise < services . GenerateProductMixIdeasResponse > => { try { const [ response ] = await service . generateProductMixIdeas ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , link generateReachForecast : async ( request ) : Promise < services . GenerateReachForecastResponse > => { try { const [ response ] = await service . generateReachForecast ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get recommendations ( ) { const service = this . loadService < services . RecommendationService > ( "RecommendationServiceClient" ) ; return { description warning returns get : async ( resourceName ) : Promise < resources . Recommendation > => { const request = new services . GetRecommendationRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getRecommendation ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , link applyRecommendation : async ( request ) : Promise < services . ApplyRecommendationResponse > => { try { const [ response ] = await service . applyRecommendation ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , link dismissRecommendation : async ( request ) : Promise < services . DismissRecommendationResponse > => { try { const [ response ] = await service . dismissRecommendation ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get searchTermViews ( ) { const service = this . loadService < services . SearchTermViewService > ( "SearchTermViewServiceClient" ) ; return { description warning returns get : async ( resourceName ) : Promise < resources . SearchTermView > => { const request = new services . GetSearchTermViewRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getSearchTermView ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get shoppingPerformanceViews ( ) { const service = this . loadService < services . ShoppingPerformanceViewService > ( "ShoppingPerformanceViewServiceClient" ) ; return { description warning returns get : async ( resourceName ) : Promise < resources . ShoppingPerformanceView > => { const request = new services . GetShoppingPerformanceViewRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getShoppingPerformanceView ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get smartCampaignSearchTermViews ( ) { const service = this . loadService < services . SmartCampaignSearchTermViewService > ( "SmartCampaignSearchTermViewServiceClient" ) ; return { description warning returns get : async ( resourceName ) : Promise < resources . SmartCampaignSearchTermView > => { const request = new services . GetSmartCampaignSearchTermViewRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getSmartCampaignSearchTermView ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get smartCampaignSuggests ( ) { const service = this . loadService < services . SmartCampaignSuggestService > ( "SmartCampaignSuggestServiceClient" ) ; return { link suggestSmartCampaignBudgetOptions : async ( request ) : Promise < services . SuggestSmartCampaignBudgetOptionsResponse > => { try { const [ response ] = await service . suggestSmartCampaignBudgetOptions ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , link suggestSmartCampaignAd : async ( request ) : Promise < services . SuggestSmartCampaignAdResponse > => { try { const [ response ] = await service . suggestSmartCampaignAd ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , link suggestKeywordThemes : async ( request ) : Promise < services . SuggestKeywordThemesResponse > => { try { const [ response ] = await service . suggestKeywordThemes ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get thirdPartyAppAnalyticsLinks ( ) { const service = this . loadService < services . ThirdPartyAppAnalyticsLinkService > ( "ThirdPartyAppAnalyticsLinkServiceClient" ) ; return { description warning returns get : async ( resourceName ) : Promise < resources . ThirdPartyAppAnalyticsLink > => { const request = new services . GetThirdPartyAppAnalyticsLinkRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getThirdPartyAppAnalyticsLink ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } , link regenerateShareableLinkId : async ( request ) : Promise < services . RegenerateShareableLinkIdResponse > => { try { const [ response ] = await service . regenerateShareableLinkId ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get topicConstants ( ) { const service = this . loadService < services . TopicConstantService > ( "TopicConstantServiceClient" ) ; return { description warning returns get : async ( resourceName ) : Promise < resources . TopicConstant > => { const request = new services . GetTopicConstantRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getTopicConstant ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get topicViews ( ) { const service = this . loadService < services . TopicViewService > ( "TopicViewServiceClient" ) ; return { description warning returns get : async ( resourceName ) : Promise < resources . TopicView > => { const request = new services . GetTopicViewRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getTopicView ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get userData ( ) { const service = this . loadService < services . UserDataService > ( "UserDataServiceClient" ) ; return { link uploadUserData : async ( request ) : Promise < services . UploadUserDataResponse > => { try { const [ response ] = await service . uploadUserData ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get userInterests ( ) { const service = this . loadService < services . UserInterestService > ( "UserInterestServiceClient" ) ; return { description warning returns get : async ( resourceName ) : Promise < resources . UserInterest > => { const request = new services . GetUserInterestRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getUserInterest ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get userLocationViews ( ) { const service = this . loadService < services . UserLocationViewService > ( "UserLocationViewServiceClient" ) ; return { description warning returns get : async ( resourceName ) : Promise < resources . UserLocationView > => { const request = new services . GetUserLocationViewRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getUserLocationView ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get videos ( ) { const service = this . loadService < services . VideoService > ( "VideoServiceClient" ) ; return { description warning returns get : async ( resourceName ) : Promise < resources . Video > => { const request = new services . GetVideoRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getVideo ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } link public get webpageViews ( ) { const service = this . loadService < services . WebpageViewService > ( "WebpageViewServiceClient" ) ; return { description warning returns get : async ( resourceName ) : Promise < resources . WebpageView > => { const request = new services . GetWebpageViewRequest ( { resource_name : resourceName , } ) ; try { const [ response ] = await service . getWebpageView ( request , { otherArgs : { headers : this . callHeaders , } , } ) ; return response ; } catch ( err ) { throw this . getGoogleAdsError ( err ) ; } } } ; } }