diff --git a/src/Endpoints/DNSSEC.php b/src/Endpoints/DNSSEC.php new file mode 100644 index 0000000..02a91b5 --- /dev/null +++ b/src/Endpoints/DNSSEC.php @@ -0,0 +1,67 @@ +adapter = $adapter; + } + + /** + * @param string $zoneID + * @return \stdClass|null + */ + public function getDetails(string $zoneID): ?\stdClass + { + $dnssec = $this->adapter->get('zones/' . $zoneID . '/dnssec'); + $this->body = json_decode($dnssec->getBody()); + return $this->body->result; + } + + /** + * @param string $zoneID + * @return \stdClass|null + */ + public function enable(string $zoneID): ?\stdClass + { + $response = $this->adapter->patch('zones/' . $zoneID. '/dnssec', ['status' => 'active']); + $this->body = json_decode($response->getBody()); + return $this->body->result; + } + + /** + * @param string $zoneID + * @return \stdClass|null + */ + public function disable(string $zoneID): ?\stdClass + { + $response = $this->adapter->patch('zones/' . $zoneID. '/dnssec', ['status' => 'disabled']); + $this->body = json_decode($response->getBody()); + return $this->body->result; + } + + /** + * @param string $zoneID + * @return bool true if delete was successful + */ + public function delete(string $zoneID): bool + { + $dnssec = $this->adapter->delete('zones/' . $zoneID . '/dnssec'); + $this->body = json_decode($dnssec->getBody()); + return $this->body->success; + } +}