List your notifications

@link https://developer.github.com/v3/activity/notifications/#list-your-notifications

@param bool   $all
@param bool   $participating
@param string $since
@param string $before

@return array
@throws \Exception
358422
public function listNotifications(bool $all = false, bool $participating = false, string $since = 'now',
                                      string $before = null): array
    {
        return $this->getApi()->request($this->getApi()->sprintf('/notifications?:args', http_build_query([
            'all'           => $all,
            'participating' => $participating,
            'since'         => (new DateTime($since))->format(DateTime::ATOM),
            'before'        => (new DateTime($before))->format(DateTime::ATOM)
        ])));
    }
142615
public function pruneAttempts(DateTime $before = null)
    {
        if (!$before) {
            $duration = (int) $this->config->get('concrete.user.deactivation.authentication_failure.duration');
            $before = Carbon::now('UTC')->subSeconds($duration);
        }

        // Load our repository and get entries before our date
        $repository = $this->entityManager->getRepository(LoginAttempt::class);
        $results = $repository->before($before);

        // Loop through and remove those entries
        $batch = [];
        $max = 50;

        foreach ($results as $result) {
            $this->entityManager->remove($result);
            $batch[] = $result;

            // Handle the batch
            $batch = $this->manageBatch($batch, $max);
        }

        // Close off the batch
        $this->manageBatch($batch);
    }
1079833
def get_upcoming_events(self):
        
        mask = "mask[id, subject, startDate, endDate, statusCode, acknowledgedFlag, impactedResourceCount, updateCount]"
        _filter = {
            'endDate': {
                'operation': '> sysdate'
            },
            'startDate': {
                'operation': 'orderBy',
                'options': [{
                    'name': 'sort',
                    'value': ['ASC']
                }]
            }
        }
        return self.client.call('Notification_Occurrence_Event', 'getAllObjects', filter=_filter, mask=mask, iter=True)
917232
public function getNotificationHistory()
    {
        $notifications = [];
        if (count($this->response->notifications)) {
            foreach ($this->response->notifications as $notification) {
                $notifications[] = new AuthnetWebhooksResponse(json_encode($notification));
            }
        }
        return $notifications;
    }
1268659
@Override
	public List<CommerceNotificationTemplate> findAll() {
		return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
	}
798153
@Override
	public List<CommerceNotificationTemplateUserSegmentRel> findAll() {
		return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
	}
1188194
def list_all_after(self, message_id, limit=None):
        
        return self.list_after(message_id, limit=limit).autopage()
1048069
public function listAction($notifiable)
    {
        $notifiableRepo = $this->get('doctrine.orm.entity_manager')->getRepository('MgiletNotificationBundle:NotifiableNotification');
        $notificationList = $notifiableRepo->findAllForNotifiableId($notifiable);
        return $this->render('@MgiletNotification/notifications.html.twig', array(
            'notificationList' => $notificationList,
            'notifiableNotifications' => $notificationList // deprecated: alias for backward compatibility only
        ));
    }
165493
public function add_notification( $all_notifications ) {

		$message = apply_filters( $this->product->get_key() . '_logger_heading', 'Do you enjoy <b>{product}</b>? Become a contributor by opting in to our anonymous data tracking. We guarantee no sensitive data is collected.' );

		$message       = str_replace(
			array( '{product}' ),
			$this->product->get_friendly_name(),
			$message
		);
		$button_submit = apply_filters( $this->product->get_key() . '_logger_button_submit', 'Sure, I would love to help.' );
		$button_cancel = apply_filters( $this->product->get_key() . '_logger_button_cancel', 'No, thanks.' );

		$all_notifications[] = [
			'id'      => $this->product->get_key() . '_logger_flag',
			'message' => $message,
			'ctas'    => [
				'confirm' => [
					'link' => '#',
					'text' => $button_submit,
				],
				'cancel'  => [
					'link' => '#',
					'text' => $button_cancel,
				],
			],
		];

		return $all_notifications;
	}
164163
public function renderNotificationsAction(int $offset, int $limit): Response
    {
        $notifications = $this->notificationService->loadNotifications($offset, $limit);

        $html = '';
        foreach ($notifications as $notification) {
            if ($this->registry->hasRenderer($notification->type)) {
                $renderer = $this->registry->getRenderer($notification->type);
                $html .= $renderer->render($notification);
            }
        }

        return new Response($html);
    }
