<?php
|
|
namespace SamApiLib;
|
|
|
|
class Auth
|
|
{
|
|
|
|
private $sam_api;
|
|
|
|
|
|
function __construct(SamApi $sam_api)
|
|
{
|
|
$this->sam_api = $sam_api;
|
|
}
|
|
|
|
|
|
/**
|
|
* get all service accounts
|
|
* @return array[]|mixed[]
|
|
*/
|
|
public function serviceAccountList ()
|
|
{
|
|
$ws_route = "get /auth/serviceAccount/Index";
|
|
$url_params = [];
|
|
$query_params = [];
|
|
$body_params = [];
|
|
|
|
list($headers, $body) = $this->sam_api->query($ws_route, $url_params, $query_params, $body_params);
|
|
if(!empty($body))
|
|
return $body;
|
|
else
|
|
null;
|
|
}
|
|
|
|
|
|
/**
|
|
* get detail about a service account
|
|
* @param $serviceAccountId
|
|
* @return array[]|mixed[]
|
|
*/
|
|
public function serviceAccountDetail ($serviceAccountId)
|
|
{
|
|
$ws_route = "get /auth/serviceAccount/{serviceAccountId}";
|
|
$url_params = [
|
|
"serviceAccountId" => $serviceAccountId, // "SAM_rak3yb-dih2-lp6sua"
|
|
];
|
|
$query_params = [];
|
|
$body_params = [];
|
|
|
|
list($headers, $body) = $this->sam_api->query($ws_route, $url_params, $query_params, $body_params);
|
|
if(!empty($body))
|
|
return $body;
|
|
else
|
|
null;
|
|
}
|
|
|
|
}
|