Skip to content

Commit

Permalink
Add Class for IPAM > ASN
Browse files Browse the repository at this point in the history
  • Loading branch information
hexa2k9 committed Feb 15, 2023
1 parent e4aff09 commit 0d1b523
Showing 1 changed file with 73 additions and 0 deletions.
73 changes: 73 additions & 0 deletions src/Api/IPAM/Asns.php
Original file line number Diff line number Diff line change
@@ -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);
}
}

0 comments on commit 0d1b523

Please sign in to comment.