# Class User

User class which encapsulates functionality for a user.

A user is a digital representation of a person, system, or service who consumes cloud services. Users have credentials and may be assigned tokens; based on these credentials and tokens, the authentication service validates that incoming requests are being made by the user who claims to be making the request, and that the user has the right to access the requested resources. Users may be directly assigned to a particular tenant and behave as if they are contained within that tenant.

  OpenCloud\Common\Base
  OpenCloud\Common\Resource\BaseResource
  OpenCloud\Common\Resource\PersistentResource
  OpenCloud\Common\PersistentObject
  OpenCloud\Identity\Resource\User

Namespace: OpenCloud\Identity\Resource
Package: OpenCloud\Identity\Resource
Located at OpenCloud/Identity/Resource/User.php

Methods summary
`public` | # `setDefaultRegion( mixed $region )` #### Parameters $region `mixed` $region Set the default region
`public string` | # `getDefaultRegion( )` #### Returns `string` Get the default region
`public` | # `setDomainId( mixed $domainId )` #### Parameters $domainId `mixed` $domainId Set the domain ID
`public string` | # `getDomainId( )` #### Returns `string` Get the domain ID
`public` | # `setId( mixed $id )` #### Parameters $id `mixed` $id Set the ID
`public integer` | # `getId( )` #### Returns `integer` Get the ID
`public` | # `setUsername( mixed $username )` #### Parameters $username `mixed` $username Set the username
`public string` | # `getUsername( )` #### Returns `string` Get the username
`public` | # `setEmail( mixed $email )` #### Parameters $email `mixed` $email Sets the email
`public string` | # `getEmail( )` #### Returns `string` Get the email
`public` | # `setEnabled( mixed $enabled )` #### Parameters $enabled `mixed` $enabled Sets the enabled flag
`public boolean` | # `getEnabled( )` #### Returns `boolean` Get the enabled flag
`public boolean` | # `isEnabled( )` #### Returns `boolean` Check whether this user is enabled or not
`public` | # `setPassword( mixed $password )` #### Parameters $password `mixed` $password Set the password
`public string` | # `getPassword( )` #### Returns `string` Get the password
`public string` | # `primaryKeyField( )` #### Returns `string` #### Overrides `OpenCloud\Common\Resource\BaseResource::primaryKeyField()`
`public` | # `updateJson( mixed $params = array() )` Provides JSON for update request body Provides JSON for update request body #### Overrides `OpenCloud\Common\Resource\PersistentResource::updateJson()`
`public Guzzle\Http\Message\Response` | # `updatePassword( mixed $newPassword )` This operation will set the user's password to a new value. This operation will set the user's password to a new value. #### Parameters $newPassword `mixed` $newPassword The new password to use for this user #### Returns `Guzzle\Http\Message\Response`
`public array|null` | # `getOtherCredentials( )` This operation lists a user's non-password credentials for all authentication methods available to the user. This operation lists a user's non-password credentials for all authentication methods available to the user. #### Returns `array|null`
`public string|null` | # `getApiKey( )` Get the API key for this user. Get the API key for this user. #### Returns `string|null`
`public string|null` | # `resetApiKey( )` Reset the API key for this user to a new arbitrary value (which is returned). Reset the API key for this user to a new arbitrary value (which is returned). #### Returns `string|null`
`public Guzzle\Http\Message\Response` | # `addRole( mixed $roleId )` Add a role, specified by its ID, to a user. Add a role, specified by its ID, to a user. #### Parameters $roleId `mixed` $roleId #### Returns `Guzzle\Http\Message\Response`
`public Guzzle\Http\Message\Response` | # `removeRole( mixed $roleId )` Remove a role, specified by its ID, from a user. Remove a role, specified by its ID, from a user. #### Parameters $roleId `mixed` $roleId #### Returns `Guzzle\Http\Message\Response`
`public `OpenCloud\Common\Collection\PaginatedIterator`` | # `getRoles( )` Get all the roles for which this user is associated with. Get all the roles for which this user is associated with. #### Returns ``OpenCloud\Common\Collection\PaginatedIterator``
`public Guzzle\Http\Message\Response` | # `update( array $params = array() )` Update a resource Update a resource #### Parameters $params `array` $params #### Returns `Guzzle\Http\Message\Response` #### Overrides `OpenCloud\Common\Resource\PersistentResource::update()`

Methods inherited from OpenCloud\Common\Resource\PersistentResource
`checkExtension(), create(), createJson(), delete(), getAlias(), noCreate(), noDelete(), noUpdate(), refresh(), refreshFromLocationUrl(), waitFor()`

Methods inherited from OpenCloud\Common\Resource\BaseResource
`__construct(), findLink(), getClient(), getMetadata(), getParent(), getService(), getUrl(), jsonCollectionElement(), jsonCollectionName(), jsonName(), parseResponse(), resourceName(), setMetadata(), setParent(), setService()`

Methods inherited from OpenCloud\Common\Base
`__call(), checkJsonError(), generateUuid(), getInstance(), getJsonHeader(), getLogger(), getProperty(), makeResourceIteratorOptions(), populate(), propertyExists(), setLogger(), setProperty(), stripNamespace(), toCamel(), toUnderscores()`

Properties summary
`protected array` | $createKeys | `array('username', 'email', 'enabled', 'password')` | #
`protected array` | $updateKeys | `array('username', 'email', 'enabled', 'RAX-AUTH:defaultRegion', 'RAX-AUTH:domainId', 'id')` | #
`protected array` | $aliases | `array( 'name' => 'username', 'RAX-AUTH:defaultRegion' => 'defaultRegion', 'RAX-AUTH:domainId' => 'domainId', 'OS-KSADM:password' => 'password' )` | # The aliases configure for the properties of the instance. The aliases configure for the properties of the instance.
`protected static string` | $url_resource | `'users'` | #
`protected static string` | $json_name | `'user'` | #

Properties inherited from OpenCloud\Common\Resource\BaseResource
`$metadata, $parent, $service`