$ad = new Ad([
'resource_name' => ResourceNames::forAd($customerId, $adId),
'final_urls' => [$finalUrls],
'final_mobile_urls' => [$finalUrls],
'responsive_search_ad' => new ResponsiveSearchAdInfo([
// Update some properties of the responsive search ad.
'headlines' => [
new AdTextAsset([
'text' => 'Cruise to Pluto 1' ,
'pinned_field' => ServedAssetFieldType::HEADLINE
]),
new AdTextAsset([
'text' => 'Cruise to Pluto 2' ,
'pinned_field' => ServedAssetFieldType::HEADLINE_1
]),
new AdTextAsset([
'text' => 'Cruise to Pluto 3' ,
'pinned_field' => ServedAssetFieldType::HEADLINE_2
]),
],
'descriptions' => [
new AdTextAsset(['text' => 'Best space cruise ever.']),
new AdTextAsset([
'text' => 'The most wonderful space experience you will ever have.'])
]
]),
]);
$adOperation = new AdOperation();
$adOperation->setUpdate($ad);
$adOperation->setUpdateMask(FieldMasks::allSetFieldsOf($ad));
$response = $adServiceClient->mutateAds(MutateAdsRequest::build($customerId, [$adOperation]));
I think is something with ResponsiveSearchAdInfo method, because if i take off this parameter, the final_urls was updated successfully.