send('GET', "meetings/$id")); } /** * Updates the meeting on server. * * @param Client $client * * @throws Exception */ public function update($client) { $client->send('PATCH', 'meetings/'.$this->id, [], $this); } /** * Ends the meeting on server. * * @param Client $client * * @throws Exception */ public function endNow($client) { $client->send('PUT', "meetings/$this->id/status", [], (object) ['action' => 'end']); } /** * Deletes the meeting on server. * * @param Client $client * * @throws Exception */ public function delete($client) { $client->send('DELETE', "meetings/$this->id"); } /** * Adds a registrant to the meeting. * * @param Client $client * @param MeetingRegistrant $registrant with at least 'email' and 'first_name'. * 'last_name' will also be recorded by Zoom. * Other properties remain ignored, or not returned by Zoom * (at least while using profile "Pro") * @param string $occurrenceIds separated by comma * * @throws Exception * * @return CreatedRegistration with unique join_url and registrant_id properties */ public function addRegistrant($client, $registrant, $occurrenceIds = '') { return CreatedRegistration::fromJson( $client->send( 'POST', "meetings/$this->id/registrants", empty($occurrenceIds) ? [] : ['occurrence_ids' => $occurrenceIds], $registrant ) ); } /** * Removes registrants from the meeting. * * @param Client $client * @param MeetingRegistrant[] $registrants registrants to remove (id and email) * @param string $occurrenceIds separated by comma * * @throws Exception */ public function removeRegistrants($client, $registrants, $occurrenceIds = '') { if (!empty($registrants)) { $client->send( 'PUT', "meetings/$this->id/registrants/status", empty($occurrenceIds) ? [] : ['occurrence_ids' => $occurrenceIds], (object) [ 'action' => 'cancel', 'registrants' => $registrants, ] ); } } /** * Retrieves meeting registrants. * * @param Client $client * * @throws Exception * * @return MeetingRegistrantListItem[] the meeting registrants */ public function getRegistrants($client) { return MeetingRegistrantList::loadMeetingRegistrants($client, $this->id); } /** * Retrieves the meeting's instances. * * @param Client $client * * @throws Exception * * @return MeetingInstance[] */ public function getInstances($client) { return MeetingInstances::fromMeetingId($client, $this->id)->meetings; } }