Skip to content

Commit

Permalink
Add Recordings
Browse files Browse the repository at this point in the history
Add recordings for users and meetings
  • Loading branch information
colinhall17 committed Jul 16, 2020
1 parent 5bc4c01 commit 19ae744
Show file tree
Hide file tree
Showing 7 changed files with 94 additions and 28 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

All notable changes to `laravel-zoom` will be documented in this file

## 2.0.9 - 2020-07-16

Added get user and meeting recordings

## 2.0.1 - 2.0.8 - Small bug fixes

## 2.0.0 - 2020-05-27

Updated version for Laravel 5.5 - 5.8
Expand Down
41 changes: 23 additions & 18 deletions src/Meeting.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class Meeting extends Model
{
protected $insertResource = 'MacsiDigital\Zoom\Requests\StoreMeeting';
protected $updateResource = 'MacsiDigital\Zoom\Requests\UpdateMeeting';

protected $endPoint = 'meetings';

protected $customEndPoints = [
Expand All @@ -20,66 +20,71 @@ class Meeting extends Model

protected $apiDataField = '';

protected $apiMultipleDataField = 'meetings';
protected $apiMultipleDataField = 'meetings';

protected $dates = [
'start_time',
'created_at'
];

public function settings()
public function settings()
{
return $this->hasOne(MeetingSetting::class);
}

public function recurrence()
public function recurrence()
{
return $this->hasOne(Recurrence::class);
}

public function occurrences()
public function occurrences()
{
return $this->hasMany(MeetingOccurrence::class);
}

public function registrants()
public function registrants()
{
return $this->hasMany(MeetingRegistrant::class);
}

public function polls()
public function polls()
{
return $this->hasMany(Poll::class);
return $this->hasMany(Poll::class);
}

public function registrationQuestions()
public function registrationQuestions()
{
return $this->hasMany(RegistrationQuestion::class);
return $this->hasMany(RegistrationQuestion::class);
}

public function invitation()
public function invitation()
{
return $this->hasOne(Invitation::class);
return $this->hasOne(Invitation::class);
}

public function liveStream()
public function liveStream()
{
return $this->hasOne(LiveStream::class);
return $this->hasOne(LiveStream::class);
}

public function trackingFields()
public function trackingFields()
{
return $this->hasMany(TrackingField::class);
return $this->hasMany(TrackingField::class);
}

public function recording()
{
return $this->hasOne(MeetingRecording::class);
}

public function delete($scheduleForReminder=true)
{
return $this->newQuery()->addQuery('schedule_for_reminder', $scheduleForReminder)->delete();
}

public function endMeeting()
public function endMeeting()
{
return $this->newQuery()->sendRequest('put', ['meetings/'.$this->id.'/status', ['action' => 'end']])->successful();
}

}
24 changes: 24 additions & 0 deletions src/MeetingRecording.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

namespace MacsiDigital\Zoom;

use MacsiDigital\Zoom\Support\Model;

class MeetingRecording extends Model
{
protected $customEndPoints = [
'get' => 'meetings/{meeting:id}/recordings'
];

protected $allowedMethods = ['get'];

public function recordingFiles()
{
return $this->hasMany(RecordingFile::class);
}

public function recordingPasswordRequirement()
{
return $this->hasOne(RecordingPasswordRequirement::class);
}
}
19 changes: 16 additions & 3 deletions src/Recording.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,24 @@

namespace MacsiDigital\Zoom;

use MacsiDigital\API\Support\Resource;
use MacsiDigital\Zoom\Support\Model;

class Recording extends Resource
class Recording extends Model
{
public function recordingPasswordRequirement()
protected $customEndPoints = [
'get' => 'users/{user:id}/recordings'
];

protected $allowedMethods = ['get'];

protected $apiMultipleDataField = 'meetings';

public function recordingFiles()
{
return $this->hasMany(RecordingFile::class);
}

public function recordingPasswordRequirement()
{
return $this->hasOne(RecordingPasswordRequirement::class);
}
Expand Down
13 changes: 13 additions & 0 deletions src/RecordingFile.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace MacsiDigital\Zoom;

use MacsiDigital\Zoom\Support\Model;

class RecordingFile extends Model
{
public function recording()
{
return $this->belongsTo(Recording::class);
}
}
2 changes: 1 addition & 1 deletion src/RecordingPasswordRequirement.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@

class RecordingPasswordRequirement extends Resource
{

}
17 changes: 11 additions & 6 deletions src/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class User extends Model
'action' => 'create',
'type' => 1
];

protected $endPoint = 'users';

protected $allowedMethods = ['find', 'get', 'post', 'patch', 'delete'];
Expand All @@ -23,19 +23,19 @@ class User extends Model

protected $apiMultipleDataField = 'users';

public function isBasicType()
public function isBasicType()
{
$this->type = 1;
return $this;
}

public function isLicensedType()
public function isLicensedType()
{
$this->type = 2;
return $this;
}

public function isOnPremType()
public function isOnPremType()
{
$this->type = 3;
return $this;
Expand Down Expand Up @@ -71,6 +71,11 @@ public function meetings()
return $this->hasMany(Meeting::class);
}

public function recordings()
{
return $this->hasMany(Recording::class);
}

public function webinars()
{
return $this->hasMany(Webinar::class);
Expand Down Expand Up @@ -136,7 +141,7 @@ public function disassociate()

public function delete()
{
return $this->newQuery()->sendRequest('delete', ['users/'.$this->id, ['action' => 'delete']])->successful();
return $this->newQuery()->sendRequest('delete', ['users/'.$this->id, ['action' => 'delete']])->successful();
}

}

0 comments on commit 19ae744

Please sign in to comment.