List subscriptions.

@return JsonResponse
@Route("", name="messages_subscriptions")
197426
public function listAction()
    {
        $subscriptionManager = $this->get('phlexible_message.subscription_manager');

        $subscriptions = [];

        foreach ($subscriptionManager->findAll() as $subscription) {
            $subscriptions[] = [
                'id' => $subscription->getId(),
                'filterId' => $subscription->getFilter()->getId(),
                'filter' => $subscription->getFilter()->getTitle(),
                'handler' => $subscription->getHandler(),
            ];
        }

        return new JsonResponse($subscriptions);
    }
146939
public function getData()
    {
        $subscription = $this->subscriptionManager
            ->findOneBy(
                ['userId' => $this->tokenStorage->getToken()->getUser()->getId(), 'handler' => 'portlet']
            );

        if (!$subscription) {
            return [];
        }

        $filter = $subscription->getFilter();

        if (!$filter) {
            return [];
        }

        $messages = $this->messageManager->findByCriteria($filter->getCriteria(), ['createdAt' => 'DESC'], 20);

        $priorityList = $this->messageManager->getPriorityNames();
        $typeList = $this->messageManager->getTypeNames();

        $data = [];
        foreach ($messages as $message) {
            $subject = '';

            $i = 0;
            do {
                $subject .= ($i ? '<wbr />' : '').mb_substr($message->getSubject(), $i, $i + 30, 'UTF-8');
                $i += 30;
            } while ($i <= strlen($message->getSubject()));

            $data[] = [
                'id' => $message->getId(),
                'subject' => $subject,
                'time' => $message->getCreatedAt()->format('U'),
                'priority' => $priorityList[$message->getPriority()],
                'type' => $typeList[$message->getType()],
                'channel' => $message->getChannel(),
            ];
        }

        return $data;
    }
990865
public function index()
    {
        // flush filters if not ajax
        if (!request()->ajax()) {
            session()->forget('filtered');
            session()->forget('filter_fullname');
            session()->forget('filter_email');
            session()->forget('filter_cellphone');
        }

        // paginator
        $paginator = $this->getPaginator();

        // if pagination ajax
        if (request()->ajax()) {
            return response()->json(view('admin.accounts.clients.pagination')
                ->with('paginator', $paginator)
                ->render());
        }

        save_resource_url();

        return $this->view("titan::accounts.clients.index")->with('paginator', $paginator);
    }
161334
public function messagesSendAction(Request $request)
    {
        $query = $request->request->all();
        $messages = $this->om->findList('Claroline\PlannedNotificationBundle\Entity\Message', 'uuid', $query['messages']);
        $users = $this->om->findList('Claroline\CoreBundle\Entity\User', 'uuid', $query['users']);
        $this->manager->sendMessages($messages, $users);

        return new JsonResponse('success', 200);
    }
340696
def index
      @subscriptions = Subscription.all
  
      respond_to do |format|
        format.html # index.html.erb
        format.json { render json: @subscriptions }
      end
    end
811762
def list_subscriptions(self, target_id=None, ids=None, query_flags=None):
        
        query_parameters = {}
        if target_id is not None:
            query_parameters['targetId'] = self._serialize.query('target_id', target_id, 'str')
        if ids is not None:
            ids = ",".join(ids)
            query_parameters['ids'] = self._serialize.query('ids', ids, 'str')
        if query_flags is not None:
            query_parameters['queryFlags'] = self._serialize.query('query_flags', query_flags, 'str')
        response = self._send(http_method='GET',
                              location_id='70f911d6-abac-488c-85b3-a206bf57e165',
                              version='5.0-preview.1',
                              query_parameters=query_parameters)
        return self._deserialize('[NotificationSubscription]', self._unwrap_collection(response))
279273
public function listHostedServices()
    {
        $context = new HttpCallContext();
        $context->setMethod(Resources::HTTP_GET);
        $context->setPath($this->_getHostedServicePath());
        $context->addStatusCode(Resources::STATUS_OK);

        $response = $this->sendHttpContext($context);
        $serialized = $this->dataSerializer->unserialize($response->getBody());

        return ListHostedServicesResult::create($serialized);
    }
