Service
extends AbstractService
in package
Class responsible for working with Rackspace's Cloud Identity service.
Table of Contents
- PATCH_CONTENT_TYPE = OpenCloudCommonConstantsMime::JSON_PATCH
- $aliases : array<string|int, mixed>
- The aliases configure for the properties of the instance.
- $client : Client
- $endpoint : Endpoint
- $namespaces : array<string|int, mixed>
- $resources : array<string|int, mixed>
- $logger : LoggerInterface
- The logger instance
- $properties : array<string|int, mixed>
- Holds all the properties added by overloading.
- __call() : mixed
- Intercept non-existent method calls for dynamic getter/setter functionality.
- checkJsonError() : mixed
- Checks the most recent JSON operation for errors.
- collection() : mixed
- createUser() : User
- Create a new user with provided params.
- factory() : self
- Factory method which allows for easy service creation
- generateToken() : Response
- Generate a new token for a given user.
- generateUuid() : mixed
- getClient() : Client
- getEndpoint() : Endpoint
- getInstance() : static
- getLogger() : LoggerInterface
- Returns the Logger object.
- getNamespaces() : array<string|int, mixed>
- Returns a list of supported namespaces
- getResources() : array<string|int, mixed>
- Get all associated resources for this service.
- getRole() : Role
- Get a specific role.
- getRoles() : PaginatedIterator
- Get all possible roles.
- getTenants() : ResourceIterator
- List over all the tenants for this cloud account.
- getUrl() : Url
- Get this service's URL, with appended path if necessary.
- getUser() : User
- Get a user based on a particular keyword and a certain search mode.
- getUsers() : ResourceIterator
- Get all users for the current tenant.
- hasLogger() : bool
- makeResourceIteratorOptions() : mixed
- namespaces() : mixed
- populate() : mixed
- Populates the current object based on an unknown data type.
- resource() : object
- Factory method for instantiating resource objects.
- resourceList() : PaginatedIterator
- Factory method for instantiating a resource collection.
- revokeToken() : Response
- Revoke a given token based on its ID
- setClient() : mixed
- setEndpoint() : mixed
- setLogger() : $this
- Sets the logger.
- stripNamespace() : mixed
- toCamel() : mixed
- Convert a string to camelCase format.
- toUnderscores() : mixed
- Convert string to underscore format.
- url() : mixed
- user() : mixed
- Used for iterator resource instantation.
- getCurrentNamespace() : type
- Internal method for accessing child namespace from parent scope.
- getJsonHeader() : mixed
- getPatchHeaders() : mixed
- getProperty() : mixed
- Grab value out of the data array.
- propertyExists() : bool
- Basic check to see whether property exists.
- resolveResourceClass() : string
- Resolves FQCN for local resource.
- setProperty() : mixed
- We can set a property under three conditions:
- checkAttributePrefix() : bool
- Checks the attribute $property and only permits it if the prefix is in the specified $prefixes array
- isAccessible() : bool
- Does the property exist in the object variable list (i.e. does it have public or protected visibility?)
Constants
PATCH_CONTENT_TYPE
public
mixed
PATCH_CONTENT_TYPE
= OpenCloudCommonConstantsMime::JSON_PATCH
Properties
$aliases
The aliases configure for the properties of the instance.
protected
array<string|int, mixed>
$aliases
= array()
$client
protected
Client
$client
The client which interacts with the API.
$endpoint
protected
Endpoint
$endpoint
The endpoint for this service.
$namespaces
protected
array<string|int, mixed>
$namespaces
= array()
Namespaces for this service.
$resources
protected
array<string|int, mixed>
$resources
= array()
A collection of resource models that this service has control over.
$logger
The logger instance
private
LoggerInterface
$logger
$properties
Holds all the properties added by overloading.
private
array<string|int, mixed>
$properties
= array()
Methods
__call()
Intercept non-existent method calls for dynamic getter/setter functionality.
public
__call( $method, $args) : mixed
Parameters
Tags
Return values
mixed —checkJsonError()
Checks the most recent JSON operation for errors.
public
static checkJsonError() : mixed
Tags
Return values
mixed —collection()
public
collection(mixed $class[, mixed $url = null ][, mixed $parent = null ][, mixed $data = null ]) : mixed
Parameters
- $class : mixed
- $url : mixed = null
- $parent : mixed = null
- $data : mixed = null
Tags
Return values
mixed —createUser()
Create a new user with provided params.
public
createUser( $params) : User
Parameters
Return values
User —factory()
Factory method which allows for easy service creation
public
static factory(ClientInterface $client) : self
Parameters
- $client : ClientInterface
Return values
self —generateToken()
Generate a new token for a given user.
public
generateToken( $json[, array<string|int, mixed> $headers = array() ]) : Response
Parameters
- $json :
-
string The JSON data-structure used in the HTTP entity body when POSTing to the API
- $headers : array<string|int, mixed> = array()
Tags
Return values
Response —generateUuid()
public
static generateUuid() : mixed
Return values
mixed —getClient()
public
getClient() : Client
Return values
Client —getEndpoint()
public
getEndpoint() : Endpoint
Return values
Endpoint —getInstance()
public
static getInstance() : static
Return values
static —getLogger()
Returns the Logger object.
public
getLogger() : LoggerInterface
Return values
LoggerInterface —getNamespaces()
Returns a list of supported namespaces
public
getNamespaces() : array<string|int, mixed>
Return values
array<string|int, mixed> —getResources()
Get all associated resources for this service.
public
getResources() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —getRole()
Get a specific role.
public
getRole( $roleId) : Role
Parameters
Return values
Role —getRoles()
Get all possible roles.
public
getRoles() : PaginatedIterator
Return values
PaginatedIterator —getTenants()
List over all the tenants for this cloud account.
public
getTenants() : ResourceIterator
Return values
ResourceIterator —getUrl()
Get this service's URL, with appended path if necessary.
public
getUrl([mixed $path = null ]) : Url
Parameters
- $path : mixed = null
Return values
Url —getUser()
Get a user based on a particular keyword and a certain search mode.
public
getUser( $search[, $mode = UserConst::MODE_NAME ]) : User
Parameters
Return values
User —getUsers()
Get all users for the current tenant.
public
getUsers() : ResourceIterator
Return values
ResourceIterator —hasLogger()
public
hasLogger() : bool
Return values
bool —makeResourceIteratorOptions()
public
makeResourceIteratorOptions(mixed $resource) : mixed
Parameters
- $resource : mixed
Return values
mixed —namespaces()
public
namespaces() : mixed
Tags
Return values
mixed —populate()
Populates the current object based on an unknown data type.
public
populate(mixed $info[, mixed $setObjects = true ]) : mixed
Parameters
- $info : mixed
- $setObjects : mixed = true
Tags
Return values
mixed —resource()
Factory method for instantiating resource objects.
public
resource(string $resourceName[, mixed $info = null ][, mixed $parent = null ]) : object
Parameters
- $resourceName : string
- $info : mixed = null
-
(default: null)
- $parent : mixed = null
-
The parent object
Return values
object —resourceList()
Factory method for instantiating a resource collection.
public
resourceList(string $resourceName[, string|null $url = null ][, string|null $parent = null ]) : PaginatedIterator
Parameters
- $resourceName : string
- $url : string|null = null
- $parent : string|null = null
Return values
PaginatedIterator —revokeToken()
Revoke a given token based on its ID
public
revokeToken( $tokenId) : Response
Parameters
Return values
Response —setClient()
public
setClient(ClientInterface $client) : mixed
Parameters
- $client : ClientInterface
Return values
mixed —setEndpoint()
public
setEndpoint(Endpoint $endpoint) : mixed
Parameters
- $endpoint : Endpoint
Return values
mixed —setLogger()
Sets the logger.
public
setLogger([LoggerInterface $logger = null ]) : $this
Parameters
- $logger : LoggerInterface = null
Return values
$this —stripNamespace()
public
stripNamespace(mixed $namespace) : mixed
Parameters
- $namespace : mixed
Return values
mixed —toCamel()
Convert a string to camelCase format.
public
toCamel( $string[, bool $capitalise = true ]) : mixed
Parameters
Return values
mixed —toUnderscores()
Convert string to underscore format.
public
toUnderscores( $string) : mixed
Parameters
Return values
mixed —url()
public
url([mixed $path = null ][, array<string|int, mixed> $query = array() ]) : mixed
Parameters
- $path : mixed = null
- $query : array<string|int, mixed> = array()
Tags
Return values
mixed —user()
Used for iterator resource instantation.
public
user([mixed $info = null ]) : mixed
Parameters
- $info : mixed = null
Return values
mixed —getCurrentNamespace()
Internal method for accessing child namespace from parent scope.
protected
getCurrentNamespace() : type
Return values
type —getJsonHeader()
protected
static getJsonHeader() : mixed
Return values
mixed —getPatchHeaders()
protected
static getPatchHeaders() : mixed
Return values
mixed —getProperty()
Grab value out of the data array.
protected
getProperty(string $property) : mixed
Parameters
- $property : string
Return values
mixed —propertyExists()
Basic check to see whether property exists.
protected
propertyExists(string $property[, bool $allowRetry = true ]) : bool
Parameters
- $property : string
-
The property name being investigated.
- $allowRetry : bool = true
-
If set to TRUE, the check will try to format the name in underscores because there are sometimes discrepancies between camelCaseNames and underscore_names.
Return values
bool —resolveResourceClass()
Resolves FQCN for local resource.
protected
resolveResourceClass( $resourceName) : string
Parameters
Tags
Return values
string —setProperty()
We can set a property under three conditions:
protected
setProperty(mixed $property, mixed $value) : mixed
- If it has a concrete setter: setProperty()
- If the property exists
- If the property name's prefix is in an approved list
Parameters
- $property : mixed
- $value : mixed
Return values
mixed —checkAttributePrefix()
Checks the attribute $property and only permits it if the prefix is in the specified $prefixes array
private
checkAttributePrefix(string $property) : bool
This is to support extension namespaces in some services.
Parameters
- $property : string
-
the name of the attribute
Return values
bool —isAccessible()
Does the property exist in the object variable list (i.e. does it have public or protected visibility?)
private
isAccessible( $property) : bool