GET /notifications/1
429251
def show
      notification = Notification.find_by(id: params[:id])
      activity     = notification.activity

      notification.mark_as_read if notification.unread?

      redirect_to activity_activities_path(activity_id: activity.id)
    end
676493
def _get_notifications_status(self, notifications):
        
        if notifications:
            size = len(notifications["activeNotifications"])
        else:
            size = 0
        status = self.status_notif if size > 0 else self.status_no_notif

        return (size, status)
142014
def notification_rules(self, **kwargs):
        """"""
        endpoint = '{0}/{1}/notification_rules'.format(
            self.endpoint,
            self['id'],
        )
        result = self.request('GET', endpoint=endpoint, query_params=kwargs)
        return result['notification_rules']
1360456
function listNotifications(req, res, next){
  var logger = log.defaultLogger();
  var listReq = RequestTranslator.parseListNotificationsRequest(req);
  var NotificationsModel = models.getModels().Notification;
  NotificationsModel.queryNotifications(listReq.uid, listReq.env, listReq.domain, function(err, notifications){
    if(err) {
      logger.error(loggerPrefix + 'Notifications Query Error: ', err);
      next(err);
    } else {
      var notificationsRes = ResponseTranslator.mapNotificationsToResponse(notifications);
      req.resultData = notificationsRes;
      next();
    }
  });
}
259526
public function getNotifications()
    {
        $repository = $this->getService('repos:notifications.notification');

        return $repository->getQuery()
                ->status(ComNotificationsDomainEntityNotification::STATUS_SENT)
                ->id($this->notificationIds->toArray())
                ->toEntityset();
    }
281574
def normal_notification(text, options = {})
      base = {
        aps: {
          alert: {
            title: nil,
            subtitle: nil,
            body: text
          },
          sound: options.delete(:sound),
          badge: 1,
          'mutable-content': 1,
          'content-available': 1
        }
      }
      base.merge(options)
    end
1161459
def membership_request_notifications(user):
    ''''''
    orgs = [o for o in user.organizations if o.is_admin(user)]
    notifications = []

    for org in orgs:
        for request in org.pending_requests:
            notifications.append((request.created, {
                'id': request.id,
                'organization': org.id,
                'user': {
                    'id': request.user.id,
                    'fullname': request.user.fullname,
                    'avatar': str(request.user.avatar)
                }
            }))

    return notifications
1046509
def notification_message(cls, item):
        ''''''
        assert isinstance(item, Notification)
        return cls.encode_payload(cls.request_payload(item, None))
1318587
def get_all(self, request, notifications, mark_as_read=False):
        
        return self.list(request, notifications)
799157
def notifications(self):
        """"""
        self.__init()
        items = []
        for n in self._notifications:
            if "id" in n:
                url = "%s/%s" % (self.root, n['id'])
                items.append(self.Notification(url=url,
                                               securityHandler=self._securityHandler,
                                               proxy_url=self._proxy_url,
                                               proxy_port=self._proxy_port))
        return items
1369492
def old_style_notification(notify)
      resources = resource_hash_references(notify)
      resource_type = resources.xpath("symbol[1]/ident/@value").to_s.to_sym
      if resource_type.empty?
        resource_type = resources.xpath("label/@value").to_s.chop.to_sym
      end
      resource_name = resources.xpath('string_add[1][count(../
        descendant::string_add) = 1]/tstring_content/@value').to_s
      resource_name = resources if resource_name.empty?
      { resource_name: resource_name, resource_type: resource_type }
    end
466639
def notify(self, state, notifications):
        '''
        
        '''

        def do_append(desc, notifications):
            for notification in notifications:
                if not isinstance(notification, PendingNotification):
                    raise ValueError("Expected notify() params to be a list "
                                     "of PendingNotification instance, got %r."
                                     % notification)
                key = str(notification.recipient.key)
                if key not in desc.pending_notifications:
                    desc.pending_notifications[key] = list()
                desc.pending_notifications[key].append(notification)

        return state.agent.update_descriptor(do_append, notifications)
866320
def notification_action(notify)
      is_variable = true unless notify.xpath("args_add_block/args_add//args_add[aref or vcall or call or var_ref]").empty?
      string_val = notify.xpath("descendant::args_add/string_literal/string_add/tstring_content/@value").first
      symbol_val = notify.xpath('descendant::args_add/args_add//symbol/ident/@value |
        descendant::dyna_symbol[1]/xstring_add/tstring_content/@value').first

      # 1) return a nil if the action is a variable like node['foo']['bar']
      # 2) return the symbol if it exists
      # 3) return the string since we're positive that we're not a symbol or variable
      return nil if is_variable
      return symbol_val.value.to_sym unless symbol_val.nil?
      string_val.value
    end
865137
public List<String> getScheduledNotificationMessage(ScheduledNotification notification) {
        return broker.callRPCList("RGCWXQ SCHMSG", null, notification.getIen());
    }
376273
def stdout_notifications(notifications):
    
    for error in notifications["errors"]:
        LOGGER.error(error)
    for warn in notifications["warnings"]:
        LOGGER.warning(warn)
1010321
async function getNotifications(config) {
  try {
    const options = {
      method: "GET",
      uri: `${config.obServer}:${config.obPort}/ob/notifications`,
      json: true, // Automatically stringifies the body to JSON
      headers: {
        Authorization: config.apiCredentials,
      },
      // resolveWithFullResponse: true
    };

    return rp(options);
  } catch (err) {
    console.error(`Error in openbazaar.js/getNotifications(): ${err}`);
    console.error(`Error stringified: ${JSON.stringify(err, null, 2)}`);
    throw err;
  }
}
161279
public function notifynderNotifications()
    {
        $model = app('notifynder.resolver.model')->getModel(Notification::class);
        if (notifynder_config()->isPolymorphic()) {
            return $this->morphMany($model, 'to');
        }

        return $this->hasMany($model, 'to_id');
    }