{"action":"created","issue":{"url":"https://api.github.com/repos/rackspace/php-opencloud/issues/545","labels_url":"https://api.github.com/repos/rackspace/php-opencloud/issues/545/labels{/name}","comments_url":"https://api.github.com/repos/rackspace/php-opencloud/issues/545/comments","events_url":"https://api.github.com/repos/rackspace/php-opencloud/issues/545/events","html_url":"https://github.com/rackspace/php-opencloud/issues/545","id":58970362,"number":545,"title":"Possible to get DataObject from Guzzle response?","user":{"login":"shanebonham","id":423741,"avatar_url":"https://avatars.githubusercontent.com/u/423741?v=3","gravatar_id":"","url":"https://api.github.com/users/shanebonham","html_url":"https://github.com/shanebonham","followers_url":"https://api.github.com/users/shanebonham/followers","following_url":"https://api.github.com/users/shanebonham/following{/other_user}","gists_url":"https://api.github.com/users/shanebonham/gists{/gist_id}","starred_url":"https://api.github.com/users/shanebonham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shanebonham/subscriptions","organizations_url":"https://api.github.com/users/shanebonham/orgs","repos_url":"https://api.github.com/users/shanebonham/repos","events_url":"https://api.github.com/users/shanebonham/events{/privacy}","received_events_url":"https://api.github.com/users/shanebonham/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"ycombinator","id":51061,"avatar_url":"https://avatars.githubusercontent.com/u/51061?v=3","gravatar_id":"","url":"https://api.github.com/users/ycombinator","html_url":"https://github.com/ycombinator","followers_url":"https://api.github.com/users/ycombinator/followers","following_url":"https://api.github.com/users/ycombinator/following{/other_user}","gists_url":"https://api.github.com/users/ycombinator/gists{/gist_id}","starred_url":"https://api.github.com/users/ycombinator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ycombinator/subscriptions","organizations_url":"https://api.github.com/users/ycombinator/orgs","repos_url":"https://api.github.com/users/ycombinator/repos","events_url":"https://api.github.com/users/ycombinator/events{/privacy}","received_events_url":"https://api.github.com/users/ycombinator/received_events","type":"User","site_admin":false},"milestone":null,"comments":1,"created_at":"2015-02-25T21:10:26Z","updated_at":"2015-02-25T21:59:50Z","closed_at":null,"body":"Hi there,\r\n\r\n`OpenCloud\\ObjectStore\\Resource\\Container::uploadObjects()` returns an array of Guzzle responses (in contrast to `uploadObject()` which returns a `DataObject`).\r\n\r\nIs it possible to get the `DataObject` from a Guzzle response? I need to upload a batch of files, but then store each file's public URL."},"comment":{"url":"https://api.github.com/repos/rackspace/php-opencloud/issues/comments/76069764","html_url":"https://github.com/rackspace/php-opencloud/issues/545#issuecomment-76069764","issue_url":"https://api.github.com/repos/rackspace/php-opencloud/issues/545","id":76069764,"user":{"login":"ycombinator","id":51061,"avatar_url":"https://avatars.githubusercontent.com/u/51061?v=3","gravatar_id":"","url":"https://api.github.com/users/ycombinator","html_url":"https://github.com/ycombinator","followers_url":"https://api.github.com/users/ycombinator/followers","following_url":"https://api.github.com/users/ycombinator/following{/other_user}","gists_url":"https://api.github.com/users/ycombinator/gists{/gist_id}","starred_url":"https://api.github.com/users/ycombinator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ycombinator/subscriptions","organizations_url":"https://api.github.com/users/ycombinator/orgs","repos_url":"https://api.github.com/users/ycombinator/repos","events_url":"https://api.github.com/users/ycombinator/events{/privacy}","received_events_url":"https://api.github.com/users/ycombinator/received_events","type":"User","site_admin":false},"created_at":"2015-02-25T21:59:50Z","updated_at":"2015-02-25T21:59:50Z","body":"Unfortunately there is no direct way to do this with the SDK. However, the following snippet of code should get you what you need, assuming you had the line `$responses = $container->uploadObjects($objects)`:\r\n\r\n```php\r\nforeach ($responses as $index => $response) {\r\n    $dataObject = $container->dataObject()\r\n        ->populateFromResponse($response);\r\n    $dataObject->setName($objects[$index]['name']);\r\n    echo $dataObject->getPublicUrl();\r\n}\r\n```"}}