Google HTTP Target tasks: Expect GoogleProtobufTimestamp when tried to setScheduleTime using php

I have been trying to add setScheduleTime to the cloud task. I have done the following:

use GoogleCloudTasksV2CloudTasksClient;
use GoogleCloudTasksV2HttpMethod;
use GoogleCloudTasksV2HttpRequest;
use GoogleCloudTasksV2Task;

class CreateRandomCloudTasksForLot
        $client = new CloudTasksClient();
        $queueName = $client->queueName($this->projectID, $this->location, $this->queue);

        $httpRequest = new HttpRequest();
        if (isset($payload)) {

        // Create a Cloud Task object.
        $task = new Task();

        // Send request and print the task name.
        $response = $client->createTask($queueName, $task);
        printf('Created task %s' . PHP_EOL, $response->getName());

It gives me the following error

Without passing the scheduled time I can create tasks but I need to schedule at a specific time. I cannot use appEngineTask because we can pass only RelativeUri. I want to pass the cloud function URL to execute. Can anyone please help me?

Source: Laravel

Leave a Reply