Add Class for IPAM > ASN

This commit is contained in:
Christian Bönning 2023-02-15 18:18:56 +01:00
commit 0d1b5231ae
No known key found for this signature in database

73
src/Api/IPAM/Asns.php Normal file
View file

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