Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions lib/OpenCloud/Identity/Resource/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
use OpenCloud\Common\Collection\PaginatedIterator;
use OpenCloud\Common\Http\Message\Formatter;
use OpenCloud\Common\PersistentObject;
use OpenCloud\Rackspace;

/**
* User class which encapsulates functionality for a user.
Expand Down Expand Up @@ -68,6 +69,18 @@ class User extends PersistentObject
protected static $url_resource = 'users';
protected static $json_name = 'user';

public function createJson()
{
$json = parent::createJson();

if ($this->getClient() instanceof Rackspace) {
$json->user->username = $json->user->name;
unset($json->user->name);
}

return $json;
}

/**
* @param $region Set the default region
*/
Expand Down