Hi Dmytro,
Thanks for reaching out. Please refer to the following code to update Responsive Search Ad with AdService.mutate() in Adwords API:
// Get the AdService.
AdGroupServiceInterface adService = adWordsServices.get(session, AdGroupServiceInterface.class);
// Create base class ad to avoid setting type specific fields.
Ad ad = new Ad();
ad.setId(adId);
// Here is the code to update the ad
// Create ad group ad.
AdGroupAd adGroupAd = new AdGroupAd();
adGroupAd.setAdGroupId(adGroupId);
adGroupAd.setAd(ad);
Please let me know if you have any further questions.
Thanks and regards,
Xiaoming, Google Ads API Team