1 | <?php |
||
14 | class Messenger |
||
15 | { |
||
16 | |||
17 | const API_URL = 'https://graph.facebook.com/'; |
||
18 | const API_VERSION = 'v2.8'; |
||
19 | |||
20 | /** |
||
21 | * @var string |
||
22 | */ |
||
23 | protected $appSecret; |
||
24 | |||
25 | /** |
||
26 | * @var string |
||
27 | */ |
||
28 | protected $verifyToken; |
||
29 | |||
30 | /** |
||
31 | * @var string |
||
32 | */ |
||
33 | protected $pageToken; |
||
34 | |||
35 | /** |
||
36 | * @var \GuzzleHttp\ClientInterface |
||
37 | */ |
||
38 | protected $client; |
||
39 | |||
40 | /** |
||
41 | * @var \Kerox\Messenger\Api\Send |
||
42 | */ |
||
43 | protected $sendApi; |
||
44 | |||
45 | /** |
||
46 | * @var \Kerox\Messenger\Api\Webhook |
||
47 | */ |
||
48 | protected $webhookApi; |
||
49 | |||
50 | /** |
||
51 | * @var \Kerox\Messenger\Api\User |
||
52 | */ |
||
53 | protected $userApi; |
||
54 | |||
55 | /** |
||
56 | * @var \Kerox\Messenger\Api\Thread |
||
57 | */ |
||
58 | protected $threadApi; |
||
59 | |||
60 | /** |
||
61 | * @var \Kerox\Messenger\Api\Code |
||
62 | */ |
||
63 | protected $codeApi; |
||
64 | |||
65 | /** |
||
66 | * @var \Kerox\Messenger\Api\Insights |
||
67 | */ |
||
68 | protected $insightsApi; |
||
69 | |||
70 | /** |
||
71 | * Messenger constructor. |
||
72 | * |
||
73 | * @param string $appSecret |
||
74 | * @param string $verifyToken |
||
75 | * @param string $pageToken |
||
76 | * @param \GuzzleHttp\ClientInterface $client |
||
77 | */ |
||
78 | 1 | public function __construct(string $appSecret, string $verifyToken, string $pageToken, ClientInterface $client = null) |
|
91 | |||
92 | /** |
||
93 | * @return \Kerox\Messenger\Api\Send |
||
94 | */ |
||
95 | 1 | public function send(): Send |
|
103 | |||
104 | /** |
||
105 | * @param \Psr\Http\Message\ServerRequestInterface $request |
||
106 | * @return \Kerox\Messenger\Api\Webhook |
||
107 | */ |
||
108 | 1 | public function webhook(ServerRequestInterface $request = null): Webhook |
|
116 | |||
117 | /** |
||
118 | * @return \Kerox\Messenger\Api\User |
||
119 | */ |
||
120 | 1 | public function user(): User |
|
128 | |||
129 | /** |
||
130 | * @return \Kerox\Messenger\Api\Thread |
||
131 | */ |
||
132 | 1 | public function thread(): Thread |
|
140 | |||
141 | /** |
||
142 | * @return \Kerox\Messenger\Api\Code |
||
143 | */ |
||
144 | 1 | public function code(): Code |
|
152 | |||
153 | 1 | public function insights(): Insights |
|
161 | } |
||
162 |