private function objectToParameter($object)
{
if ($object instanceof ValueInterface) {
return [['type' => $object->type()], ['value' => (string) $object]];
}
if ($object instanceof \DateTimeInterface) {
return [['type' => self::TYPE_DATETIME], ['value' => $object->format(self::DATETIME_FORMAT)]];
}
if ($object instanceof Int64) {
return [['type' => self::TYPE_INT64], ['value' => $object->get()]];
}
throw new \InvalidArgumentException(sprintf('Unrecognized object %s. Please ensure you are using the latest version of google/cloud.', get_class($object)));
}