Skip to content

Commit

Permalink
Merge pull request #3 from v-empower/zeeshan-kaveem/upgradation
Browse files Browse the repository at this point in the history
SDK upgrade for Delete Contact, Delete Meetings, Delete Recordings, Get Single Recordings & archive Meetings.
  • Loading branch information
fareed069417 authored Feb 4, 2025
2 parents 2598a60 + e872cbe commit 7094ca5
Show file tree
Hide file tree
Showing 8 changed files with 153 additions and 5 deletions.
56 changes: 56 additions & 0 deletions src/MeetHourApp/Services/MHApiService.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,18 @@
use \GuzzleHttp\RequestOptions;
use MeetHourApp\Types\ScheduleMeeting;
use MeetHourApp\Types\AddContact;
use MeetHourApp\Types\DeleteContact;
use MeetHourApp\Types\ArchiveMeeting;
use MeetHourApp\Types\DeleteMeeting;
use MeetHourApp\Types\CompletedMeetings;
use MeetHourApp\Types\ContactsList;
use MeetHourApp\Types\EditContact;
use MeetHourApp\Types\EditMeeting;
use MeetHourApp\Types\GenerateJwt;
use MeetHourApp\Types\Login;
use MeetHourApp\Types\MissedMeetings;
use MeetHourApp\Types\GetSingleRecording;
use MeetHourApp\Types\DeleteRecording;
use MeetHourApp\Types\RecordingsList;
use MeetHourApp\Types\RefreshToken;
use MeetHourApp\Types\UpcomingMeetings;
Expand All @@ -38,16 +42,24 @@ private static function apiEndpointUrl(string $endpoint): string {
return self::BASE_URL . '/oauth/token';
case 'add_contact':
return self::BASE_URL . '/api/' . self::API_VERSION . '/customer/addcontact';
case 'delete_contact':
return self::BASE_URL . '/api/' . self::API_VERSION . '/customer/deletecontact';
case 'contacts_list':
return self::BASE_URL . '/api/' . self::API_VERSION . '/customer/contacts';
case 'schedule_meeting':
return self::BASE_URL . '/api/' . self::API_VERSION . '/meeting/schedulemeeting';
case 'delete_meeting':
return self::BASE_URL . '/api/' . self::API_VERSION . '/meeting/deletemeeting';
case 'get_jwt':
return self::BASE_URL . '/api/' . self::API_VERSION . '/getjwt';
case 'upcoming_meeting':
return self::BASE_URL . '/api/' . self::API_VERSION . '/meeting/upcomingmeetings';
case 'timezone':
return self::BASE_URL . '/api/' . self::API_VERSION . '/getTimezone';
case 'get_single_recording':
return self::BASE_URL . '/api/' . self::API_VERSION . '/customer/getsinglerecording';
case 'delete_recording':
return self::BASE_URL . '/api/' . self::API_VERSION . '/customer/deleterecording';
case 'recordings_list':
return self::BASE_URL . '/api/' . self::API_VERSION . '/customer/videorecordinglist';
case 'edit_meeting':
Expand Down Expand Up @@ -168,6 +180,17 @@ public static function addContact($token, AddContact $addContactObject) {
return self::postFetch($token, 'add_contact', $body);
}

/**
* deleteContact() : To delete contact in Meet Hour Database.
* @param string $token - access token to make API calls.
* @param DeleteContact $deleteContactObject - API call body.
* @return mixed response data that we get from API.
*/
public static function deleteContact($token, DeleteContact $deleteContactObject) {
$body = $deleteContactObject->prepare();
return self::postFetch($token, 'delete_contact', $body);
}

/**
* timezone() : To get all the timezones used in Meet Hour while Meeting is being Scheduled.
* @param string $token - access token to make API calls.
Expand Down Expand Up @@ -212,6 +235,18 @@ public static function scheduleMeeting($token, ScheduleMeeting $scheduleMeetingO
return self::postFetch($token, 'schedule_meeting', $body);
}

/**
* deleteMeeting() : To delete a meeting from Meet Hour Database.
* @param string $token - access token to make API calls.
* @param DeleteMeeting $deleteMeetingObject - API call body.
* @return mixed response data that we get from API.
*/
public static function deleteMeeting($token, DeleteMeeting $deleteMeetingObject)
{
$body = $deleteMeetingObject->prepare();
return self::postFetch($token, 'delete_meeting', $body);
}

/**
* upcomingMeetings() : Function to hit a Schedule Meeting API.
* @param string $token - access token to make API calls.
Expand Down Expand Up @@ -293,4 +328,25 @@ public static function recordingsList(string $token, RecordingsList $recordingsL
return self::postFetch($token, 'recordings_list', $body);
}

/**
* getSingleRecording() : To get single recording from Meet Hour Database.
* @param string $token - access token to make API calls.
* @param GetSingleRecording $getSingleRecordingObject - API call body.
* @return mixed response data that we get from API.
*/
public static function getSingleRecording($token, GetSingleRecording $getSingleRecordingObject) {
$body = $getSingleRecordingObject->prepare();
return self::postFetch($token, 'get_single_recording', $body);
}

/**
* deleteRecording() : To delete recording from Meet Hour Database.
* @param string $token - access token to make API calls.
* @param DeleteRecording $deleteRecordingObject - API call body.
* @return mixed response data that we get from API.
*/
public static function deleteRecording($token, DeleteRecording $deleteRecordingObject) {
$body = $deleteRecordingObject->prepare();
return self::postFetch($token, 'delete_recording', $body);
}
}
8 changes: 8 additions & 0 deletions src/MeetHourApp/Services/MHApiServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,14 @@
use MeetHourApp\Types\CompletedMeetings;
use MeetHourApp\Types\ContactsList;
use MeetHourApp\Types\EditContact;
use MeetHourApp\Types\DeleteContact;
use MeetHourApp\Types\EditMeeting;
use MeetHourApp\Types\GenerateJwt;
use MeetHourApp\Types\Login;
use MeetHourApp\Types\MissedMeetings;
use MeetHourApp\Types\DeleteRecording;
use MeetHourApp\Types\DeleteMeeting;
use MeetHourApp\Types\GetSingleRecording;
use MeetHourApp\Types\RecordingsList;
use MeetHourApp\Types\RefreshToken;
use MeetHourApp\Types\UpcomingMeetings;
Expand All @@ -34,14 +38,18 @@ public function register()
$this->app->singleton('MeetHourApp\/Types', ScheduleMeeting::class);
$this->app->singleton('MeetHourApp\/Types', Login::class);
$this->app->singleton('MeetHourApp\/Types', AddContact::class);
$this->app->singleton('MeetHourApp\/Types', DeleteContact::class);
$this->app->singleton('MeetHourApp\/Types', ArchiveMeeting::class);
$this->app->singleton('MeetHourApp\/Types', CompletedMeetings::class);
$this->app->singleton('MeetHourApp\/Types', DeleteMeeting::class);
$this->app->singleton('MeetHourApp\/Types', ContactsList::class);
$this->app->singleton('MeetHourApp\/Types', EditContact::class);
$this->app->singleton('MeetHourApp\/Types', EditMeeting::class);
$this->app->singleton('MeetHourApp\/Types', GenerateJwt::class);
$this->app->singleton('MeetHourApp\/Types', Login::class);
$this->app->singleton('MeetHourApp\/Types', MissedMeetings::class);
$this->app->singleton('MeetHourApp\/Types', GetSingleRecording::class);
$this->app->singleton('MeetHourApp\/Types', DeleteRecording::class);
$this->app->singleton('MeetHourApp\/Types', RecordingsList::class);
$this->app->singleton('MeetHourApp\/Types', RefreshToken::class);
$this->app->singleton('MeetHourApp\/Types', UpcomingMeetings::class);
Expand Down
8 changes: 4 additions & 4 deletions src/MeetHourApp/Types/ArchiveMeeting.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
namespace MeetHourApp\Types;

