MCPcopy
hub / github.com/diffgram/diffgram / new

Method new

shared/database/notifications/notification.py:237–283  ·  view source on GitHub ↗
(session=None,
            add_to_session=False,
            flush_session=False,
            type=None,
            status='unread',
            channel_type='unread',
            description=None,
            title=None,
            member_created=None,
            member_updated=None,
            project_id=None,
            input_id=None,
            task_id=None,
            job_id=None,
            member_id=None,
            working_dir_id=None,
            file_id=None,
            )

Source from the content-addressed store, hash-verified

235
236 @staticmethod
237 def new(session=None,
238 add_to_session=False,
239 flush_session=False,
240 type=None,
241 status='unread',
242 channel_type='unread',
243 description=None,
244 title=None,
245 member_created=None,
246 member_updated=None,
247 project_id=None,
248 input_id=None,
249 task_id=None,
250 job_id=None,
251 member_id=None,
252 working_dir_id=None,
253 file_id=None,
254 ):
255
256 notification = Notification(
257 status=status,
258 member_created=member_created,
259 title=title,
260 description=description,
261 channel_type=channel_type,
262 type=type,
263 member_updated=member_updated,
264 time_created=datetime.datetime.now(),
265 time_updated=datetime.datetime.now(),
266 )
267 if add_to_session:
268 session.add(notification)
269 if flush_session:
270 session.flush()
271 # Create notification Object
272 notification_relation = NotificationRelation.new(session=session,
273 add_to_session=add_to_session,
274 flush_session=flush_session,
275 project_id=project_id,
276 input_id=input_id,
277 task_id=task_id,
278 job_id=job_id,
279 member_id=member_id,
280 working_dir_id=working_dir_id,
281 file_id=file_id)
282 notification.notification_relation = notification_relation
283 return notification
284
285 @staticmethod
286 def get_by_id(session, job_launch_id=None):

Callers 1

send_to_webhookMethod · 0.45

Calls 2

NotificationClass · 0.85
addMethod · 0.45

Tested by

no test coverage detected