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

72 lines
1.5 KiB
PHP
Raw Permalink Normal View History

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