'Google Ads Api "The field mask updated a field with subfields" Error

I want to delete the "UrlCustomParameters" that I added to the post using Google Ads Api. But as a result of my attempts, I get the error "Field mask has updated a field with subdomains".

Error Code:"FIELD_HAS_SUBFIELDS".

Thanks in advance for your help.

            Ad ad = new();
            ad.UrlCustomParameters.Clear();

            //Update AdGroupAd
            AdGroupAd adGroupAd = new AdGroupAd
            {
                ResourceName = model.ResourceName,
                Status = _mapper.Map<AdGroupAdStatus>(model.Status),
                Ad=ad
            };

            //Assign Custom Parameter
            //AssignCustomParameters(model.Parameters, ref adGroupAd);

            //Create Operation For Update
            AdGroupAdOperation operation = new AdGroupAdOperation
            {
                Update = adGroupAd,
                UpdateMask = FieldMasks.AllSetFieldsOf(adGroupAd)
            };

            // Update the ad.
            MutateAdGroupAdsResponse response =
                _adServiceClient.MutateAdGroupAds(GoogleConstDatas.DevelopmentCustomerId,
                    new AdGroupAdOperation[] { operation });

enter image description here



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source