826553
public function checkSubscription()
    {
        if (!$this->subscriberSocket) {
            $this->subscriberSocket = $this->context->getSocket(\ZMQ::SOCKET_SUB);
            $this->subscriberSocket->connect($this->publisherPmSocketAddress);
            $this->subscriberSocket->setSockOpt(\ZMQ::SOCKOPT_SUBSCRIBE, "");
        }

        $this->subscriptionMessage = @json_decode($this->subscriberSocket->recv(\ZMQ::MODE_DONTWAIT), true);

        if (($this->subscriptionMessage !== false) && ($this->subscriptionMessage !== null)
            && (is_array($this->subscriptionMessage) === false)
        ) {
            throw new ProcessManagerException("Not correct param from ProcessManager to TerminatorPauseStander: "
                . serialize($this->subscriptionMessage));
        }

        if (isset($this->subscriptionMessage)) {
            $this->logger->info("Receive subscription message: " . serialize($this->subscriptionMessage));
            $this->resolveAction();
        }

        return null;
    }
584308
async def _get_subscriptions(self) -> Tuple[Set[Text], Text]:
        

        url, params = self._get_subscriptions_endpoint()

        get = self.session.get(url, params=params)

        async with get as r:
            await self._handle_fb_response(r)
            data = await r.json()

            for scope in data['data']:
                if scope['object'] == 'page':
                    return (
                        set(x['name'] for x in scope['fields']),
                        scope['callback_url'],
                    )

        return set(), ''
612193
public function index(MessageRequest $request)
    {

        if ($this->response->typeIs('json')) {
            $pageLimit = $request->input('pageLimit');
            $data      = $this->repository
                ->setPresenter(\Litepie\Message\Repositories\Presenter\MessageListPresenter::class)
                ->getDataTable($pageLimit);
            return $this->response
                ->data($data)
                ->output();
        }

        $messages = $this->repository->paginate();

        return $this->response->title(trans('message::message.names'))
            ->view('message::message.index', true)
            ->data(compact('messages'))
            ->output();

    }
35906
protected function getMessages() {
        if (!$this->_messages) {
            $this->_messages = new MessageList(
                $this->version,
                $this->solution['serviceSid'],
                $this->solution['sid']
            );
        }

        return $this->_messages;
    }
6388
public function postSubscribe()
    {
        $email = Binput::get('email');
        $subscriptions = Binput::get('subscriptions');
        $verified = app(Repository::class)->get('setting.skip_subscriber_verification');

        try {
            $subscription = execute(new SubscribeSubscriberCommand($email, $verified));
        } catch (ValidationException $e) {
            return cachet_redirect('status-page')
                ->withInput(Binput::all())
                ->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('cachet.subscriber.email.failure')))
                ->withErrors($e->getMessageBag());
        }

        if ($subscription->is_verified) {
            return cachet_redirect('status-page')->withSuccess(trans('cachet.subscriber.email.already-subscribed', ['email' => $email]));
        }

        return cachet_redirect('subscribe.manage', $subscription->verify_code)
            ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('cachet.subscriber.email.subscribed')));
    }
676172
public function ajaxGetVisits()
    {
        $data = Base::getVisitsRepository()->orderBy('created_at', 'desc')->take(300)->get(['url', 'browser', 'ip', 'created_at', 'country']);

        return \Response::json(array('data' => $data));
    }
1220450
public function subscribe()
    {
        $response = $this->client->post('/me/subscribed_apps');
        $decoded = $this->decodeResponse($response);

        return $decoded['success'];
    }
17924
public Observable<Page<SubscriptionMediaServiceInner>> listAsync() {
        return listWithServiceResponseAsync()
            .map(new Func1<ServiceResponse<Page<SubscriptionMediaServiceInner>>, Page<SubscriptionMediaServiceInner>>() {
                @Override
                public Page<SubscriptionMediaServiceInner> call(ServiceResponse<Page<SubscriptionMediaServiceInner>> response) {
                    return response.body();
                }
            });
    }
370738
def subscriptions(self):
        """"""
        if not hasattr(self, '_subscriptions'):
            subscriptions_resource = self.resource.subscriptions
            self._subscriptions = Subscriptions(
                subscriptions_resource, self.client)
        return self._subscriptions
1096376
public function listCurrentAccounts()
	{
		$link			= 'https://' . $this->subdomain . '.amocrm.ru/private/api/v2/json/accounts/current'; #$this->subdomain уже объявляли выше
		$out 			= $this->useCurl($link, false);
		$response = json_decode($out,true);
		return $response;
	}