1 | <?php |
||
27 | class Controller |
||
28 | { |
||
29 | /** |
||
30 | * @var CloudManagerInterface |
||
31 | */ |
||
32 | private $cloudManager; |
||
33 | |||
34 | /** |
||
35 | * @var EventDispatcherInterface |
||
36 | */ |
||
37 | private $eventDispatcher; |
||
38 | |||
39 | /** |
||
40 | * @param CloudManagerInterface $cloudManager |
||
41 | * @param EventDispatcherInterface $eventDispatcher |
||
42 | */ |
||
43 | public function __construct(CloudManagerInterface $cloudManager, EventDispatcherInterface $eventDispatcher) |
||
48 | |||
49 | /** |
||
50 | * Sign a set of given url parameters and return them as a JSON object. |
||
51 | * |
||
52 | * Specials keys are <em>method</em> and <em>path</em>. <em>method</em> is |
||
53 | * the http method and <em>path</em> the url part of the api request for |
||
54 | * which the signature is generated. The default <em>method</em> if not |
||
55 | * given is <em>GET</em>, the default <em>path</em> is <em>/videos.json</em>. |
||
56 | * All remaining url parameters are treated as parameters for the api |
||
57 | * request. |
||
58 | * |
||
59 | * @param string $cloud Cloud to use for performing API requests |
||
60 | * @param Request $request The current request |
||
61 | * |
||
62 | * @return JsonResponse The response |
||
63 | */ |
||
64 | public function signAction($cloud, Request $request) |
||
89 | |||
90 | /** |
||
91 | * Authorize a file upload. |
||
92 | * |
||
93 | * The name of the file to upload and its size are passed as POST parameters. |
||
94 | * The response contains a JSON encoded object. It includes a property |
||
95 | * upload_url to which the caller should send its video file. |
||
96 | * |
||
97 | * @param string $cloud Cloud to use for performing API requests |
||
98 | * @param Request $request The current request |
||
99 | * |
||
100 | * @return JsonResponse The response |
||
101 | */ |
||
102 | public function authoriseUploadAction($cloud, Request $request) |
||
116 | |||
117 | /** |
||
118 | * Endpoint for notification requests. |
||
119 | * |
||
120 | * @param Request $request The current request |
||
121 | * |
||
122 | * @return Response An empty response with status code 200 |
||
123 | */ |
||
124 | public function notifyAction(Request $request) |
||
135 | } |
||
136 |