'Register.
:param .NewRegistration new_reg:
:returns: Registration Resource.
:rtype: `.RegistrationResource`'

def register(self, new_reg=None):

    new_reg = (messages.NewRegistration() if (new_reg is None) else new_reg)
    assert isinstance(new_reg, messages.NewRegistration)
    response = self.net.post(self.directory[new_reg], new_reg)
    assert (response.status_code == http_client.CREATED)
    return self._regr_from_response(response)
