LKDevelopment / hetzner-cloud-php-sdk

A PHP SDK for the Hetzner Cloud API
MIT License
104 stars 51 forks source link

Missing root password into rebuild response #17

Closed mateusz324 closed 5 years ago

mateusz324 commented 5 years ago

In a: https://github.com/LKDevelopment/hetzner-cloud-php-sdk/blob/master/src/Models/Servers/Server.php#L354

you should change this code:

           return APIResponse::create([
                'action' => Action::parse(json_decode((string)$response->getBody())->action)
            ], $response->getHeaders());

on this:

            $payload = json_decode((string)$response->getBody());
            return APIResponse::create(array_merge([
                'action' => Action::parse($payload->action),
            ], (property_exists($payload, 'root_password')) ? ['root_password' => $payload->root_password] : []
            ), $response->getHeaders());
LKaemmerling commented 5 years ago

Was released with v1.6.1