add endpoint for server-side exclude setting
This commit is contained in:
@@ -9,9 +9,12 @@
|
|||||||
namespace Cloudflare\API\Endpoints;
|
namespace Cloudflare\API\Endpoints;
|
||||||
|
|
||||||
use Cloudflare\API\Adapter\Adapter;
|
use Cloudflare\API\Adapter\Adapter;
|
||||||
|
use Cloudflare\API\Traits\BodyAccessorTrait;
|
||||||
|
|
||||||
class ZoneSettings implements API
|
class ZoneSettings implements API
|
||||||
{
|
{
|
||||||
|
use BodyAccessorTrait;
|
||||||
|
|
||||||
private $adapter;
|
private $adapter;
|
||||||
|
|
||||||
public function __construct(Adapter $adapter)
|
public function __construct(Adapter $adapter)
|
||||||
@@ -75,6 +78,20 @@ class ZoneSettings implements API
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getServerSideExcludeSetting($zoneID)
|
||||||
|
{
|
||||||
|
$return = $this->adapter->get(
|
||||||
|
'zones/' . $zoneID . '/settings/server_side_exclude'
|
||||||
|
);
|
||||||
|
$body = json_decode($return->getBody());
|
||||||
|
|
||||||
|
if ($body->success) {
|
||||||
|
return $body->result->value;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public function getHotlinkProtectionSetting($zoneID)
|
public function getHotlinkProtectionSetting($zoneID)
|
||||||
{
|
{
|
||||||
$return = $this->adapter->get(
|
$return = $this->adapter->get(
|
||||||
@@ -177,4 +194,21 @@ class ZoneSettings implements API
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function updateServerSideExcludeSetting($zoneID, $value)
|
||||||
|
{
|
||||||
|
$return = $this->adapter->patch(
|
||||||
|
'zones/' . $zoneID . '/settings/server_side_exclude',
|
||||||
|
[
|
||||||
|
'value' => $value
|
||||||
|
]
|
||||||
|
);
|
||||||
|
$body = json_decode($return->getBody());
|
||||||
|
|
||||||
|
if ($body->success) {
|
||||||
|
return $body->result->value;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user