Automation/app/Libraries/MySocket/Cloudflare/AccountSocket.php
2024-09-20 19:51:36 +09:00

28 lines
574 B
PHP

<?php
namespace App\Libraries\MySocket\Cloudflare;
use App\Libraries\MySocket\CloudflareSocket;
class AccountSocket extends CloudflareSocket
{
public function __construct()
{
parent::__construct();
}
final public function create_process(string $name, string $type = "standard")
{
$datas = [
'name' => $name . "'s Account",
'type' => $type,
];
$result = $this->getClient()->post("accounts", $datas);
$result = json_decode($result->getBody());
if (!$result->success) {
throw new \Exception(var_export($result, true));
}
return $result;
}
}