Get a notification's board
@link https://trello.com/docs/api/notification/#get-1-notifications-idnotification-board

@param string $id     the notification's id
@param array  $params optional parameters

@return array
436477
public function getBoard($id, array $params = array())
    {
        return $this->get($this->getPath().'/'.rawurlencode($id).'/board', $params);
    }
1327084
public function getShare(string $id, array $params = [])
    {
        if (isset($this->_objects[$id]) && !empty($this->_objects[$id])) {
            return $this->_objects[$id];
        } elseif (!isset($this->_definitions[$id])) {
            throw new \Exception('You have requested a non-existent id: ' . $id);
        } else {
            if ($this->has($id)) {
                $definition = $this->_definitions[$id];
            } else {
                throw new \Exception('获取的' . $id . '不存在');
            }

            $object = null;
            if (!empty($params)) {
                $definition['params'] = (array)$params;
            }
            if(is_string($definition)) {
                $class = $definition;
                $type = self::TYPE_DEFINITION_STRING;
            }else{
                $class = $definition['class'];
                $params = empty($definition['params']) ? [] : $definition['params'];
                $type = $definition['type'];
            }

            if ($type == self::TYPE_DEFINITION_CALLBACK) {
                $object = call_user_func($class, $params);

            } elseif ($type == self::TYPE_DEFINITION_OBJ) {
                $object = $class;

            } elseif ($type == self::TYPE_DEFINITION_STRING) {
                if (!class_exists($class)) {
                    throw new \Exception('类：' . $class . '不存在!');
                }

                $object = $this->build($class, $params);

            } else {
                throw new \Exception('Unexpected object definition type: ' . gettype($class));
            }
            $this->_objects[$id] = $object;
            return $object;
            //            return $this->get($id, $params);
        }
    }
250629
public function markThreadAsRead(int $id): array
    {
        return $this->getApi()->request($this->getApi()->sprintf('/notifications/threads/:id', (string)$id),
            Request::METHOD_PATCH);
    }
614393
public function create($params = [])
    {
        if (!array_key_exists('event_types', $params)) {
            $params['event_types'] = [[
                'name' => '*',
            ]];
        }

        return $this->gateway->commit('post', $this->gateway->buildUrlFromString('notifications/webhooks'), $params);
    }
1331371
public function get($id, $params = null)
    {
        $id = (int)$id;
        if ($id <= 0) {
            throw new Exception('Invalid param id');
        }
        return $this->rest->get("$this->action/$id", $params);
    }
9061
private function _get_id(string $request, $params): ?string
  {
    if ( $this->check() ){
      if ( $params ){
        return $this->db->select_one('bbn_observers', 'id', [
          'id_string' => $this->_get_id_string($request, $params)
        ]);
      }
      return $this->db->get_one("
        SELECT id
        FROM bbn_observers
        WHERE `request` LIKE ?
        AND `params` IS NULL
        AND `public` = 1",
        $request);
    }
    return null;
  }
549833
public function preview($id)
    {
        $item = app(StackRepository::class)->fetchOne((int) $id)->firstOrFail();

        if (in_array($item->notification->type->name, ['email', 'sms'])) {
            $classname    = $item->notification->type->name === 'email' ? EmailNotification::class : SmsNotification::class;
            $notification = app($classname);
            $notification->setModel($item);
            return view('antares/notifications::admin.logs.preview', ['content' => $notification->render()]);
        }

        $decorator = app(SidebarItemDecorator::class);
        $decorated = $decorator->item($item, config('antares/notifications::templates.notification'));
        return new JsonResponse(['content' => $decorated], 200);
    }
1225766
public function show($id)
    {
        $messageBoard = $this->client->get(
            sprintf('buckets/%d/message_boards/%d.json', $this->bucket, $id)
        );

        return new MessageBoard($this->response($messageBoard));
    }