class ArchiveMeeting {
public string $id;
public function __construct(string $id) {
$this->id = $id;
public string $meeting_id;
public function __construct(string $meeting_id) {
$this->meeting_id = $meeting_id;
}
public function prepare() {
return [
"id" => $this->id
"meeting_id" => $this->meeting_id
];
}
}
20 changes: 20 additions & 0 deletions src/MeetHourApp/Types/DeleteContact.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php
namespace MeetHourApp\Types;
class DeleteContact {
public int $contact_id;

public function __construct(int $contact_id) {
$this->contact_id = $contact_id;
}
public function prepare() {
$deleteContactProperties = [
"contact_id" => $this->contact_id
];
foreach ($deleteContactProperties as $key => $value) {
if ($value === null) {
unset($deleteContactProperties[$key]);
}
}
return $deleteContactProperties;
}
}
20 changes: 20 additions & 0 deletions src/MeetHourApp/Types/DeleteMeeting.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php
namespace MeetHourApp\Types;
class DeleteMeeting {
public int $meeting_id;

public function __construct(int $meeting_id) {
$this->meeting_id = $meeting_id;
}
public function prepare() {
$deleteMeetingProperties = [
"meeting_id" => $this->meeting_id
];
foreach ($deleteMeetingProperties as $key => $value) {
if ($value === null) {
unset($deleteMeetingProperties[$key]);
}
}
return $deleteMeetingProperties;
}
}
20 changes: 20 additions & 0 deletions src/MeetHourApp/Types/DeleteRecording.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php
namespace MeetHourApp\Types;
class DeleteRecording {
public int $recording_id;

public function __construct(int $recording_id) {
$this->recording_id = $recording_id;
}
public function prepare() {
$deleteRecordingProperties = [
"recording_id" => $this->recording_id
];
foreach ($deleteRecordingProperties as $key => $value) {
if ($value === null) {
unset($deleteRecordingProperties[$key]);
}
}
return $deleteRecordingProperties;
}
}
20 changes: 20 additions & 0 deletions src/MeetHourApp/Types/GetSingleRecording.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php
namespace MeetHourApp\Types;
class GetSingleRecording {
public int $recording_id;

public function __construct(int $recording_id) {
$this->recording_id = $recording_id;
}
public function prepare() {
$getSingleRecordingProperties = [
"recording_id" => $this->recording_id
];
foreach ($getSingleRecordingProperties as $key => $value) {
if ($value === null) {
unset($getSingleRecordingProperties[$key]);
}
}
return $getSingleRecordingProperties;
}
}
6 changes: 5 additions & 1 deletion src/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,8 @@
require_once(__DIR__ .'/MeetHourApp/Types/ScheduleMeeting.php');
require_once(__DIR__ .'/MeetHourApp/Types/UpcomingMeetings.php');
require_once(__DIR__ .'/MeetHourApp/Types/MissedMeetings.php');
require_once(__DIR__ .'/MeetHourApp/Types/ViewMeeting.php');
require_once(__DIR__ .'/MeetHourApp/Types/ViewMeeting.php');
require_once(__DIR__ .'/MeetHourApp/Types/DeleteMeeting.php');
require_once(__DIR__ .'/MeetHourApp/Types/DeleteContact.php');
require_once(__DIR__ .'/MeetHourApp/Types/DeleteRecording.php');
require_once(__DIR__ .'/MeetHourApp/Types/GetSingleRecording.php');

0 comments on commit 7094ca5

Please sign in to comment.