You could cast the object as an array as such:
$array = (array) $object;
And access all its properties but you might have to array walk and filter the name of the class out.
But this is a hack and an example of bad practise. Accessing protected properties by its methods is the way to go or else request json object instead, if possible.
Naturally, you would say
$object = (object) $inputObject; $value = (string) $object->getValue();
$value = (array) $object->getArray();