code: def to_app(app):
          
          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!')
docs: Serializes app to id string
          :param app: object to serialize
          :return: string id