Adds missing endpoints

This commit is contained in:
Pierre Lannoy 2024-02-12 11:27:28 +01:00
commit 9e323171fd
Signed by: Pierre Lannoy
GPG key ID: D27231EF87D53F31
8 changed files with 451 additions and 3 deletions

View file

@ -0,0 +1,73 @@
<?php
namespace Hosterra\NetBox\Api\Tenancy;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class ContactGroups extends AbstractApi
{
/**
* @param array $params
* @return array
* @throws GuzzleException
*/
public function add(array $params = []): array
{
return $this->post("/tenancy/contact-groups/", $params);
}
/**
* @param int $id
* @param array $params
* @return bool
* @throws GuzzleException
*/
public function remove(int $id, array $params = []): bool
{
return $this->delete("/tenancy/contact-groups/" . $id . "/", $params);
}
/**
* @param int $id
* @param array $params
* @return array
* @throws GuzzleException
*/
public function edit(int $id, array $params = []): array
{
return $this->put("/tenancy/contact-groups/" . $id . "/", $params);
}
/**
* @param int $id
* @param array $params
* @return array
* @throws GuzzleException
*/
public function update(int $id, array $params = []): array
{
return $this->patch("/tenancy/contact-groups/" . $id . "/", $params);
}
/**
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function list(array $params = [])
{
return $this->get("/tenancy/contact-groups/", $params);
}
/**
* @param int $id
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function show(int $id, array $params = [])
{
return $this->get("/tenancy/contact-groups/" . $id . "/", $params);
}
}