<?php

namespace bird\classes;

require_once WD . '/modules/bird/interfaces/bird_flash_calls_client_i.php';
require_once WD . '/modules/bird/classes/bird_api_client.php';

use bird\interfaces\bird_flash_calls_client_i;

class bird_flash_calls_client extends bird_api_client implements bird_flash_calls_client_i
{
    public function createFlashCall(string $workspaceId, string $channelId, array $payload): array|object|null
    {
        return $this->post($this->birdFlashCallsBasePath($workspaceId, $channelId), $payload);
    }

    public function listFlashCalls(string $workspaceId, string $channelId, array $query = []): array|object|null
    {
        return $this->get($this->birdFlashCallsBasePath($workspaceId, $channelId), $query);
    }

    public function getFlashCall(string $workspaceId, string $channelId, string $callId): array|object|null
    {
        return $this->get($this->birdFlashCallPath($workspaceId, $channelId, $callId));
    }

    public function endFlashCall(string $workspaceId, string $channelId, string $callId, array $payload = []): array|object|null
    {
        return $this->post($this->birdFlashCallPath($workspaceId, $channelId, $callId), $payload);
    }

    public function hangupFlashCall(string $workspaceId, string $channelId, array $payload = []): array|object|null
    {
        return $this->post($this->birdFlashCallsHangupPath($workspaceId, $channelId), $payload);
    }
}
