netbox-php/src/Api/Tenancy/TenantGroups.php

73 lines
1.6 KiB
PHP
Raw Normal View History

2021-03-12 17:20:32 -04:00
<?php
2024-02-12 10:46:19 +01:00
namespace Hosterra\NetBox\Api\Tenancy;
2021-03-12 17:20:32 -04:00
2022-05-31 12:56:36 +02:00
use GuzzleHttp\Exception\GuzzleException;
2024-02-12 10:46:19 +01:00
use Hosterra\NetBox\Api\AbstractApi;
class TenantGroups extends AbstractApi
2021-03-12 17:20:32 -04:00
{
/**
2022-05-31 12:56:36 +02:00
* @param array $params
* @return array
* @throws GuzzleException
2021-03-12 17:20:32 -04:00
*/
2022-05-31 12:56:36 +02:00
public function add(array $params = []): array
2021-03-12 17:20:32 -04:00
{
return $this->post("/tenancy/tenant-groups/", $params);
2021-03-12 17:20:32 -04:00
}
/**
2022-05-31 12:56:36 +02:00
* @param int $id
* @param array $params
* @return bool
* @throws GuzzleException
2021-03-12 17:20:32 -04:00
*/
2022-05-31 12:56:36 +02:00
public function remove(int $id, array $params = []): bool
2021-03-12 17:20:32 -04:00
{
2022-05-31 12:56:36 +02:00
return $this->delete("/tenancy/tenant-groups/" . $id . "/", $params);
2021-03-12 17:20:32 -04:00
}
/**
2022-05-31 12:56:36 +02:00
* @param int $id
* @param array $params
* @return array
* @throws GuzzleException
2021-03-12 17:20:32 -04:00
*/
2022-05-31 12:56:36 +02:00
public function edit(int $id, array $params = []): array
2021-03-12 17:20:32 -04:00
{
2022-05-31 12:56:36 +02:00
return $this->put("/tenancy/tenant-groups/" . $id . "/", $params);
2021-03-12 17:20:32 -04:00
}
/**
* @param int $id
* @param array $params
* @return array
* @throws GuzzleException
*/
public function update(int $id, array $params = []): array
{
return $this->patch("/tenancy/tenant-groups/" . $id . "/", $params);
}
2021-03-12 17:20:32 -04:00
/**
2022-05-31 12:56:36 +02:00
* @param array $params
2021-03-12 17:20:32 -04:00
* @return mixed
2022-05-31 12:56:36 +02:00
* @throws GuzzleException
2021-03-12 17:20:32 -04:00
*/
2022-05-31 12:56:36 +02:00
public function list(array $params = [])
2021-03-12 17:20:32 -04:00
{
return $this->get("/tenancy/tenant-groups/", $params);
2021-03-12 17:20:32 -04:00
}
/**
2022-05-31 12:56:36 +02:00
* @param int $id
* @param array $params
2021-03-12 17:20:32 -04:00
* @return mixed
2022-05-31 12:56:36 +02:00
* @throws GuzzleException
2021-03-12 17:20:32 -04:00
*/
2022-05-31 12:56:36 +02:00
public function show(int $id, array $params = [])
2021-03-12 17:20:32 -04:00
{
2022-05-31 12:56:36 +02:00
return $this->get("/tenancy/tenant-groups/" . $id . "/", $params);
2021-03-12 17:20:32 -04:00
}
}