73 lines
1.6 KiB
PHP
73 lines
1.6 KiB
PHP
<?php
|
|
|
|
namespace Hosterra\NetBox\Api\Extras;
|
|
|
|
use GuzzleHttp\Exception\GuzzleException;
|
|
use Hosterra\NetBox\Api\AbstractApi;
|
|
|
|
class ConfigContexts extends AbstractApi
|
|
{
|
|
/**
|
|
* @param array $params
|
|
* @return array
|
|
* @throws GuzzleException
|
|
*/
|
|
public function add(array $params = []): array
|
|
{
|
|
return $this->post("/extras/config-contexts/", $params);
|
|
}
|
|
|
|
/**
|
|
* @param int $id
|
|
* @param array $params
|
|
* @return bool
|
|
* @throws GuzzleException
|
|
*/
|
|
public function remove(int $id, array $params = []): bool
|
|
{
|
|
return $this->delete("/extras/config-contexts/" . $id . "/", $params);
|
|
}
|
|
|
|
/**
|
|
* @param int $id
|
|
* @param array $params
|
|
* @return array
|
|
* @throws GuzzleException
|
|
*/
|
|
public function edit(int $id, array $params = []): array
|
|
{
|
|
return $this->put("/extras/config-contexts/" . $id . "/", $params);
|
|
}
|
|
|
|
/**
|
|
* @param int $id
|
|
* @param array $params
|
|
* @return array
|
|
* @throws GuzzleException
|
|
*/
|
|
public function update(int $id, array $params = []): array
|
|
{
|
|
return $this->patch("/extras/config-contexts/" . $id . "/", $params);
|
|
}
|
|
|
|
/**
|
|
* @param array $params
|
|
* @return mixed
|
|
* @throws GuzzleException
|
|
*/
|
|
public function list(array $params = [])
|
|
{
|
|
return $this->get("/extras/config-contexts/", $params);
|
|
}
|
|
|
|
/**
|
|
* @param int $id
|
|
* @param array $params
|
|
* @return mixed
|
|
* @throws GuzzleException
|
|
*/
|
|
public function show(int $id, array $params = [])
|
|
{
|
|
return $this->get("/extras/config-contexts/" . $id . "/", $params);
|
|
}
|
|
}
|