def to_user(user):
        """Serializes user to id string
        :param user: object to serialize
        :return: string id
        """
        from sevenbridges.models.user import User
        if not user:
            raise SbgError('User is required!')
        elif isinstance(user, User):
            return user.username
        elif isinstance(user, six.string_types):
            return user
        else:
            raise SbgError('Invalid user parameter!')
def to_user ( user ) : from sevenbridges . models . user import User if not user : raise SbgError ( 'User is required!' ) elif isinstance ( user , User ) : return user . username elif isinstance ( user , six . string_types ) : return user else : raise SbgError ( 'Invalid user parameter!' )
Serializes user to id string
        :param user: object to serialize
        :return: string id