\OpenResourceManager\ClientServiceAccount

ORM Service Account Client

Communicates with an ORM API to preform service account operations.

Summary

Methods
Properties
Constants
__construct()
getORM()
getPage()
setPage()
addPage()
subPage()
getList()
get()
delete()
deleteFromIdentifier()
deleteFromUsername()
getFromUsername()
getFromIdentifier()
store()
No public properties found
No constants found
urlFromRoute()
_get()
_post()
_patch()
_del()
getFromCode()
deleteFromCode()
$baseURL
$route
$page
$orm
$validCodes
N/A
No private methods found
No private properties found
N/A

Properties

$baseURL

$baseURL : null|array

Base API URL

Base API URL comprised of environment variables passed to the ORM constructor.

Type

null|array

$route

$route : string

Base Service Account Route

The base API route for the service account client.

Type

string

$page

$page : integer

Results Page

The page of results to get.

Type

integer

$orm

$orm : null|\OpenResourceManager\ORM

ORM Connection

The current ORM connection.

Type

null|\OpenResourceManager\ORM

$validCodes

$validCodes : null|array

Valid Response Codes

Response codes that are used to determine if the api request was a success.

Type

null|array

Methods

__construct()

__construct(\OpenResourceManager\ORM  $orm) 

Client Constructor

Constructs a client.

Parameters

\OpenResourceManager\ORM $orm

getORM()

getORM() : \OpenResourceManager\ORM

Get ORM Connection

Returns the current ORM object

Returns

\OpenResourceManager\ORM

getPage()

getPage() : integer

Get Page

Returns the current page

Returns

integer

setPage()

setPage(integer  $page = 1) 

Set Page

Sets the target page.

Parameters

integer $page

addPage()

addPage(integer  $page = 1) 

Add Page

Adds to the target page.

Parameters

integer $page

subPage()

subPage(integer  $page = 1) 

Subtract Page

Sets the target page back.

Parameters

integer $page

getList()

getList() : \Unirest\Response

Get Service Account List

Gets a list of service accounts.

Returns

\Unirest\Response

get()

get(integer  $id) : \Unirest\Response

Get Service Account

Gets a service account by it's ID.

Parameters

integer $id

Returns

\Unirest\Response

delete()

delete(integer  $id) : \Unirest\Response

Delete Service Account

Delete a service account by it's ID.

Parameters

integer $id

Returns

\Unirest\Response

deleteFromIdentifier()

deleteFromIdentifier(string  $identifier) : \Unirest\Response

Delete Service Account From Identifier

Delete a service account by it's identifier.

Parameters

string $identifier

Returns

\Unirest\Response

deleteFromUsername()

deleteFromUsername(string  $username) : \Unirest\Response

Delete Service Account From Username

Delete a service account by it's username.

Parameters

string $username

Returns

\Unirest\Response

getFromUsername()

getFromUsername(string  $username) : \Unirest\Response

Get Service Account From Username

Gets a service account by it's username.

Parameters

string $username

Returns

\Unirest\Response

getFromIdentifier()

getFromIdentifier(string  $identifier) : \Unirest\Response

Get Service Account From Identifier

Gets a service account by it's identifier.

Parameters

string $identifier

Returns

\Unirest\Response

store()

store(string  $identifier, string  $username, string  $name_first, string  $name_last, boolean  $should_propagate_password = null, string  $password = null, integer  $account_id = null, string  $account_identifier = null, string  $account_username = null, \OpenResourceManager\Client\DateTime  $expires_at = null, boolean  $disabled = null) : \Unirest\Response

Store Service Account

Create or update a service account, by either it's username, identifier.

Parameters

string $identifier
string $username
string $name_first
string $name_last
boolean $should_propagate_password
string $password
integer $account_id
string $account_identifier
string $account_username
\OpenResourceManager\Client\DateTime $expires_at
boolean $disabled

Returns

\Unirest\Response

urlFromRoute()

urlFromRoute(string  $path = '') : string

URL From Route

Forms an API url from a route path.

Parameters

string $path

Returns

string

_get()

_get(string  $slug = '') : \Unirest\Response

_Get

Performs a get request to a specified url slug.

Parameters

string $slug

Returns

\Unirest\Response

_post()

_post(array  $fields = array(), string  $slug = '') : \Unirest\Response

_Post

Performs a post request to a specified url slug.

Parameters

array $fields
string $slug

Throws

\Exception

Returns

\Unirest\Response

_patch()

_patch(array  $fields = array(), string  $slug = '') : \Unirest\Response

_Patch

Performs a patch request to a specified url slug.

Parameters

array $fields
string $slug

Throws

\Exception

Returns

\Unirest\Response

_del()

_del(array  $fields = array(), string  $slug = '') : \Unirest\Response

_Del

Performs a delete request to a specified url slug.

Parameters

array $fields
string $slug

Throws

\Exception

Returns

\Unirest\Response

getFromCode()

getFromCode(string  $code) : \Unirest\Response

Get From Code

Gets an object by it's Code.

Parameters

string $code

Returns

\Unirest\Response

deleteFromCode()

deleteFromCode(string  $code) : \Unirest\Response

Delete From Code

Delete an object by it's code.

Parameters

string $code

Returns

\Unirest\Response