Skip to content

Commit 3168826

Browse files
authored
Create Translate client (#1250)
* Create Translate client * Adding tests * Update psalm baseline * Updated AwsPackagesProvider.php * Fixed bugs
1 parent b201546 commit 3168826

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/AwsClientFactory.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
use AsyncAws\StepFunctions\StepFunctionsClient;
4141
use AsyncAws\TimestreamQuery\TimestreamQueryClient;
4242
use AsyncAws\TimestreamWrite\TimestreamWriteClient;
43+
use AsyncAws\Translate\TranslateClient;
4344
use AsyncAws\XRay\XRayClient;
4445
use Psr\Log\LoggerInterface;
4546
use Psr\Log\NullLogger;
@@ -481,6 +482,19 @@ public function timestreamWrite(): TimestreamWriteClient
481482
return $this->serviceCache[__METHOD__];
482483
}
483484

485+
public function translate(): TranslateClient
486+
{
487+
if (!class_exists(TranslateClient::class)) {
488+
throw MissingDependency::create('async-aws/translate', 'Translate');
489+
}
490+
491+
if (!isset($this->serviceCache[__METHOD__])) {
492+
$this->serviceCache[__METHOD__] = new TranslateClient($this->configuration, $this->credentialProvider, $this->httpClient, $this->logger);
493+
}
494+
495+
return $this->serviceCache[__METHOD__];
496+
}
497+
484498
public function xRay(): XRayClient
485499
{
486500
if (!class_exists(XRayClient::class)) {

0 commit comments

Comments
 (0)