Achal Gupta
Achal Gupta

Reputation: 11

Undefined class constant 'PAGINATED_CALL' in google/cloud-video-transcoder/src/V1/resources/transcoder_service_descriptor_config.php:87

I am trying to use Google Video Transcoding API from PHP. Following is the environment:

google/gax: v1.18.2
google/google/cloud-video-transcoder: v0.8.1

However, I am getting following error message:

PHP Fatal error: Uncaught Error: Undefined class constant 'PAGINATED_CALL' in /var/www/html/wp-content/plugins/ideasymind-massage/vendor/google/cloud-video-transcoder/src/V1/resources/transcoder_service_descriptor_config.php:87

Here is the code I am using:

$transcoderServiceClient = new TranscoderServiceClient();

$formattedParent = $transcoderServiceClient->locationName($projectId, $location);
$job = new Job();
$job->setInputUri($inputUri);
$job->setOutputUri($outputUri);
$job->setTemplateId($preset);
$request = (new CreateJobRequest())
    ->setParent($formattedParent)
    ->setJob($job);

$response = $transcoderServiceClient->createJob($request);

Here is the code snippet of transcoder_service_descriptor_config.php:87

'ListJobTemplates' => [
    'pageStreaming' => [
        'requestPageTokenGetMethod' => 'getPageToken',
        'requestPageTokenSetMethod' => 'setPageToken',
        'requestPageSizeGetMethod' => 'getPageSize',
        'requestPageSizeSetMethod' => 'setPageSize',
        'responsePageTokenGetMethod' => 'getNextPageToken',
        'resourcesGetMethod' => 'getJobTemplates',
    ],
    'callType' => \Google\ApiCore\Call::PAGINATED_CALL,
    'responseType' => 'Google\Cloud\Video\Transcoder\V1\ListJobTemplatesResponse',
    'headerParams' => [
        [
            'keyName' => 'parent',
            'fieldAccessors' => [
                'getParent',
            ],
        ],
    ],
],

However I notice that PAGINATED_CALL is indeed defined in google/gax/src/Call.php:

namespace Google\ApiCore;

use Google\Protobuf\Internal\Message;

/**
 * Contains information necessary to manage a network request.
 */
class Call
{
    const UNARY_CALL = 0;
    const BIDI_STREAMING_CALL = 1;
    const CLIENT_STREAMING_CALL = 2;
    const SERVER_STREAMING_CALL = 3;
    const LONGRUNNING_CALL = 4;
    const PAGINATED_CALL = 5;

....
}

Can someone help understand how to resolve this issue? I am not able to submit transcoding job to Google Cloud due to this.

Thx a lot in advance for helping!

Upvotes: 1

Views: 149

Answers (0)

Related Questions