Skip to content

Commit 64f7b3f

Browse files
committed
Recordings endpoint covered
1 parent 205842f commit 64f7b3f

File tree

3 files changed

+103
-2
lines changed

3 files changed

+103
-2
lines changed

src/Endpoint/Meetings.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,17 @@
44

55
use UDX\Zoom\Http\Request;
66

7+
/**
8+
* Class Meetings
9+
* @package UDX\Zoom\Endpoint
10+
*/
711
class Meetings extends Request {
812

13+
/**
14+
* Meetings constructor.
15+
* @param $apiKey
16+
* @param $apiSecret
17+
*/
918
public function __construct($apiKey, $apiSecret) {
1019
parent::__construct($apiKey, $apiSecret);
1120
}

src/Endpoint/Recordings.php

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
<?php
2+
3+
namespace UDX\Zoom\Endpoint;
4+
5+
use UDX\Zoom\Http\Request;
6+
7+
/**
8+
* Class Recordings
9+
* @package UDX\Zoom\Endpoint
10+
*/
11+
class Recordings extends Request {
12+
13+
/**
14+
* Recordings constructor.
15+
* @param $apiKey
16+
* @param $apiSecret
17+
*/
18+
public function __construct($apiKey, $apiSecret) {
19+
parent::__construct($apiKey, $apiSecret);
20+
}
21+
22+
/**
23+
* List
24+
*
25+
* @param $userId
26+
* @param array $query
27+
* @return array|mixed
28+
*/
29+
public function listAll(string $userId, array $query = []) {
30+
return $this->get("users/{$userId}/recordings", $query);
31+
}
32+
33+
/**
34+
* Meeting
35+
*
36+
* @param $meetingId
37+
* @return array|mixed
38+
*/
39+
public function meeting(string $meetingId) {
40+
return $this->get("meetings/{$meetingId}/recordings");
41+
}
42+
43+
/**
44+
* Remove All
45+
*
46+
* @param $meetingId
47+
* @param array $query
48+
* @return array|mixed
49+
*/
50+
public function removeAll(string $meetingId, array $query = [ 'action' => 'trash' ]) {
51+
return $this->delete("meetings/{$meetingId}/recordings", $query);
52+
}
53+
54+
/**
55+
* Remove
56+
*
57+
* @param $meetingId
58+
* @param $recordingId
59+
* @param array $query
60+
* @return array|mixed
61+
*/
62+
public function remove(string $meetingId, string $recordingId, array $query = [ 'action' => 'trash' ]) {
63+
return $this->delete("meetings/{$meetingId}/recordings/{$recordingId}", $query);
64+
}
65+
66+
/**
67+
* Recover All
68+
*
69+
* @param $meetingId
70+
* @param array $data
71+
* @return array|mixed
72+
*/
73+
public function recoverAll(string $meetingId, array $data = [ 'action' => 'recover' ]) {
74+
return $this->put("meetings/{$meetingId}/recordings/status", $data);
75+
}
76+
77+
/**
78+
* Recover
79+
*
80+
* @param $meetingId
81+
* @param $recordingId
82+
* @param array $data
83+
* @return array|mixed
84+
*/
85+
public function recover(string $meetingId, string $recordingId, array $data = [ 'action' => 'recover' ]) {
86+
return $this->put("meetings/{$meetingId}/recordings/{$recordingId}/status", $data);
87+
}
88+
89+
}

src/Http/Request.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,12 +162,15 @@ protected function put($method, $fields) {
162162
* Delete
163163
*
164164
* @param $method
165+
* @param $fields
165166
* @return array|mixed
166167
*/
167-
protected function delete($method) {
168+
protected function delete($method, $fields) {
169+
$body = \json_encode($fields, JSON_PRETTY_PRINT);
170+
168171
try {
169172
$response = $this->client->request('DELETE', $this->apiPoint . $method,
170-
[ 'headers' => $this->headers()]);
173+
['body' => $body, 'headers' => $this->headers()]);
171174

172175
return $this->result($response);
173176

0 commit comments

Comments
 (0)