This commit is contained in:
Kyle Yee
2019-12-16 17:55:48 +08:00
parent b54c3481a3
commit b9051fc1f2
2 changed files with 17 additions and 8 deletions

View File

@@ -61,14 +61,14 @@ class Accounts implements API
public function lockDomain(string $accountID, string $domainName): \stdClass
{
$response = $this->adapter->put('accounts/' . $accountID . '/registrar/domains/' . $domainName, ["locked" => true]);
$response = $this->adapter->put('accounts/' . $accountID . '/registrar/domains/' . $domainName, ['locked' => true]);
$this->body = json_decode($response->getBody());
return $this->body;
}
public function unlockDomain(string $accountID, string $domainName): \stdClass
{
$response = $this->adapter->put('accounts/' . $accountID . '/registrar/domains/' . $domainName, ["locked" => false]);
$response = $this->adapter->put('accounts/' . $accountID . '/registrar/domains/' . $domainName, ['locked' => false]);
$this->body = json_decode($response->getBody());
return $this->body;
}

View File

@@ -58,12 +58,9 @@ class Zones implements API
return false;
}
public function pause(string $zoneID, bool $paused = true): bool
public function pause(string $zoneID): bool
{
$options = [
'paused' => $paused,
];
$user = $this->adapter->patch('zones/' . $zoneID, $options);
$user = $this->adapter->patch('zones/' . $zoneID, ['paused' => true]);
$this->body = json_decode($user->getBody());
if (isset($this->body->result->id)) {
@@ -72,7 +69,19 @@ class Zones implements API
return false;
}
public function unpause(string $zoneID): bool
{
$user = $this->adapter->patch('zones/' . $zoneID, ['paused' => false]);
$this->body = json_decode($user->getBody());
if (isset($this->body->result->id)) {
return true;
}
return false;
}
public function getZoneById(
string $zoneId
): \stdClass {