AdGroupAdPage page = adGroupAdService.get(selector);
TemplateAd templateAd = adGroupAd.ad as TemplateAd;
TemplateAd templateAdNew = new TemplateAd();
//Update the url in the downloaded ads
templateAdNew.url = templateAd.url;
templateAdNew.finalUrls = templateAd.finalUrls;
templateAdNew.trackingUrlTemplate = templateAd.trackingUrlTemplate;
templateAdNew.displayUrl = templateAd.displayUrl;
templateAdNew.name = templateAd.name;
templateAdNew.templateElements = templateAd.templateElements;
templateAdNew.templateId = templateAd.templateId;
templateAdNew.adUnionId = templateAd.adUnionId;
templateAdNew.dimensions = templateAd.dimensions;
AdGroupAd textadGroupAd = new AdGroupAd();
textadGroupAd.adGroupId = adgroupId;
textadGroupAd.ad = templateAdNew;
textadGroupAd.status = adGroupAd.status;
AdGroupAdOperation adGroupAdOperation = new AdGroupAdOperation();
adGroupAdOperation.@operator = Operator.ADD;
adGroupAdOperation.operand = textadGroupAd;
adGroupAdService.mutate(new AdGroupAdOperation[] {adGroupAdOperation});