542117
public function notificationAction($id)
    {
        /** @var PostInterface $post */
        $post = $this->get('opifer.form.post_manager')->getRepository()->find($id);

        if (!$post) {
            return $this->createNotFoundException();
        }

        $form = $post->getForm();

        /** @var Mailer $mailer */
        $mailer = $this->get('opifer.form.mailer');
        $mailer->sendNotificationMail($form, $post);

        $this->addFlash('success', 'Notification mail sent successfully');

        return $this->redirectToRoute('opifer_form_post_index', ['formId' => $form->getId()]);
    }
1234787
public function getNotifications($id = null, $userId = null, $userRole = null) {
		$fields = [
			$this->alias . '.id',
			$this->alias . '.user_id',
			$this->alias . '.user_role',
			$this->alias . '.tag',
			$this->alias . '.title',
			$this->alias . '.body',
			$this->alias . '.data',
		];
		$conditions = [
			'AND' => [
				$this->alias . '.expires >=' => date('Y-m-d H:i:s'),
				'OR' => [
					[
						'AND' => [
							$this->alias . '.user_id' => '',
							$this->alias . '.user_role' => '',
						]
					]
				]
			]
		];
		if (!empty($id)) {
			$conditions['AND'][][$this->alias . '.id >'] = (int)$id;
		}
		if (!empty($userId)) {
			$conditions['AND']['OR'][][$this->alias . '.user_id'] = (int)$userId;
		}
		if (!empty($userRole)) {
			$conditions['AND']['OR'][]['AND'] = [
				$this->alias . '.user_role & ' . (int)$userRole . ' > 0',
				$this->alias . '.user_id' => '',
			];
		}

		$order = [$this->alias . '.id' => 'asc'];

		return $this->find('all', compact('fields', 'conditions', 'order'));
	}
48329
public function actionRnr($id)
    {
        $notification = $this->actionRead($id);
        return $this->redirect(Url::to($notification->getRoute()));
    }
177230
public function find($id, array $options = [])
    {
        $topic = Arr::get($options, 'topic');

        if ($topic == 'payment') {
            $response = $this->gateway->commit('get', $this->gateway->buildUrlFromString('collections/notifications').'/'.$id);

            if (!$response->success()) {
                return $response;
            }

            $responseData = $response->data();

            $id = Arr::get($responseData, 'merchant_order_id');
        }

        return $this->gateway->commit('get', $this->gateway->buildUrlFromString('merchant_orders').'/'.$id, [], $options);
    }
479585
public function notification($method, array $params = null)
    {
        return $this->createRequest(RequestInterface::NOTIFICATION, array_filter([
            'jsonrpc' => self::SPEC,
            'method' => $method,
            'params' => $params,
        ]));
    }
216864
public static function findOrFail($id, array $params = [])
    {
        $instance = new static([], static::getParentID());

        // Make request
        if (!is_null($result = $instance->request($instance->getEndpoint(), 'find', [$id, $params]))) {
            return $result;
        }

        // Not found
        throw new NotFoundException;
    }
166912
public function update($id, array $params)
    {
        $defaults = [
            'id' => $id,
            'subject' => null,
            'notes' => null,
            'private_notes' => false,
            'category_id' => null,
            'priority_id' => null,
            'status_id' => null,
            'tracker_id' => null,
            'assigned_to_id' => null,
            'due_date' => null,
        ];
        $params = $this->cleanParams($params);
        $params = $this->sanitizeParams($defaults, $params);

        $xml = $this->buildXML($params);

        return $this->put('/issues/'.$id.'.xml', $xml->asXML());
    }
269372
public function get_notifications( $queue_id ) {

		$all = get_option( $this->bucket, array() );

		if ( isset( $all[ $queue_id ]['notifications'] ) ) {
			return $all[ $queue_id ]['notifications'];
		} else {
			return null;
		}
	}
1278887
public function downloadPreview(string $id, array $params = [])
    {
        return $this->executeRequest(
            RequestMethodEnum::GET,
            ResourceMethodEnum::DOWNLOAD_PREVIEW,
            $params,
            $id
        );
    }