674312
public function add_notification( $all_notifications ) {

		$lang          = $this->get_user_locale();
		$link          = $this->get_locale_paths( $lang );
		$language_meta = self::$locales[ $lang ];

		$heading = apply_filters( $this->product->get_key() . '_feedback_translate_heading', 'Improve {product}' );
		$heading = str_replace(
			array( '{product}' ),
			$this->product->get_friendly_name(),
			$heading
		);
		$message = apply_filters(
			$this->product->get_key() . '_feedback_translation',
			'Translating <b>{product}</b> into as many languages as possible is a huge project. We still need help with a lot of them, so if you are good at translating into <b>{language}</b>, it would be greatly appreciated.
The process is easy, and you can join by following the link below!'
		);

		$message = str_replace(
			[ '{product}', '{language}' ],
			[
				$this->product->get_friendly_name(),
				$language_meta['name'],
			],
			$message
		);

		$button_submit = apply_filters( $this->product->get_key() . '_feedback_translate_button_do', 'Ok, I will gladly help.' );
		$button_cancel = apply_filters( $this->product->get_key() . '_feedback_translate_button_cancel', 'No, thanks.' );

		$all_notifications[] = [
			'id'      => $this->product->get_key() . '_translate_flag',
			'heading' => $heading,
			'message' => $message,
			'ctas'    => [
				'confirm' => [
					'link' => $link,
					'text' => $button_submit,
				],
				'cancel'  => [
					'link' => '#',
					'text' => $button_cancel,
				],
			],
		];

		return $all_notifications;
	}
461121
public function precheck_notices($results) {
        $output = html_writer::start_tag('div', array('class' => 'restore-precheck-notices'));
        if (array_key_exists('errors', $results)) {
            foreach ($results['errors'] as $error) {
                $output .= $this->output->notification($error);
            }
        }
        if (array_key_exists('warnings', $results)) {
            foreach ($results['warnings'] as $warning) {
                $output .= $this->output->notification($warning, 'notifyproblem');
            }
        }
        return $output.html_writer::end_tag('div');
    }
14440
public function getTimeline(DataObject $member, $sortBy = 'ID',  $since = 0, $before = false, $topLevelOnly = true, $tags = array(), $offset = 0, $number = 10) {
		$following = $this->friendsList($member);

		// TODO Following points to a list of Profile IDs, NOT user ids.
		$number = (int) $number;
		$userIds = array();
		if ($following) {
			$userIds = $following->map('OtherID', 'OtherID');
			$userIds = $userIds->toArray();
		}

		$userIds[] = $member->ID;
		
		$filter = array(
			'OwnerID' => $userIds, 
		);
		
		return $this->microPostList($filter, $sortBy, $since, $before, $topLevelOnly, $tags, $offset, $number);
	}
989478
public function recordNotification(NotificationSent $event)
    {
        if (! Telescope::isRecording()) {
            return;
        }

        Telescope::recordNotification(IncomingEntry::make([
            'notification' => get_class($event->notification),
            'queued' => in_array(ShouldQueue::class, class_implements($event->notification)),
            'notifiable' => $this->formatNotifiable($event->notifiable),
            'channel' => $event->channel,
            'response' => $event->response,
        ])->tags($this->tags($event)));
    }
101208
public static function sendNotification(Notification $notification, $content = null)
    {
        $beforeSendCallback = $notification->beforeSendCallback();
        self::_performCallback($beforeSendCallback, $notification);

        if ($notification->locale() !== null) {
            I18n::locale($notification->locale());
        } else {
            I18n::locale(Configure::read('Notifications.defaultLocale'));
        }

        $notification->email()->send($content);

        $afterSendCallback = $notification->afterSendCallback();
        self::_performCallback($afterSendCallback);

        return $notification;
    }
123487
public function getAllCharges($myshopify, $token, $sinceId = null)
    {
        $this->setRequestPath($myshopify);

        if($sinceId != null && $this->chargeType == 'application_charge')
        {
            $url = $this->getChargeEndpoint(). '.json?since_id=' . $sinceId;
        }
        else $url = $this->getChargeEndpoint(). '.json';


        $response = $this->getHttpClient()->get($url,
        [
            'headers' => $this->getResponseHeaders($token)
        ]);

        return json_decode($response->getBody(), true);

    }
1089808
public function notify($interests, array $data, $debug = false)
    {
        $postData = [];

        if (is_string($interests)) {
            $interests = [$interests];
        }

        if (count($interests) == 0) {
            throw new ExpoException('Interests array must not be empty.');
        }

        // Gets the expo tokens for the interests
        $recipients = $this->registrar->getInterests($interests);

        foreach ($recipients as $token) {
            $postData[] = $data + ['to' => $token];
        }

        $ch = $this->prepareCurl();

        curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($postData));

        $response = $this->executeCurl($ch);

        // If the notification failed completely, throw an exception with the details
        if (!$debug && $this->failedCompletely($response, $interests)) {
            throw ExpoException::failedCompletelyException($response);
        }

        return $response;
    }