You could use a `{?data*}` template for this:

    $this->client->post(['/containers/{id}/attach{?data*}', [
        'id' => $container->getId(),
        'data' => [
            'logs' => $logs,
            'stream' => $stream,
            ...
        ]
    ]]);