Skip to content

Commit

Permalink
feat: added new enties and updated composer
Browse files Browse the repository at this point in the history
  • Loading branch information
petrealessio committed Sep 20, 2024
1 parent a379319 commit 11fb027
Show file tree
Hide file tree
Showing 33 changed files with 3,838 additions and 1,311 deletions.
2,884 changes: 1,573 additions & 1,311 deletions composer.lock

Large diffs are not rendered by default.

48 changes: 48 additions & 0 deletions src/Api/Meetings/MeetingChats.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?php

namespace Offlineagency\LaravelWebex\Api\Meetings;

use Offlineagency\LaravelWebex\Api\AbstractApi;
use Offlineagency\LaravelWebex\Entities\Error;
use Offlineagency\LaravelWebex\Entities\Meetings\MeetingChats as MeetingChatsEntity;

class MeetingChats extends AbstractApi
{
public function listChats(
string $meetingId,
?array $additional_data = []
) {
$additional_data = $this->data($additional_data, [
'max', 'offset'
]);

$response = $this->get('meetings/postMeetingChats', array_merge([
'meeting_Id' => $meetingId
], $additional_data));

if (! $response->success) {
return new Error($response->data);
}

$meetings = $response->data;

return array_map(function ($meeting) {
return new MeetingChatsEntity($meeting);
}, $meetings->items);
}

public function destroyChats(
string $meeting_id
) {

$response = $this->delete('meetings/postMeetingChats'.$meeting_id, [
'meeting_Id' => $meeting_id
]);

if (! $response->success) {
return new Error($response->data);
}

return 'Meeting chats deleted';
}
}
67 changes: 67 additions & 0 deletions src/Api/Meetings/MeetingClosedCaptions.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?php

namespace Offlineagency\LaravelWebex\Api\Meetings;

use Offlineagency\LaravelWebex\Api\AbstractApi;
use Offlineagency\LaravelWebex\Entities\Error;
use Offlineagency\LaravelWebex\Entities\Meetings\MeetingClosedCaptions as MeetingClosedCaptionsEntity;

class MeetingClosedCaptions extends AbstractApi
{
public function listClosedCaptions(
string $meetingId
) {
$response = $this->get('meetingClosedCaptions', [
'meetingId' => $meetingId,
]);

if (! $response->success) {
return new Error($response->data);
}

$meeting_invitees = $response->data;

return array_map(function ($meeting_invitee) {
return new MeetingClosedCaptionsEntity($meeting_invitee);
}, $meeting_invitees->items);
}

public function listClosedCaptionSnippets(
string $closedCaptionId,
string $meetingId
) {
$response = $this->get('meetingClosedCaptions/'.$closedCaptionId.'/snippets', [
'meetingId' => $meetingId,
]);

if (! $response->success) {
return new Error($response->data);
}

$meeting_invitees = $response->data;

return array_map(function ($meeting_invitee) {
return new MeetingClosedCaptionsEntity($meeting_invitee);
}, $meeting_invitees->items);
}

public function downloadClosedCaptionSnippets(
string $closedCaptionId,
string $meetingId,
?array $additional_data = []
) {
$additional_data = $this->data($additional_data, [
'format'
]);

$response = $this->get('meetingClosedCaptions/'.$closedCaptionId.'/download', array_merge([
'meetingId' => $meetingId,
], $additional_data));

if (! $response->success) {
return new Error($response->data);
}

return new MeetingClosedCaptionsEntity($response->data);
}
}
22 changes: 22 additions & 0 deletions src/Api/Meetings/MeetingMessages.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

namespace Offlineagency\LaravelWebex\Api\Meetings;

use Offlineagency\LaravelWebex\Api\AbstractApi;
use Offlineagency\LaravelWebex\Entities\Error;

class MeetingMessages extends AbstractApi
{

public function destroyMessage(
string $meetingMessageId
) {
$response = $this->delete('meeting/messages/'.$meetingMessageId, []);

if (! $response->success) {
return new Error($response->data);
}

return 'Meeting Message deleted';
}
}
72 changes: 72 additions & 0 deletions src/Api/Meetings/MeetingPolls.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<?php

namespace Offlineagency\LaravelWebex\Api\Meetings;

use Offlineagency\LaravelWebex\Api\AbstractApi;
use Offlineagency\LaravelWebex\Entities\Error;
use Offlineagency\LaravelWebex\Entities\Meetings\MeetingPolls as MeetingPollsEntity;

class MeetingPolls extends AbstractApi
{
public function listPolls(
string $meetingId
) {
$response = $this->get('meetings/polls', [
'meeting_Id' => $meetingId,
]);

if (! $response->success) {
return new Error($response->data);
}

$meetingPolls = $response->data;

return array_map(function ($meetingPolls) {
return new MeetingPollsEntity($meetingPolls);
}, $meetingPolls->items);
}

public function detailPollResults(
string $meetingId,
?array $additional_data = []
) {
$additional_data = $this->data($additional_data, [
'max'
]);

$response = $this->get('meetings/pollResults', array_merge([
'meetingId' => $meetingId,
], $additional_data));

if (! $response->success) {
return new Error($response->data);
}

return new MeetingPollsEntity($response->data);
}

public function listRespondentsQuestion(
string $pollId,
string $questionId,
string $meetingId,
?array $additional_data = []
) {
$additional_data = $this->data($additional_data, [
'max'
]);

$response = $this->get('meetings/polls/'.$pollId.'/questions/'.$questionId.'/respondents', array_merge([
'meetingId' => $meetingId,
], $additional_data));

if (! $response->success) {
return new Error($response->data);
}

$listRespondentsQuestion = $response->data;

return array_map(function ($listRespondentsQuestion) {
return new MeetingPollsEntity($listRespondentsQuestion);
}, $listRespondentsQuestion->items);
}
}
Loading

0 comments on commit 11fb027

Please sign in to comment.