def METHOD_NAME(self, name):
    """ Update relay """
    data = api.payload
    if not validators.domain(name):
        return { 'code': 400, 'message': f'Relayed domain {name} is not a valid domain'}, 400
    relay_found = models.Relay.query.filter_by(name=name).first()
    if relay_found is None:
        return { 'code': 404, 'message': f'Relayed domain {name} cannot be found'}, 404
    if 'smtp' in data:
        relay_found.smtp = data['smtp']
    if 'comment' in data:
        relay_found.comment = data['comment']
    db.session.add(relay_found)
    db.session.commit()
    return { 'code': 200, 'message': f'Relayed domain {name} has been updated'}, 200