public function __construct(ConnectionInterface $connection, $projectId, $name, $encode, array $info = null)
{
$this->connection = $connection;
$this->projectId = $projectId;
$this->encode = (bool) $encode;
$this->info = $info;
// Accept either a simple name or a fully-qualified name.
if ($this->isFullyQualifiedName('topic', $name)) {
$this->name = $name;
} else {
$this->name = $this->formatName('topic', $name, $projectId);
}
$iamConnection = new IamTopic($this->connection);
$this->iam = new Iam($iamConnection, $this->name);
}