'Update registration.
:param messages.RegistrationResource regr: Registration Resource.
:param messages.Registration update: Updated body of the
resource. If not provided, body will be taken from `regr`.
:returns: Updated Registration Resource.
:rtype: `.RegistrationResource`'

def update_registration(self, regr, update=None):

    update = (regr.body if (update is None) else update)
    body = messages.UpdateRegistration(**dict(update))
    updated_regr = self._send_recv_regr(regr, body=body)
    return updated_regr
