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