PHP SDK Operation not found: StartTextTranslationJob

0

Trying to use the async batch translate API with the AWS PHP SDK (updated to 3.130.3 via composer) and get returned the error "Operation not found: StartTextTranslationJob" when calling the job:

$result = $client->StartTextTranslationJob([
			    'ClientToken' => $job_uuid, // REQUIRED
			    'DataAccessRoleArn' => 'myiam', // REQUIRED
			    'InputDataConfig' => [ // REQUIRED
			        'ContentType' => 'text/plain ', // REQUIRED
			        'S3Uri' => 'myinput', // REQUIRED
			    ],
			    'JobName' => 'myjobname',
			    'OutputDataConfig' => [ // REQUIRED
			        'S3Uri' => 'my output', // REQUIRED
			    ],
			    'SourceLanguageCode' => $currentLanguage, // REQUIRED
			    'TargetLanguageCodes' => $languages, // REQUIRED
			    'TerminologyNames' => ['my_terminology'],
			]);

I have been using TranslteText successfully for a few months but it is beginning to throttle so I am trying to move larger text strings into async batch jobs.

I have opened the TranslateClient.php file and it does not seem to describe StartTextTranslationJob:

namespace Aws\Translate;

use Aws\AwsClient;

/**
 * This client is used to interact with the **Amazon Translate** service.
 * @method \Aws\Result deleteTerminology(array $args = [])
 * @method \GuzzleHttp\Promise\Promise deleteTerminologyAsync(array $args = [])
 * @method \Aws\Result getTerminology(array $args = [])
 * @method \GuzzleHttp\Promise\Promise getTerminologyAsync(array $args = [])
 * @method \Aws\Result importTerminology(array $args = [])
 * @method \GuzzleHttp\Promise\Promise importTerminologyAsync(array $args = [])
 * @method \Aws\Result listTerminologies(array $args = [])
 * @method \GuzzleHttp\Promise\Promise listTerminologiesAsync(array $args = [])
 * @method \Aws\Result translateText(array $args = [])
 * @method \GuzzleHttp\Promise\Promise translateTextAsync(array $args = [])
 */
class TranslateClient extends AwsClient

Any clues?

Edited by: elderbre on May 2, 2020 4:03 AM

demandé il y a 4 ans411 vues
1 réponse
0

Finally found out the issue. Those calls were added in version 3.132 and my composer was only updating to 3.130 due to another dependency and I wasn't seeing that. Updated the dependency then was sdk to 1.137.1 and voila.

répondu il y a 4 ans

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions